From 3014d414ba9815a8c94c6c1726d8160ca0abaf94 Mon Sep 17 00:00:00 2001 From: d-leroy Date: Fri, 7 Apr 2017 13:23:06 +0200 Subject: [PATCH 01/31] Added event, property and scenario metamodel, conditional breakpoints and scenario manager --- .../.classpath | 8 + .../.project | 40 + .../org.eclipse.core.resources.prefs | 2 + .../META-INF/MANIFEST.MF | 21 + .../build.properties | 6 + .../plugin.xml | 4 + .../event/AbstractEventManager.java | 173 ++ .../property/propertyAspects.xtend | 194 ++ .../scenario/IScenarioManager.java | 14 + .../interpreter/scenario/ScenarioManager.java | 172 ++ .../.classpath | 7 + .../.project | 28 + .../META-INF/MANIFEST.MF | 20 + .../build.properties | 10 + ...operty_left_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...erty_left_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...erty_left_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...perty_left_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...perty_right_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...rty_right_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...rty_right_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...erty_right_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...ty_property_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ..._property_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ..._property_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...y_property_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...ty_property_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ..._property_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ..._property_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...y_property_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes .../CreateReport_stages_StageReport.gif | Bin 0 -> 223 bytes ...ty_property_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ..._property_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ..._property_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...y_property_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ..._property_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ..._property_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...e_property_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes .../full/obj16/ContainerReferenceProperty.gif | Bin 0 -> 129 bytes .../icons/full/obj16/Event.gif | Bin 0 -> 129 bytes .../full/obj16/IntegerAttributeProperty.gif | Bin 0 -> 129 bytes .../obj16/ManyBooleanAttributeProperty.gif | Bin 0 -> 129 bytes .../obj16/ManyIntegerAttributeProperty.gif | Bin 0 -> 129 bytes .../obj16/ManyStringAttributeProperty.gif | Bin 0 -> 129 bytes .../icons/full/obj16/Report.gif | Bin 0 -> 129 bytes .../icons/full/obj16/Scenario.gif | Bin 0 -> 129 bytes .../icons/full/obj16/StageReport.gif | Bin 0 -> 129 bytes .../plugin.properties | 73 + .../plugin.xml | 48 + .../provider/BinaryPropertyItemProvider.java | 224 ++ .../BooleanAttributePropertyItemProvider.java | 143 ++ .../provider/ClassPropertyItemProvider.java | 158 ++ ...ontainerReferencePropertyItemProvider.java | 157 ++ .../IntegerAttributePropertyItemProvider.java | 154 ++ ...yBooleanAttributePropertyItemProvider.java | 182 ++ ...yIntegerAttributePropertyItemProvider.java | 182 ++ .../ManyReferencePropertyItemProvider.java | 179 ++ ...nyStringAttributePropertyItemProvider.java | 182 ++ .../property/provider/PropertyEditPlugin.java | 92 + .../PropertyItemProviderAdapterFactory.java | 271 +++ .../SingleReferencePropertyItemProvider.java | 146 ++ .../StringAttributePropertyItemProvider.java | 145 ++ .../report/provider/ReportEditPlugin.java | 98 + .../report/provider/ReportItemProvider.java | 168 ++ .../ReportItemProviderAdapterFactory.java | 223 ++ .../provider/StageReportItemProvider.java | 169 ++ .../scenario/provider/EventItemProvider.java | 146 ++ .../scenario/provider/ScenarioEditPlugin.java | 95 + .../provider/ScenarioItemProvider.java | 162 ++ .../ScenarioItemProviderAdapterFactory.java | 175 ++ .../scenario/provider/StageItemProvider.java | 170 ++ .../.classpath | 7 + .../.project | 28 + .../META-INF/MANIFEST.MF | 21 + .../build.properties | 10 + .../icons/full/obj16/PropertyModelFile.gif | Bin 0 -> 346 bytes .../icons/full/obj16/ReportModelFile.gif | Bin 0 -> 346 bytes .../icons/full/wizban/NewProperty.gif | Bin 0 -> 2462 bytes .../icons/full/wizban/NewReport.gif | Bin 0 -> 2462 bytes .../plugin.properties | 65 + .../plugin.xml | 64 + .../PropertyActionBarContributor.java | 423 ++++ .../property/presentation/PropertyEditor.java | 1822 ++++++++++++++++ .../presentation/PropertyEditorPlugin.java | 94 + .../presentation/PropertyModelWizard.java | 627 ++++++ .../ReportActionBarContributor.java | 423 ++++ .../report/presentation/ReportEditor.java | 1828 +++++++++++++++++ .../presentation/ReportEditorPlugin.java | 100 + .../presentation/ReportModelWizard.java | 627 ++++++ .../presentation/ScenarioEditorPlugin.java | 97 + .../.classpath | 8 + .../.project | 34 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 29 + .../build.properties | 10 + .../model/property.ecore | 169 ++ .../model/property.genmodel | 44 + .../model/report.ecore | 18 + .../model/report.genmodel | 19 + .../model/scenario.ecore | 40 + .../model/scenario.genmodel | 27 + .../plugin.properties | 4 + .../plugin.xml | 33 + .../commons/model/EventManagerRegistry.java | 38 + .../event/commons/model/IEventManager.java | 22 + .../model/property/BinaryProperty.java | 106 + .../property/BooleanAttributeProperty.java | 79 + .../model/property/BooleanOperator.java | 241 +++ .../commons/model/property/ClassProperty.java | 67 + .../property/ContainerReferenceProperty.java | 49 + .../property/IntegerAttributeProperty.java | 79 + .../ManyBooleanAttributeProperty.java | 108 + .../ManyIntegerAttributeProperty.java | 108 + .../model/property/ManyReferenceProperty.java | 79 + .../property/ManyStringAttributeProperty.java | 108 + .../commons/model/property/Operator.java | 187 ++ .../model/property/PropertyFactory.java | 69 + .../model/property/PropertyPackage.java | 1556 ++++++++++++++ .../commons/model/property/Quantifier.java | 214 ++ .../property/SingleReferenceProperty.java | 49 + .../property/StringAttributeProperty.java | 79 + .../property/impl/BinaryPropertyImpl.java | 322 +++ .../impl/BooleanAttributePropertyImpl.java | 228 ++ .../property/impl/ClassPropertyImpl.java | 202 ++ .../impl/ContainerReferencePropertyImpl.java | 187 ++ .../impl/IntegerAttributePropertyImpl.java | 228 ++ .../ManyBooleanAttributePropertyImpl.java | 282 +++ .../ManyIntegerAttributePropertyImpl.java | 282 +++ .../impl/ManyReferencePropertyImpl.java | 256 +++ .../impl/ManyStringAttributePropertyImpl.java | 282 +++ .../property/impl/PropertyFactoryImpl.java | 227 ++ .../property/impl/PropertyPackageImpl.java | 797 +++++++ .../impl/SingleReferencePropertyImpl.java | 187 ++ .../impl/StringAttributePropertyImpl.java | 228 ++ .../property/util/PropertyAdapterFactory.java | 300 +++ .../model/property/util/PropertySwitch.java | 330 +++ .../event/commons/model/report/Report.java | 41 + .../commons/model/report/ReportFactory.java | 51 + .../commons/model/report/ReportPackage.java | 264 +++ .../commons/model/report/StageReport.java | 71 + .../model/report/impl/ReportFactoryImpl.java | 106 + .../commons/model/report/impl/ReportImpl.java | 148 ++ .../model/report/impl/ReportPackageImpl.java | 233 +++ .../model/report/impl/StageReportImpl.java | 200 ++ .../report/util/ReportAdapterFactory.java | 138 ++ .../model/report/util/ReportSwitch.java | 131 ++ .../event/commons/model/scenario/Event.java | 50 + .../commons/model/scenario/Scenario.java | 41 + .../model/scenario/ScenarioFactory.java | 33 + .../model/scenario/ScenarioPackage.java | 340 +++ .../event/commons/model/scenario/Stage.java | 79 + .../model/scenario/impl/EventImpl.java | 159 ++ .../scenario/impl/ScenarioFactoryImpl.java | 84 + .../model/scenario/impl/ScenarioImpl.java | 152 ++ .../scenario/impl/ScenarioPackageImpl.java | 284 +++ .../model/scenario/impl/StageImpl.java | 245 +++ .../scenario/util/ScenarioAdapterFactory.java | 158 ++ .../model/scenario/util/ScenarioSwitch.java | 154 ++ .../plugin.xml | 4 + .../engine/ui/commons/RunConfiguration.java | 12 +- .../ui/debug/AbstractGemocDebugger.java | 89 +- .../ui/debug/breakpoint/GemocBreakpoint.java | 5 + ...emocToggleConditionalBreakpointAction.java | 92 + .../META-INF/MANIFEST.MF | 3 +- .../META-INF/MANIFEST.MF | 2 +- .../views/EventManagerRenderer.java | 4 +- .../views/EventManagerViewPart.java | 8 +- .../eventmanager/views/EventPane.java | 2 +- .../eventmanager/views/EventTableView.java | 26 +- .../api/core/IRunConfiguration.java | 3 + .../sirius/command/AddDebugLayerHandler.java | 58 +- .../META-INF/MANIFEST.MF | 4 +- .../plugin.xml | 4 + .../GemocToggleBreakpointHandler.java | 2 +- .../debug/GenericSequentialModelDebugger.java | 35 +- ...GemocSequentialToggleBreakpointAction.java | 4 - ...tialToggleConditionalBreakpointAction.java | 26 + .../tabs/LaunchConfigurationMainTab.java | 28 +- .../traceaddon/GenericTraceConstructor.java | 2 +- .../META-INF/MANIFEST.MF | 10 +- .../generator/TraceMMGeneratorStates.xtend | 2 - .../META-INF/MANIFEST.MF | 22 +- .../clean/StandaloneEMFProjectGenerator.xtend | 3 - 183 files changed, 22164 insertions(+), 143 deletions(-) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.classpath create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.project create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.settings/org.eclipse.core.resources.prefs create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/META-INF/MANIFEST.MF create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/build.properties create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/plugin.xml create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/.classpath create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/.project create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/build.properties create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReport_stages_StageReport.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Event.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/IntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Report.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Scenario.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/StageReport.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BinaryPropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BooleanAttributePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ClassPropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ContainerReferencePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyBooleanAttributePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyIntegerAttributePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyReferencePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyStringAttributePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyEditPlugin.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/SingleReferencePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StringAttributePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportEditPlugin.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioEditPlugin.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProviderAdapterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/.classpath create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/.project create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/build.properties create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/PropertyModelFile.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyActionBarContributor.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditor.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditorPlugin.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioEditorPlugin.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.classpath create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.project create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.settings/org.eclipse.jdt.core.prefs create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/build.properties create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.genmodel create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.genmodel create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.genmodel create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.properties create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.xml create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/EventManagerRegistry.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BinaryProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanOperator.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ClassProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ContainerReferenceProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyReferenceProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Operator.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Quantifier.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/SingleReferenceProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BinaryPropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ClassPropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ContainerReferencePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyReferencePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/SingleReferencePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Event.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFactoryImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java create mode 100644 framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/sirius/action/GemocToggleConditionalBreakpointAction.java create mode 100644 java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/sirius/action/GemocSequentialToggleConditionalBreakpointAction.java diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.classpath b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.classpath new file mode 100644 index 000000000..3906c3b82 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.project b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.project new file mode 100644 index 000000000..df35f4ae4 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.project @@ -0,0 +1,40 @@ + + + fr.inria.diverse.event.commons.interpreter + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + fr.inria.diverse.k3.ui.k3Builder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + fr.inria.diverse.k3.ui.k3Nature + org.eclipse.jdt.core.javanature + org.eclipse.xtext.ui.shared.xtextNature + org.eclipse.pde.PluginNature + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.settings/org.eclipse.core.resources.prefs b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..896a9a53a --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 \ No newline at end of file diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/META-INF/MANIFEST.MF new file mode 100644 index 000000000..05195b5d1 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Bundle-SymbolicName: fr.inria.diverse.event.commons.interpreter; singleton:=true +Export-Package: fr.inria.diverse.event.commons.interpreter.property, + fr.inria.diverse.event.commons.interpreter.scenario, + fr.inria.diverse.event.commons.interpreter.event +Bundle-Name: fr.inria.diverse.event.commons.interpreter +Bundle-Version: 1.0.0 +Bundle-ClassPath: . +Require-Bundle: fr.inria.diverse.k3.al.annotationprocessor.plugin;bundle-version="3.0.0";visibility:=reexport, + org.eclipse.xtend.lib;bundle-version="2.6.0";visibility:=private, + org.eclipse.xtext.xbase.lib;bundle-version="2.6.0";visibility:=private, + com.google.guava;bundle-version="0.0.0";visibility:=private, + org.eclipse.emf.ecore.xmi;bundle-version="2.8.0";visibility:=reexport, + org.eclipse.emf.ecore;bundle-version="2.8.0";visibility:=reexport, + org.eclipse.emf.common;bundle-version="2.8.0";visibility:=reexport, + fr.inria.diverse.event.commons.model;bundle-version="0.0.0";visibility:=private, + org.eclipse.emf.transaction;bundle-version="1.9.0", + org.gemoc.xdsmlframework.api;bundle-version="2.3.0", + fr.inria.diverse.trace.commons.model +Bundle-ManifestVersion: 2 +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Manifest-Version: 1.0 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/build.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/build.properties new file mode 100644 index 000000000..4c8ab5418 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/build.properties @@ -0,0 +1,6 @@ +source.. = src/,\ + xtend-gen/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + . diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/plugin.xml new file mode 100644 index 000000000..ae5e481b5 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/plugin.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java new file mode 100644 index 000000000..a20681c68 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java @@ -0,0 +1,173 @@ +package fr.inria.diverse.event.commons.interpreter.event; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; + +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.EcoreUtil; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; +import org.gemoc.xdsmlframework.api.core.IExecutionEngine; +import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; + +import fr.inria.diverse.event.commons.interpreter.scenario.ScenarioManager; +import fr.inria.diverse.event.commons.model.EventManagerRegistry; +import fr.inria.diverse.event.commons.model.IEventManager; +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.Scenario; +import fr.inria.diverse.trace.commons.model.trace.Step; + +public abstract class AbstractEventManager implements IEventManager { + + private Resource executedModel; + + private final Queue> eventQueue = new ConcurrentLinkedQueue<>(); + + private boolean canManageEvents = true; + + private boolean waitForEvents = false; + + private Thread t = null; + + protected ScenarioManager scenarioManager; + + @Override + public void sendEvent(Object input) { + if (scenarioManager == null) { + if (input instanceof Event) { + eventQueue.add((Event) input); + if (t != null) { + synchronized (t) { + t.notify(); + } + t = null; + } + } + } + } + + @Override + public void manageEvents() { + if (canManageEvents) { + canManageEvents = false; + if (scenarioManager != null && !scenarioManager.isScenarioComplete()) { + eventQueue.addAll(scenarioManager.getEvents()); + if (waitForEvents && eventQueue.isEmpty()) { + throw new IllegalStateException("Event manager asked to wait for events while playing a scenario"); + } + } else if (waitForEvents && eventQueue.isEmpty()) { + t = Thread.currentThread(); + synchronized (t) { + try { + t.wait(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + waitForEvents = false; + } + Event event = eventQueue.poll(); + while (event != null) { + dispatchEvent(event); + event = eventQueue.poll(); + } + canManageEvents = true; + } + } + + @Override + public void waitForEvents() { + waitForEvents = true; + } + + @SuppressWarnings("rawtypes") + private Scenario pendingScenario; + + @SuppressWarnings("rawtypes") + @Override + public void loadScenario(String path, ResourceSet resourceSet) { + Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); + Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(path, true), true); + EcoreUtil.resolveAll(resource); + pendingScenario = (Scenario) resource.getContents().get(0); + } + + protected abstract void dispatchEvent(Event event); + + @Override + public void engineAboutToStart(IExecutionEngine engine) { + executedModel = engine.getExecutionContext().getResourceModel(); + scenarioManager = new ScenarioManager(pendingScenario, executedModel); + pendingScenario = null; + } + + @Override + public void engineInitialized(IExecutionEngine executionEngine) { + + } + + @Override + public void engineStarted(IExecutionEngine executionEngine) { + EventManagerRegistry.getInstance().registerManager(this); + } + + @Override + public void engineAboutToStop(IExecutionEngine engine) { + + } + + @Override + public void engineStopped(IExecutionEngine engine) { + if (scenarioManager != null) { + scenarioManager.saveScenarioReport(); + } + EventManagerRegistry.getInstance().unregisterManager(this); + } + + @Override + public void engineAboutToDispose(IExecutionEngine engine) { + + } + + @SuppressWarnings("rawtypes") + @Override + public void aboutToSelectStep(IExecutionEngine engine, Collection steps) { + + } + + @SuppressWarnings("rawtypes") + @Override + public void proposedStepsChanged(IExecutionEngine engine, Collection steps) { + + } + + @Override + public void stepSelected(IExecutionEngine engine, Step selectedStep) { + + } + + @Override + public void aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute) { + + } + + @Override + public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { + + } + + @Override + public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { + + } + + @Override + public List validate(List otherAddons) { + return Collections.emptyList(); + } +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend new file mode 100644 index 000000000..0d2106281 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend @@ -0,0 +1,194 @@ +package fr.inria.diverse.event.commons.interpreter.property + +import fr.inria.diverse.event.commons.model.property.BinaryProperty +import fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty +import fr.inria.diverse.event.commons.model.property.ClassProperty +import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty +import fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty +import fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty +import fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty +import fr.inria.diverse.event.commons.model.property.ManyReferenceProperty +import fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty +import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty +import fr.inria.diverse.event.commons.model.property.StringAttributeProperty +import fr.inria.diverse.k3.al.annotationprocessor.Aspect +import fr.inria.diverse.k3.al.annotationprocessor.OverrideAspectMethod +import java.util.List +import org.eclipse.emf.ecore.EObject + +@Aspect(className=ClassProperty) +class ClassPropertyAspect { + public def boolean evaluate(EObject o) { + false + } +} + +@Aspect(className=SingleReferenceProperty) +class SingleReferencePropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + val eObject = o.eGet(_self.feature) as EObject + return _self.property.evaluate(eObject) + } +} + +@Aspect(className=ContainerReferenceProperty) +class ContainerReferencePropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + val eObject = o.eContainer + return _self.property.evaluate(eObject) + } +} + +@Aspect(className=BinaryProperty) +class BinaryPropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + var result = false + switch (_self.operator) { + case AND: { + result = _self.left.evaluate(o) && _self.right.evaluate(o) + } + case OR: { + result = _self.left.evaluate(o) || _self.right.evaluate(o) + } + case IMPLIES: { + result = !_self.left.evaluate(o) || _self.right.evaluate(o) + } + } + return result + } +} + +@Aspect(className=ManyReferenceProperty) +class ManyPropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + val l = o.eGet(_self.feature) as List + switch (_self.quantifier) { + case EXISTS: { + if (_self.property != null) { + return l.exists[e|_self.property.evaluate(e)] + } else { + return !l.empty + } + } + case FORALL: { + return l.forall[e|_self.property.evaluate(e)] + } + } + } +} + +@Aspect(className=BooleanAttributeProperty) +class BooleanAttributePropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + val i = o.eGet(_self.feature) as Integer + var result = false + switch (_self.operator) { + case EQUAL: { + result = i == _self.value + } + } + return result + } +} + +@Aspect(className=IntegerAttributeProperty) +class IntegerAttributePropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + val i = o.eGet(_self.feature) as Integer + var result = false + switch (_self.operator) { + case EQUAL: { + result = i == _self.value + } + } + return result + } +} + +@Aspect(className=StringAttributeProperty) +class StringAttributePropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + val i = o.eGet(_self.feature) as String + var result = false + switch (_self.operator) { + case EQUAL: { + result = i == _self.value + } + } + return result + } +} + +@Aspect(className=ManyBooleanAttributeProperty) +class ManyBooleanAttributePropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + val l = o.eGet(_self.feature) as List + var result = false + switch (_self.operator) { + case EQUAL: { + switch (_self.quantifier) { + case EXISTS: { + result = l.exists[i|i == _self.value] + } + case FORALL: { + result = l.forall[i|i == _self.value] + } + } + } + } + return result + } +} + +@Aspect(className=ManyIntegerAttributeProperty) +class ManyIntegerAttributePropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + val l = o.eGet(_self.feature) as List + var result = false + switch (_self.operator) { + case EQUAL: { + switch (_self.quantifier) { + case EXISTS: { + result = l.exists[i|i == _self.value] + } + case FORALL: { + result = l.forall[i|i == _self.value] + } + } + } + } + return result + } +} + +@Aspect(className=ManyStringAttributeProperty) +class ManyStringAttributePropertyAspect extends ClassPropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + val l = o.eGet(_self.feature) as List + var result = false + switch (_self.operator) { + case EQUAL: { + switch (_self.quantifier) { + case EXISTS: { + result = l.exists[i|i == _self.value] + } + case FORALL: { + result = l.forall[i|i == _self.value] + } + } + } + } + return result + } +} + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java new file mode 100644 index 000000000..54ad46f3a --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java @@ -0,0 +1,14 @@ +package fr.inria.diverse.event.commons.interpreter.scenario; + +import java.util.List; + +import fr.inria.diverse.event.commons.model.scenario.Event; + +public interface IScenarioManager { + + List> getEvents(); + + boolean isScenarioComplete(); + + void saveScenarioReport(); +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java new file mode 100644 index 000000000..0ec2b3adb --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java @@ -0,0 +1,172 @@ +package fr.inria.diverse.event.commons.interpreter.scenario; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +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.resource.impl.PlatformResourceURIHandlerImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RollbackException; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.impl.EMFCommandTransaction; +import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; + +import fr.inria.diverse.event.commons.interpreter.property.ClassPropertyAspect; +import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.report.Report; +import fr.inria.diverse.event.commons.model.report.ReportFactory; +import fr.inria.diverse.event.commons.model.report.StageReport; +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.Scenario; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.Stage; + +public class ScenarioManager implements IScenarioManager { + + private final Scenario scenario; + private Stage currentStage; + private final Iterator> stageIterator; + private final Resource executedModel; + private final Report report; + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public ScenarioManager(Scenario scenario, Resource executedModel) { + this.scenario = scenario; + this.executedModel = executedModel; + this.stageIterator = ((List>) this.scenario.getStages()).iterator(); + this.currentStage = stageIterator.next(); + this.report = ReportFactory.eINSTANCE.createReport(); + } + + @Override + public List> getEvents() { + if (stageIterator == null) { + return Collections.emptyList(); + } else { + List matches = new ArrayList<>(); + if (currentStage.getProperty() == null) { + matches.add(currentStage.getEvent()); + } else { + matches.addAll(evaluateClassProperty(currentStage.getProperty())); + } + if (currentStage.getEvent() == null) { + if (!matches.isEmpty()) { + final StageReport stageReport = ReportFactory.eINSTANCE.createStageReport(); + report.getStages().add(stageReport); + stageReport.setStage(currentStage); + stageReport.getMatches().addAll(matches); + if (stageIterator.hasNext()) { + currentStage = stageIterator.next(); + } else { + System.out.println("Scenario completed"); + currentStage = null; + } + } + return Collections.emptyList(); + } else { + List> events = matches.stream().map(o -> { + return createEvent(currentStage.getEvent(), o); + }).collect(Collectors.toList()); + if (!events.isEmpty()) { + final StageReport stageReport = ReportFactory.eINSTANCE.createStageReport(); + report.getStages().add(stageReport); + stageReport.setStage(currentStage); + stageReport.getMatches().addAll(matches); + if (stageIterator.hasNext()) { + currentStage = stageIterator.next(); + } else { + System.out.println("Scenario completed"); + currentStage = null; + } + } + return events; + } + } + } + + @Override + public boolean isScenarioComplete() { + return stageIterator != null && currentStage == null; + } + + @Override + public void saveScenarioReport() { + final ResourceSet resourceSet = scenario.eResource().getResourceSet(); + final TransactionalEditingDomain editingDomain = TransactionalEditingDomain.Factory.INSTANCE + .getEditingDomain(resourceSet); + final URI scenarioURI = scenario.eResource().getURI(); + final URI reportURI = scenarioURI.trimFileExtension().appendFileExtension("report"); + final Resource resource = resourceSet.createResource(reportURI); + final RecordingCommand command = new RecordingCommand(editingDomain) { + @Override + public void doExecute() { + resource.getContents().add(report); + } + }; + EMFCommandTransaction transaction = new EMFCommandTransaction(command, (InternalTransactionalEditingDomain) editingDomain, null); + try { + transaction.start(); + command.execute(); + transaction.commit(); + } catch (InterruptedException | RollbackException e) { + e.printStackTrace(); + } + try { + resource.save((new PlatformResourceURIHandlerImpl()).createOutputStream(reportURI, Collections.emptyMap()) , Collections.emptyMap()); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + private Event createEvent(Event originalEvent, EObject eventTarget) { + //TODO handle the case where originalEvent target is already set and different than eventTarget + final Event event = (Event) EcoreUtil.create(originalEvent.eClass()); + if (originalEvent.getTarget() == null) { + event.setTarget(eventTarget); + } else { + event.setTarget(originalEvent.getTarget()); + } + for (EStructuralFeature f : originalEvent.eClass().getEAllStructuralFeatures()) { + if (f != ScenarioPackage.Literals.EVENT__TARGET) { + event.eSet(f, originalEvent.eGet(f)); + } + } + return event; + } + + private List evaluateClassProperty(ClassProperty property) { + final List eventReceivers = new ArrayList<>(); + final Object target = property.getTarget(); + if (target == null) { + Set eClasses = new HashSet<>(); + property.eClass().getEAllGenericSuperTypes().stream() + .forEach(t -> t.getETypeArguments().stream().forEach(a -> eClasses.add(a.getEClassifier()))); + final Iterator it = executedModel.getAllContents(); + while (it.hasNext()) { + EObject o = it.next(); + if (eClasses.contains(o.eClass()) && ClassPropertyAspect.evaluate(property, o)) { + eventReceivers.add(o); + } + } + } else { + final EObject target_cast = (EObject) target; + if (ClassPropertyAspect.evaluate(property, target_cast)) { + eventReceivers.add(target_cast); + } + } + return eventReceivers; + } +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/.classpath b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/.classpath new file mode 100644 index 000000000..22f30643c --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/.project b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/.project new file mode 100644 index 000000000..fd899bf48 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/.project @@ -0,0 +1,28 @@ + + + fr.inria.diverse.event.commons.model.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF new file mode 100644 index 000000000..733ba4c42 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.inria.diverse.event.commons.model.edit;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: fr.inria.diverse.event.commons.model.property.provider, + fr.inria.diverse.event.commons.model.scenario.provider, + fr.inria.diverse.event.commons.model.report.provider +Require-Bundle: org.eclipse.core.runtime, + fr.inria.diverse.event.commons.model;visibility:=reexport, + org.eclipse.emf.edit;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.eclipse.emf.ecore.edit;visibility:=reexport, + fr.inria.diverse.event.commons.model.edit;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/build.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/build.properties new file mode 100644 index 000000000..6e3e902e8 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/build.properties @@ -0,0 +1,10 @@ +# + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..5452ecdc31bb35c5f42b9b3317b50b1a7dc95623 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ z1&Ys^Gw0H>N}%|z>1sf+YZ#L@u~AUhdYV-ytnQX=it7-pV5JmtdHN&U@zlS({|Kb!Pi%buhurrs}= zoar2>F?;z5c9A}8}5D03R{UYJRqLb}R3lrSrZ?x3h&eb~oGCiLm Pr=}^ju_;?sk--`Oi5gUm4mOV*ROub(! zIny~%WA^eB>>_$UdnR97bB~X0VbTuH_I!Sq5m;BNusd<%RGfRa3{e2Hae?OlGqCd|U|GwJ{Gz|h2 zf3h%wSUMmAWG4e_jDkX6N~E0{!_2dXr(D=NslT~zQi-SWXOo_5*^@NI)cd89Go1r9 zW-mX%F4Ctp=hR6zD+V34``#`V0znP4UnG23bh4dkVS=0djh33*xmu@Rrsp%{)HJ0w LHf5_SGFSru1#Do! literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..5452ecdc31bb35c5f42b9b3317b50b1a7dc95623 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ z1&Ys^Gw0H>N}%|z>1sf+YZ#L@u~AUhdYV-ytnQX=it7-pV5JmtdHN&U@zlS({|Kb!Pi%buhurrs}= zoar2>F?;z5c9A}8}5D03R{UYJRqLb}R3lrSrZ?x3h&eb~oGCiLm Pr=}^ju_;?sk--`Oi5gUm4mOV*ROub(! zIny~%WA^eB>>_$UdnR97bB~X0VbTuH_I!Sq5m;BNusd<%RGfRa3{e2Hae?OlGqCd|U|GwJ{Gz|h2 zf3h%wSUMmAWG4e_jDkX6N~E0{!_2dXr(D=NslT~zQi-SWXOo_5*^@NI)cd89Go1r9 zW-mX%F4Ctp=hR6zD+V34``#`V0znP4UnG23bh4dkVS=0djh33*xmu@Rrsp%{)HJ0w LHf5_SGFSru1#Do! literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..3070b3d0cddad64e8b8d234444c2bbfcf931c3aa GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ zMHb&RT@8q~PEuaiCBL*uYF?$-%o5>$f8PVq-_PfP=+E=Tzwb5!O@jc%pDc_ZmJWyj z*~!2fqoB~25^1N#F!Su;DHpa*>Tm9wRN`s;*`()M_9RU)^?s@3Oy@w2*~?F`i}Y#D zId#&_ia|&1zPF2oKv2W%7YQF0oor`XnBXRVqow9{uGZ<7>G=#fHBG6FP1&l74AuZ% CRAD#( literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyBooleanAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..91a611a1d794136bee2bbef8ffc3103edc8e0d75 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?0NB`=jP3{GiMwQ9Qgk~etx|D|NHh0 z4Gjkl9JoLKK9J$y;IM1D8W3%rq`a<6erc1`yh^c|CBpyyz6YYepU(r)pXZBz-)#n( z1_6pcSr|bq9S{MslYuoxL7^`t(oT(G=GntjE^M9D-`qE;#MAh*Nzb+HNt$Bn{Zh%9 z&Vd@Um!Du4>C>8X>ZF?$gO1vLZx;)JpoZBm5JIv@gMCj)DYfrlb&nYlQhND`=ydI zodY#yFF(O9(x)}&)JZoh1|7Bg-YymbK@GECBz#zOvYlyRf}8w}mYUnSTBl#8=QHHg OG^I8+WvePOSOWkgaATJM literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyStringAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..548b805292d966a3e9db820a9e322212ce57579f GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`Oxl@-h6V=*hyVZM=f~Uszi$uZ z0>$sozYh`LHC+vewoX!B*CoHSNoroD*vt~)e}CTt(cjPKf#}ck#lP=115JYf#h)yU zAeIh@0NKgF8l#}lmlA2G#xV2j;VBokPU>&&n^fXy{Mn@ETJ|JOG4+0_=y|i7M*NoTA1J_f1{=5cCOaxm+AQoIW$f8PVq-_PfP=+E=Tzwb5!O@jc%pDc_ZmJWyj z*~!2fqoB~25^1N#F!Su;DHpa*>Tm9wRN`s;*`()M_9RU)^?s@3Oy@w2*~?F`i}Y#D zId#&_ia|&1zPF2oKv2W%7YQF0oor`XnBXRVqow9{uGZ<7>G=#fHBG6FP1&l74AuZ% CRAD#( literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyBooleanAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..91a611a1d794136bee2bbef8ffc3103edc8e0d75 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?0NB`=jP3{GiMwQ9Qgk~etx|D|NHh0 z4Gjkl9JoLKK9J$y;IM1D8W3%rq`a<6erc1`yh^c|CBpyyz6YYepU(r)pXZBz-)#n( z1_6pcSr|bq9S{MslYuoxL7^`t(oT(G=GntjE^M9D-`qE;#MAh*Nzb+HNt$Bn{Zh%9 z&Vd@Um!Du4>C>8X>ZF?$gO1vLZx;)JpoZBm5JIv@gMCj)DYfrlb&nYlQhND`=ydI zodY#yFF(O9(x)}&)JZoh1|7Bg-YymbK@GECBz#zOvYlyRf}8w}mYUnSTBl#8=QHHg OG^I8+WvePOSOWkgaATJM literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyStringAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..548b805292d966a3e9db820a9e322212ce57579f GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`Oxl@-h6V=*hyVZM=f~Uszi$uZ z0>$sozYh`LHC+vewoX!B*CoHSNoroD*vt~)e}CTt(cjPKf#}ck#lP=115JYf#h)yU zAeIh@0NKgF8l#}lmlA2G#xV2j;VBokPU>&&n^fXy{Mn@ETJ|JOG4+0_=y|i7M*NoTA1J_f1{=5cCOaxm+AQoIW+YZ#L@u~AUhdYV-ytnQX=it7-pV5JmtdHN&U@zlS({|Kb!Pi%buhurrs}= zoar2>F?;z5c9A}8}5D03R{UYJRqLb}R3lrSrZ?x3h&eb~oGCiLm Pr=}^ju_;?sk--`OULa!2 literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..6966d766ed8edd01a0f6ba2b0ae788a6a917155a GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ zZMxPJd@R^<*09*F*aJ`Y5Ho-h7=w;5;} z1StMwVFa;sKm^E62G$q_g}#(XJ2i%xXAe)guys;@bKj&APvg%fJ=d})X^N@$OC@JI z2Wre-eu7=3PixMplWtZFI%@a5T`UBG8fL#p_^{|?JJZ4hH~AYaHMeuMPQOggXUM5( NN^NY)R#jxM1^`T#U!4E| literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyBooleanAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..3b01cc94e974c556fd543b0d574808108fffa8f5 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?0NB`=jP3{GiMwQ9Qgk~etx|D|NHh0 z4Gm4#nu3o7TduLxY17#?T@8q~PEuaiCBL*uYF?$-%o5>$f8PVq-_PfP=+E=Tzwb5! zO@jc%pDc_ZmJWyj*~!2fqoB~25^1N#F!Su;DHpa*>Tm9wRN`s;*`()M_9RU)^?s@3 zOy@w2*~?F`i}Y#DId#&_ia|&1zPF2oKv2W%7YQF0oor`XnBXRVqow9{uGZ<7>G=#f OHBG6FP1&l74AuaMM`1_+ literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyIntegerAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..bc083830b7b3ef6cd8c6237595f4aaee8d3e611d GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6eEt3P=$oVS@6WHiRQdmZ{QP+P|M%@1 z8XB6eH3c6Fwp?SW)26d)x*8B|ous_3OMYpS)VxZunI*#i{=NsIzn{+o(Vypwf8T8e zng#)iKUo+-EFBO5vXg-|MnR!3CDKlfVdmMxQ!Z?s)Zg4Usl?Oxvq{gj>`9tp>its5 zna+V4vzMP>7wOZQbLym<6@!l2eQy^FfuM%jFA_d1I@!*&Fu_g!MoZ1@T&>eD)AJc} OYMN3To3d3E8LR;kvtj%I literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyStringAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..eab3c353c4fab174c8006e33a33762c19ee58cf7 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`Oxl@-h6V=*hyVZM=f~Uszi$uZ zHeG89J{D}b#!{zEXV-K!Alf=fd0m(M(k7{Sm0~kXg#Z104@7@Ip9i8p&lmr`+YB@f z0u+C;FoIY*AOd7318aB0{{e>Up@c; literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyBooleanAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..88d8844103d0fb748775ce56a9fbe63061b24999 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?0NB`=jP3{GiMwQ9Qgk~etx|D|NHh0 z4Gq7)etmQF=>7TgFI86Vnyv;!TPG>6>ylsEBsH&6Y-Wk@zrXK+=&&n^fXy{Mn@ETJ|JOG4+0_ z=y|i7M*NoTA1J_f1{=5cCOaxm+AQo PIWC>8X>ZF?$gO1vLZx;)JpoZBm5kc+ literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..e4b530eca173b1070d5d876a0154bc370d8896b4 GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgte-Qir{QE#D2L}hm zpDc_F44e!)Ae|sH7+CZSPI|81Yw`NaHx>Seg|6F8S#PBzcr94?)kg2*G_|W{Seg|6F8S#PBzcr94?)kg2*G_|W{~uRaQAn7P!5RR`@-PYj literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyBooleanAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..33854e98c25a13543eb9477dc67b0baf87fc81aa GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgt|Nnblyy&@kGwsY7 zhXV%`f3h$#FmN*HfOLY)U|`WRIO(~1uf^*x-&FV?7P@XXWxbV>;I&}kR~x;L)6}k- WmG`XFR{v WEALsU$*;SdvD59yL?K~D25SIuW->+q literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyStringAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..a26660ec28fda4a4216562537c32047bab42b782 GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgte-Qgj+8LmfgM)+O zPZmZ722KVYkWP>p3@myECp}m1wRrvIn+pHKLf7r4thZ7UycR6{YNPjYn%Y&f@}8BN S{JP5-JKc^<6cT1+um%98?=Oe| literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Report.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Report.gif new file mode 100644 index 0000000000000000000000000000000000000000..33854e98c25a13543eb9477dc67b0baf87fc81aa GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgt|Nnblyy&@kGwsY7 zhXV%`f3h$#FmN*HfOLY)U|`WRIO(~1uf^*x-&FV?7P@XXWxbV>;I&}kR~x;L)6}k- WmG`XFp3@myECp}m1wRrvIn+pHKLf7r4thZ7UycR6{YNPjYn%Y&f W@}8BN{JP5-JKc^<6cT1+um%9tY%ntb literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/StageReport.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/StageReport.gif new file mode 100644 index 0000000000000000000000000000000000000000..904159880b359f157463f3cb9230da602e5b3d3a GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgte-L}loH>=tE;%?j zDE?$&WMJTA&;jWLnZdxKXK>PU^qmH literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties new file mode 100644 index 000000000..cd042ff72 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties @@ -0,0 +1,73 @@ +# + +pluginName = Property Edit Support +providerName = www.example.org + +_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_ClassProperty_type = Class Property +_UI_BinaryProperty_type = Binary Property +_UI_ManyReferenceProperty_type = Many Reference Property +_UI_SingleReferenceProperty_type = Single Reference Property +_UI_ManyBooleanAttributeProperty_type = Many Boolean Attribute Property +_UI_ManyIntegerAttributeProperty_type = Many Integer Attribute Property +_UI_ManyStringAttributeProperty_type = Many String Attribute Property +_UI_BooleanAttributeProperty_type = Boolean Attribute Property +_UI_IntegerAttributeProperty_type = Integer Attribute Property +_UI_StringAttributeProperty_type = String Attribute Property +_UI_Unknown_type = Object + +_UI_Unknown_datatype= Value + +_UI_ClassProperty_target_feature = Target +_UI_ClassProperty_feature_feature = Feature +_UI_BinaryProperty_operator_feature = Operator +_UI_BinaryProperty_left_feature = Left +_UI_BinaryProperty_right_feature = Right +_UI_ManyReferenceProperty_property_feature = Property +_UI_ManyReferenceProperty_quantifier_feature = Quantifier +_UI_SingleReferenceProperty_property_feature = Property +_UI_ManyBooleanAttributeProperty_quantifier_feature = Quantifier +_UI_ManyBooleanAttributeProperty_value_feature = Value +_UI_ManyBooleanAttributeProperty_operator_feature = Operator +_UI_ManyIntegerAttributeProperty_quantifier_feature = Quantifier +_UI_ManyIntegerAttributeProperty_value_feature = Value +_UI_ManyIntegerAttributeProperty_operator_feature = Operator +_UI_ManyStringAttributeProperty_quantifier_feature = Quantifier +_UI_ManyStringAttributeProperty_value_feature = Value +_UI_ManyStringAttributeProperty_operator_feature = Operator +_UI_BooleanAttributeProperty_value_feature = Value +_UI_BooleanAttributeProperty_operator_feature = Operator +_UI_IntegerAttributeProperty_value_feature = Value +_UI_IntegerAttributeProperty_operator_feature = Operator +_UI_StringAttributeProperty_value_feature = Value +_UI_StringAttributeProperty_operator_feature = Operator +_UI_Unknown_feature = Unspecified + +_UI_Operator_EQUAL_literal = EQUAL +_UI_BooleanOperator_AND_literal = AND +_UI_BooleanOperator_OR_literal = OR +_UI_BooleanOperator_IMPLIES_literal = IMPLIES +_UI_Quantifier_EXISTS_literal = EXISTS +_UI_Quantifier_FORALL_literal = FORALL +_UI_Scenario_type = Scenario +_UI_Event_type = Event +_UI_Stage_type = Stage +_UI_Scenario_stages_feature = Stages +_UI_Event_target_feature = Target +_UI_Stage_property_feature = Property +_UI_Stage_event_feature = Event +_UI_Report_type = Report +_UI_StageReport_type = Stage Report +_UI_Report_stages_feature = Stages +_UI_StageReport_stage_feature = Stage +_UI_StageReport_matches_feature = Matches +_UI_ContainerReferenceProperty_type = Container Reference Property +_UI_ContainerReferenceProperty_property_feature = Property diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml new file mode 100644 index 000000000..c69b5dc22 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BinaryPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BinaryPropertyItemProvider.java new file mode 100644 index 000000000..e50b94da3 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BinaryPropertyItemProvider.java @@ -0,0 +1,224 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.BinaryProperty; +import fr.inria.diverse.event.commons.model.property.BooleanOperator; +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.BinaryProperty} object. + * + * + * @generated + */ +public class BinaryPropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public BinaryPropertyItemProvider(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); + + addOperatorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Operator feature. + * + * + * @generated + */ + protected void addOperatorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_BinaryProperty_operator_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_BinaryProperty_operator_feature", "_UI_BinaryProperty_type"), + PropertyPackage.Literals.BINARY_PROPERTY__OPERATOR, + 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(PropertyPackage.Literals.BINARY_PROPERTY__LEFT); + childrenFeatures.add(PropertyPackage.Literals.BINARY_PROPERTY__RIGHT); + } + 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) { + BooleanOperator labelValue = ((BinaryProperty)object).getOperator(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_BinaryProperty_type") : + getString("_UI_BinaryProperty_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(BinaryProperty.class)) { + case PropertyPackage.BINARY_PROPERTY__OPERATOR: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case PropertyPackage.BINARY_PROPERTY__LEFT: + case PropertyPackage.BINARY_PROPERTY__RIGHT: + 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 + (PropertyPackage.Literals.BINARY_PROPERTY__LEFT, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.BINARY_PROPERTY__LEFT, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.BINARY_PROPERTY__LEFT, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.BINARY_PROPERTY__LEFT, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.BINARY_PROPERTY__RIGHT, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.BINARY_PROPERTY__RIGHT, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.BINARY_PROPERTY__RIGHT, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.BINARY_PROPERTY__RIGHT, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + + /** + * 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 == PropertyPackage.Literals.BINARY_PROPERTY__LEFT || + childFeature == PropertyPackage.Literals.BINARY_PROPERTY__RIGHT; + + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BooleanAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BooleanAttributePropertyItemProvider.java new file mode 100644 index 000000000..873eefe10 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BooleanAttributePropertyItemProvider.java @@ -0,0 +1,143 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty} object. + * + * + * @generated + */ +public class BooleanAttributePropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public BooleanAttributePropertyItemProvider(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); + + addValuePropertyDescriptor(object); + addOperatorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Value feature. + * + * + * @generated + */ + protected void addValuePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_BooleanAttributeProperty_value_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_BooleanAttributeProperty_value_feature", "_UI_BooleanAttributeProperty_type"), + PropertyPackage.Literals.BOOLEAN_ATTRIBUTE_PROPERTY__VALUE, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Operator feature. + * + * + * @generated + */ + protected void addOperatorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_BooleanAttributeProperty_operator_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_BooleanAttributeProperty_operator_feature", "_UI_BooleanAttributeProperty_type"), + PropertyPackage.Literals.BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR, + 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) { + BooleanAttributeProperty booleanAttributeProperty = (BooleanAttributeProperty)object; + return getString("_UI_BooleanAttributeProperty_type") + " " + booleanAttributeProperty.isValue(); + } + + + /** + * 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(BooleanAttributeProperty.class)) { + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ClassPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ClassPropertyItemProvider.java new file mode 100644 index 000000000..a77d5c646 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ClassPropertyItemProvider.java @@ -0,0 +1,158 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.ClassProperty} object. + * + * + * @generated + */ +public class ClassPropertyItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ClassPropertyItemProvider(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); + + addTargetPropertyDescriptor(object); + addFeaturePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ClassProperty_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ClassProperty_target_feature", "_UI_ClassProperty_type"), + PropertyPackage.Literals.CLASS_PROPERTY__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Feature feature. + * + * + * @generated + */ + protected void addFeaturePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ClassProperty_feature_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ClassProperty_feature_feature", "_UI_ClassProperty_type"), + PropertyPackage.Literals.CLASS_PROPERTY__FEATURE, + false, + false, + false, + null, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_ClassProperty_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 PropertyEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ContainerReferencePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ContainerReferencePropertyItemProvider.java new file mode 100644 index 000000000..a763b4dd4 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ContainerReferencePropertyItemProvider.java @@ -0,0 +1,157 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty; +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty} object. + * + * + * @generated + */ +public class ContainerReferencePropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ContainerReferencePropertyItemProvider(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(PropertyPackage.Literals.CONTAINER_REFERENCE_PROPERTY__PROPERTY); + } + 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 ContainerReferenceProperty.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ContainerReferenceProperty")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_ContainerReferenceProperty_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); + + switch (notification.getFeatureID(ContainerReferenceProperty.class)) { + case PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY: + 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 + (PropertyPackage.Literals.CONTAINER_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.CONTAINER_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.CONTAINER_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.CONTAINER_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java new file mode 100644 index 000000000..f06441648 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java @@ -0,0 +1,154 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty} object. + * + * + * @generated + */ +public class IntegerAttributePropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public IntegerAttributePropertyItemProvider(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); + + addValuePropertyDescriptor(object); + addOperatorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Value feature. + * + * + * @generated + */ + protected void addValuePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_IntegerAttributeProperty_value_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_IntegerAttributeProperty_value_feature", "_UI_IntegerAttributeProperty_type"), + PropertyPackage.Literals.INTEGER_ATTRIBUTE_PROPERTY__VALUE, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Operator feature. + * + * + * @generated + */ + protected void addOperatorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_IntegerAttributeProperty_operator_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_IntegerAttributeProperty_operator_feature", "_UI_IntegerAttributeProperty_type"), + PropertyPackage.Literals.INTEGER_ATTRIBUTE_PROPERTY__OPERATOR, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns IntegerAttributeProperty.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/IntegerAttributeProperty")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + IntegerAttributeProperty integerAttributeProperty = (IntegerAttributeProperty)object; + return getString("_UI_IntegerAttributeProperty_type") + " " + integerAttributeProperty.getValue(); + } + + + /** + * 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(IntegerAttributeProperty.class)) { + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__VALUE: + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyBooleanAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyBooleanAttributePropertyItemProvider.java new file mode 100644 index 000000000..24ecbbaab --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyBooleanAttributePropertyItemProvider.java @@ -0,0 +1,182 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.Quantifier; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty} object. + * + * + * @generated + */ +public class ManyBooleanAttributePropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ManyBooleanAttributePropertyItemProvider(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); + + addQuantifierPropertyDescriptor(object); + addValuePropertyDescriptor(object); + addOperatorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Quantifier feature. + * + * + * @generated + */ + protected void addQuantifierPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ManyBooleanAttributeProperty_quantifier_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyBooleanAttributeProperty_quantifier_feature", "_UI_ManyBooleanAttributeProperty_type"), + PropertyPackage.Literals.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + 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_ManyBooleanAttributeProperty_value_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyBooleanAttributeProperty_value_feature", "_UI_ManyBooleanAttributeProperty_type"), + PropertyPackage.Literals.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Operator feature. + * + * + * @generated + */ + protected void addOperatorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ManyBooleanAttributeProperty_operator_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyBooleanAttributeProperty_operator_feature", "_UI_ManyBooleanAttributeProperty_type"), + PropertyPackage.Literals.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns ManyBooleanAttributeProperty.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ManyBooleanAttributeProperty")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + Quantifier labelValue = ((ManyBooleanAttributeProperty)object).getQuantifier(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_ManyBooleanAttributeProperty_type") : + getString("_UI_ManyBooleanAttributeProperty_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(ManyBooleanAttributeProperty.class)) { + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER: + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyIntegerAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyIntegerAttributePropertyItemProvider.java new file mode 100644 index 000000000..429a3c80a --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyIntegerAttributePropertyItemProvider.java @@ -0,0 +1,182 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.Quantifier; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty} object. + * + * + * @generated + */ +public class ManyIntegerAttributePropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ManyIntegerAttributePropertyItemProvider(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); + + addQuantifierPropertyDescriptor(object); + addValuePropertyDescriptor(object); + addOperatorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Quantifier feature. + * + * + * @generated + */ + protected void addQuantifierPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ManyIntegerAttributeProperty_quantifier_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyIntegerAttributeProperty_quantifier_feature", "_UI_ManyIntegerAttributeProperty_type"), + PropertyPackage.Literals.MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + 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_ManyIntegerAttributeProperty_value_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyIntegerAttributeProperty_value_feature", "_UI_ManyIntegerAttributeProperty_type"), + PropertyPackage.Literals.MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Operator feature. + * + * + * @generated + */ + protected void addOperatorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ManyIntegerAttributeProperty_operator_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyIntegerAttributeProperty_operator_feature", "_UI_ManyIntegerAttributeProperty_type"), + PropertyPackage.Literals.MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns ManyIntegerAttributeProperty.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ManyIntegerAttributeProperty")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + Quantifier labelValue = ((ManyIntegerAttributeProperty)object).getQuantifier(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_ManyIntegerAttributeProperty_type") : + getString("_UI_ManyIntegerAttributeProperty_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(ManyIntegerAttributeProperty.class)) { + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER: + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE: + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyReferencePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyReferencePropertyItemProvider.java new file mode 100644 index 000000000..9b52ec1f7 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyReferencePropertyItemProvider.java @@ -0,0 +1,179 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.ManyReferenceProperty; +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.Quantifier; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.ManyReferenceProperty} object. + * + * + * @generated + */ +public class ManyReferencePropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ManyReferencePropertyItemProvider(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); + + addQuantifierPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Quantifier feature. + * + * + * @generated + */ + protected void addQuantifierPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ManyReferenceProperty_quantifier_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyReferenceProperty_quantifier_feature", "_UI_ManyReferenceProperty_type"), + PropertyPackage.Literals.MANY_REFERENCE_PROPERTY__QUANTIFIER, + 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(PropertyPackage.Literals.MANY_REFERENCE_PROPERTY__PROPERTY); + } + 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) { + Quantifier labelValue = ((ManyReferenceProperty)object).getQuantifier(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_ManyReferenceProperty_type") : + getString("_UI_ManyReferenceProperty_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(ManyReferenceProperty.class)) { + case PropertyPackage.MANY_REFERENCE_PROPERTY__QUANTIFIER: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY: + 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 + (PropertyPackage.Literals.MANY_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.MANY_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.MANY_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.MANY_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyStringAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyStringAttributePropertyItemProvider.java new file mode 100644 index 000000000..011a0a908 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyStringAttributePropertyItemProvider.java @@ -0,0 +1,182 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.Quantifier; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty} object. + * + * + * @generated + */ +public class ManyStringAttributePropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ManyStringAttributePropertyItemProvider(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); + + addQuantifierPropertyDescriptor(object); + addValuePropertyDescriptor(object); + addOperatorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Quantifier feature. + * + * + * @generated + */ + protected void addQuantifierPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ManyStringAttributeProperty_quantifier_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyStringAttributeProperty_quantifier_feature", "_UI_ManyStringAttributeProperty_type"), + PropertyPackage.Literals.MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + 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_ManyStringAttributeProperty_value_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyStringAttributeProperty_value_feature", "_UI_ManyStringAttributeProperty_type"), + PropertyPackage.Literals.MANY_STRING_ATTRIBUTE_PROPERTY__VALUE, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Operator feature. + * + * + * @generated + */ + protected void addOperatorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ManyStringAttributeProperty_operator_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ManyStringAttributeProperty_operator_feature", "_UI_ManyStringAttributeProperty_type"), + PropertyPackage.Literals.MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns ManyStringAttributeProperty.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ManyStringAttributeProperty")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + Quantifier labelValue = ((ManyStringAttributeProperty)object).getQuantifier(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_ManyStringAttributeProperty_type") : + getString("_UI_ManyStringAttributeProperty_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(ManyStringAttributeProperty.class)) { + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER: + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__VALUE: + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR: + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyEditPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyEditPlugin.java new file mode 100644 index 000000000..632e9b436 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyEditPlugin.java @@ -0,0 +1,92 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; + +/** + * This is the central singleton for the Property edit plugin. + * + * + * @generated + */ +public final class PropertyEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final PropertyEditPlugin INSTANCE = new PropertyEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public PropertyEditPlugin() { + super + (new ResourceLocator [] { + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java new file mode 100644 index 000000000..3f234703d --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java @@ -0,0 +1,271 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + +import fr.inria.diverse.event.commons.model.property.util.PropertyAdapterFactory; + +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; + +/** + * 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 PropertyItemProviderAdapterFactory extends PropertyAdapterFactory 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 PropertyItemProviderAdapterFactory() { + 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 fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty} instances. + * + * + * @generated + */ + protected ContainerReferencePropertyItemProvider containerReferencePropertyItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty}. + * + * + * @generated + */ + @Override + public Adapter createContainerReferencePropertyAdapter() { + if (containerReferencePropertyItemProvider == null) { + containerReferencePropertyItemProvider = new ContainerReferencePropertyItemProvider(this); + } + + return containerReferencePropertyItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty} instances. + * + * + * @generated + */ + protected ManyBooleanAttributePropertyItemProvider manyBooleanAttributePropertyItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty}. + * + * + * @generated + */ + @Override + public Adapter createManyBooleanAttributePropertyAdapter() { + if (manyBooleanAttributePropertyItemProvider == null) { + manyBooleanAttributePropertyItemProvider = new ManyBooleanAttributePropertyItemProvider(this); + } + + return manyBooleanAttributePropertyItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty} instances. + * + * + * @generated + */ + protected ManyIntegerAttributePropertyItemProvider manyIntegerAttributePropertyItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty}. + * + * + * @generated + */ + @Override + public Adapter createManyIntegerAttributePropertyAdapter() { + if (manyIntegerAttributePropertyItemProvider == null) { + manyIntegerAttributePropertyItemProvider = new ManyIntegerAttributePropertyItemProvider(this); + } + + return manyIntegerAttributePropertyItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty} instances. + * + * + * @generated + */ + protected ManyStringAttributePropertyItemProvider manyStringAttributePropertyItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty}. + * + * + * @generated + */ + @Override + public Adapter createManyStringAttributePropertyAdapter() { + if (manyStringAttributePropertyItemProvider == null) { + manyStringAttributePropertyItemProvider = new ManyStringAttributePropertyItemProvider(this); + } + + return manyStringAttributePropertyItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * @generated + */ + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * @generated + */ + 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 + */ + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * @generated + */ + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * @generated + */ + 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 + */ + public void dispose() { + if (containerReferencePropertyItemProvider != null) containerReferencePropertyItemProvider.dispose(); + if (manyBooleanAttributePropertyItemProvider != null) manyBooleanAttributePropertyItemProvider.dispose(); + if (manyIntegerAttributePropertyItemProvider != null) manyIntegerAttributePropertyItemProvider.dispose(); + if (manyStringAttributePropertyItemProvider != null) manyStringAttributePropertyItemProvider.dispose(); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/SingleReferencePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/SingleReferencePropertyItemProvider.java new file mode 100644 index 000000000..1d873604e --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/SingleReferencePropertyItemProvider.java @@ -0,0 +1,146 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.SingleReferenceProperty} object. + * + * + * @generated + */ +public class SingleReferencePropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public SingleReferencePropertyItemProvider(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(PropertyPackage.Literals.SINGLE_REFERENCE_PROPERTY__PROPERTY); + } + 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) { + return getString("_UI_SingleReferenceProperty_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); + + switch (notification.getFeatureID(SingleReferenceProperty.class)) { + case PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY: + 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 + (PropertyPackage.Literals.SINGLE_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.SINGLE_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.SINGLE_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.SINGLE_REFERENCE_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StringAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StringAttributePropertyItemProvider.java new file mode 100644 index 000000000..dccda821d --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StringAttributePropertyItemProvider.java @@ -0,0 +1,145 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.StringAttributeProperty; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty} object. + * + * + * @generated + */ +public class StringAttributePropertyItemProvider extends ClassPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public StringAttributePropertyItemProvider(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); + + addValuePropertyDescriptor(object); + addOperatorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Value feature. + * + * + * @generated + */ + protected void addValuePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_StringAttributeProperty_value_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_StringAttributeProperty_value_feature", "_UI_StringAttributeProperty_type"), + PropertyPackage.Literals.STRING_ATTRIBUTE_PROPERTY__VALUE, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Operator feature. + * + * + * @generated + */ + protected void addOperatorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_StringAttributeProperty_operator_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_StringAttributeProperty_operator_feature", "_UI_StringAttributeProperty_type"), + PropertyPackage.Literals.STRING_ATTRIBUTE_PROPERTY__OPERATOR, + 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 = ((StringAttributeProperty)object).getValue(); + return label == null || label.length() == 0 ? + getString("_UI_StringAttributeProperty_type") : + getString("_UI_StringAttributeProperty_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(StringAttributeProperty.class)) { + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__VALUE: + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__OPERATOR: + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportEditPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportEditPlugin.java new file mode 100644 index 000000000..4e1f70ebe --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportEditPlugin.java @@ -0,0 +1,98 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.provider; + +import fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin; + +import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioEditPlugin; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; + +/** + * This is the central singleton for the Report edit plugin. + * + * + * @generated + */ +public final class ReportEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final ReportEditPlugin INSTANCE = new ReportEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public ReportEditPlugin() { + super + (new ResourceLocator [] { + EcoreEditPlugin.INSTANCE, + PropertyEditPlugin.INSTANCE, + ScenarioEditPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java new file mode 100644 index 000000000..497b825d5 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java @@ -0,0 +1,168 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.provider; + + +import fr.inria.diverse.event.commons.model.report.Report; +import fr.inria.diverse.event.commons.model.report.ReportFactory; +import fr.inria.diverse.event.commons.model.report.ReportPackage; + +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.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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.Report} object. + * + * + * @generated + */ +public class ReportItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ReportItemProvider(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(ReportPackage.Literals.REPORT__STAGES); + } + 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 Report.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Report")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_Report_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); + + switch (notification.getFeatureID(Report.class)) { + case ReportPackage.REPORT__STAGES: + 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 + (ReportPackage.Literals.REPORT__STAGES, + ReportFactory.eINSTANCE.createStageReport())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ReportEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java new file mode 100644 index 000000000..5f43a2e20 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java @@ -0,0 +1,223 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.provider; + +import fr.inria.diverse.event.commons.model.report.util.ReportAdapterFactory; + +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; + +/** + * 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 ReportItemProviderAdapterFactory extends ReportAdapterFactory 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 ReportItemProviderAdapterFactory() { + 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 fr.inria.diverse.event.commons.model.report.Report} instances. + * + * + * @generated + */ + protected ReportItemProvider reportItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.Report}. + * + * + * @generated + */ + @Override + public Adapter createReportAdapter() { + if (reportItemProvider == null) { + reportItemProvider = new ReportItemProvider(this); + } + + return reportItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.StageReport} instances. + * + * + * @generated + */ + protected StageReportItemProvider stageReportItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.StageReport}. + * + * + * @generated + */ + @Override + public Adapter createStageReportAdapter() { + if (stageReportItemProvider == null) { + stageReportItemProvider = new StageReportItemProvider(this); + } + + return stageReportItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * @generated + */ + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * @generated + */ + 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 + */ + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * @generated + */ + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * @generated + */ + 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 + */ + public void dispose() { + if (reportItemProvider != null) reportItemProvider.dispose(); + if (stageReportItemProvider != null) stageReportItemProvider.dispose(); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java new file mode 100644 index 000000000..4a6334fb6 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java @@ -0,0 +1,169 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.provider; + + +import fr.inria.diverse.event.commons.model.report.ReportPackage; + +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.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.StageReport} object. + * + * + * @generated + */ +public class StageReportItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public StageReportItemProvider(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); + + addStagePropertyDescriptor(object); + addMatchesPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Stage feature. + * + * + * @generated + */ + protected void addStagePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_StageReport_stage_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_StageReport_stage_feature", "_UI_StageReport_type"), + ReportPackage.Literals.STAGE_REPORT__STAGE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Matches feature. + * + * + * @generated + */ + protected void addMatchesPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_StageReport_matches_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_StageReport_matches_feature", "_UI_StageReport_type"), + ReportPackage.Literals.STAGE_REPORT__MATCHES, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns StageReport.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/StageReport")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_StageReport_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 ReportEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventItemProvider.java new file mode 100644 index 000000000..c9ba639e5 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventItemProvider.java @@ -0,0 +1,146 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Event} object. + * + * + * @generated + */ +public class EventItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public EventItemProvider(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); + + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Event_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Event_target_feature", "_UI_Event_type"), + ScenarioPackage.Literals.EVENT__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Event.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Event")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_Event_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 ScenarioEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioEditPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioEditPlugin.java new file mode 100644 index 000000000..3c04f7379 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioEditPlugin.java @@ -0,0 +1,95 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + +import fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; + +/** + * This is the central singleton for the Scenario edit plugin. + * + * + * @generated + */ +public final class ScenarioEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final ScenarioEditPlugin INSTANCE = new ScenarioEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public ScenarioEditPlugin() { + super + (new ResourceLocator [] { + EcoreEditPlugin.INSTANCE, + PropertyEditPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java new file mode 100644 index 000000000..fd75560be --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java @@ -0,0 +1,162 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.scenario.Scenario; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Scenario} object. + * + * + * @generated + */ +public class ScenarioItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ScenarioItemProvider(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(ScenarioPackage.Literals.SCENARIO__STAGES); + } + 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 Scenario.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Scenario")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_Scenario_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); + + switch (notification.getFeatureID(Scenario.class)) { + case ScenarioPackage.SCENARIO__STAGES: + 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); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ScenarioEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProviderAdapterFactory.java new file mode 100644 index 000000000..f259d88cc --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProviderAdapterFactory.java @@ -0,0 +1,175 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + +import fr.inria.diverse.event.commons.model.scenario.util.ScenarioAdapterFactory; + +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; + +/** + * 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 ScenarioItemProviderAdapterFactory extends ScenarioAdapterFactory 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 ScenarioItemProviderAdapterFactory() { + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * @generated + */ + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * @generated + */ + 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 + */ + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * @generated + */ + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * @generated + */ + 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 + */ + public void dispose() { + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java new file mode 100644 index 000000000..71cdd5d05 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java @@ -0,0 +1,170 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyFactory; + +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.Stage; + +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.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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Stage} object. + * + * + * @generated + */ +public class StageItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public StageItemProvider(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(ScenarioPackage.Literals.STAGE__PROPERTY); + childrenFeatures.add(ScenarioPackage.Literals.STAGE__EVENT); + } + 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) { + return getString("_UI_Stage_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); + + switch (notification.getFeatureID(Stage.class)) { + case ScenarioPackage.STAGE__PROPERTY: + case ScenarioPackage.STAGE__EVENT: + 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 + (ScenarioPackage.Literals.STAGE__PROPERTY, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.STAGE__PROPERTY, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.STAGE__PROPERTY, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ScenarioEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/.classpath b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/.classpath new file mode 100644 index 000000000..22f30643c --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/.project b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/.project new file mode 100644 index 000000000..181be03c9 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/.project @@ -0,0 +1,28 @@ + + + fr.inria.diverse.event.commons.model.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF new file mode 100644 index 000000000..3c89248c9 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.inria.diverse.event.commons.model.editor;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: fr.inria.diverse.event.commons.model.property.presentation.PropertyEditorPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: fr.inria.diverse.event.commons.model.property.presentation, + fr.inria.diverse.event.commons.model.scenario.presentation, + fr.inria.diverse.event.commons.model.report.presentation +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources;visibility:=reexport, + fr.inria.diverse.event.commons.model.edit;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.eclipse.emf.edit.ui;visibility:=reexport, + org.eclipse.ui.ide;visibility:=reexport, + org.eclipse.emf.ecore.edit;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/build.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/build.properties new file mode 100644 index 000000000..5fb07711c --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/build.properties @@ -0,0 +1,10 @@ +# + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/PropertyModelFile.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/PropertyModelFile.gif new file mode 100644 index 0000000000000000000000000000000000000000..dd4fa0a2b6bc3df42fccecbce6c987fd97ba6c41 GIT binary patch literal 346 zcmZ?wbhEHb6krfwxXQrL(9jScAHRS9{{Q#qA2@IT$YuD?z`*by$o~Hy%=-Vosp(p9 z@G(ovH99(NTPD~7(T0AzH9Zc?yPXzwIL~c$o!;cuT<%*}>Q`MHaAi~Gt-Uo5PW1o$ z_2>J~-(P?H{`B?thp)fie){$5!_WIKf82Tg9cTfyfZ|UUMg|5p1|5)rAU`p%l{+*S zc<2Zzo=~}@(NZz*0&k1v&xrLhD+`%kRaxKkoG7H#F854eX@uZTPX4Co5X~sJAMOtu ztqU6~46Sy~F2T=}bbS*G>#clAu|XPM|Cp{m-}x=6xRQf*Zg|0*>} WSE)@>1uUDTe4Lp0=esyESOWm0@^?-E literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif new file mode 100644 index 0000000000000000000000000000000000000000..26ea9421d720270f52a6dc2d5b8a0726aa2351de GIT binary patch literal 346 zcmZ?wbhEHb6krfwxXQrL(9jScAHRS9{{Q#qA2@IT$YuD?z`*by$o~Hy%=-U-&x;p5 zH*cn$Ipc8Pz?KQNK(wLXZcUHF@@}U^9nN!GU8gs>HJAI=mHJf|2VB{dd24UYgA@Hf zfBpIX^Y_;uzdwEb{o(8Hx1WB!`tbAq%O7{1e+ODXEui?5g^_`QjX?)wAjnS)Y~>Ek z1s*y=iYHVqX|z<#yTIF``7>g@%*sNhS5?+GJtqojwaYydSQ;U?las$GIz%(d?T7or zM)}AtaTOI_))w9-aaX2-R+g4RCRhF{UY2S7{9Qd$`&lNsNT{l|wJwryl~h|*#lK2T W(p74cQ~}FoDIX^${`oGB4AuZ%t9q0G literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..e52cb90c78961214b94e27b1cfd0adfdb515d78b GIT binary patch literal 2462 zcmd6m`8OMg8ivzyXM`x-QPZJfTAHHK&QR59ORX_2)hb#`gR#}FY8f{OI*s7u=5r#%1Dp4Xu1dXMO(HS%DUvb~_ocG7?Jl{FrXKQa`X71|Gor9Pt%Qawp=IJ3C}KB? z*p*Y>lUvc7ThW6d_hHF>7}5(2`308zqOj&Au704riB;A(RNgd1YUNb7bL;4%l&&#q z_gHi9>$aB@T|vKP`XwxU{h>gYM!Bf(S%`LUGw(fq$zYGp_bTb+%@z@^b z(7V|g?%*GztnqO!e@Za_zgzpiE6ASF-Y)=@b^!`X+ICIlFVmC`8{Q8zIkw*gq~|~| z8`rJNQa1<|o;hEH$kZ^7(zeI?Kr(f#0wC;`dHVvx^BsgbxgP*+0H>1Kn*oqArKshV zDc%CR{5t$lY0y^SEf;$$qjOUi050TPu_!|4dd(!>t-_`dWl}uV8px}6+R2}DYjk4< zixSk`paJZSWzjG#oa)&baV}{Gy2h-DJ}eIA(;~@!Xj^?!yP^yD0S%y+lxT`Tpfl7? z+tfN12Jt8^G}I9wHpGq;$R?h{y9bP@S|t7j(mE?1kIk=hp*)KX@t{0Fd;D_Z*etgb z7L~khzI6{rzH|C)@3W69@0)*R?rNdWMg+VpjorEIZb=m|EL4_Hg~#yn%6yo!oZSZum(P_mr|v$-aPsFyo_7W@BSCFO)@subAN# zMx5+)Atd2r&lqH^faoiKWt(TD-!e!D1)22$AYYx&*h7s19>a{ZA1}>i%Jntu6PH8{i!&kPS9bPLXUPnsMI^d#(|hft&~;+sU6y(>QsYz)YGC% z03!wj!-ayB^s>nXM!VZbs&QfUQX){(R2iHv{b{=VfTHKpS!|z6J!J3zV&wryqji{E z&|%Bj*R~O~+MaxptP&km&kj(i>^1luA{mXxLgI8cLmPB32B zA@qHPYt32 zw^H7<{>j|9Mrk$G7#-@7bbc@-m>YTfXExMn@^hb?Cu%DGJ(0oBF0_fL)xpx|dJYUIhJcVVXP+xOew07H5{a*~oqNVO01 zDYU6j=&l@_(A+@bLBh`x+Pkf$|BOYe4K%dPB=UrG^rM5WAk*82y;|7U^k!m3-=6CU z;Ko}WU`&xbxrq0nL)KHmU^Vd?uNmoQ$X~SfrB0NS2ls`NcM@RD&AijBhyzA zCxR<)PMCrGtWNB*##+BkEV&J)_d0svd@MiU+biqWCQQi5J{;S_;16Slq99M<-h?(hMzt+4?*Cf$RiWhp4KcGxJWh3Ok+`LJPk<#&P78$*8| z12{LcGfqGyH(_-gFCw-OEhI4?;vD-9a>7a4N{8dv0Po5}M@A6U;2gOU_`dA!s_9eX zCGtsUgVv1staKBNzU%-K5@8XxXg(6pfo%X0C@a>Fk>(DD7j<&%9jc%6al5}nSGE#( zuzm}MO&c;ay2xAVyamEt{ivv;A#ts-#_2kxDCdN=Td<5n1-DYZ<4B3IPt?>Rm0iTgV|(ibZ(yAJ>s8nmI+6}$FTRV-$~bc?T2b9*>7HN zua851=i=0$5^~RV$2D&s`J!eIAj9WdM?t^Vr>2af-&}PgAzc8fjeh!pm+=}|`#^wW zh3sLt4ykx#K_8gl3xitY6$eW`6;$OQiNc~QQ_XEv+6IQB0zEy)v~+9W@s#g&jX1rz z2-D&R8;44)N!XEBl>a6a244?&dw2gU<U|6i|?ZEna1H)YM?jiX8bms`2zgZXc zQ#5N`U&?s=%;Sx6=0%47aYWj7btu!mW=`3^lcFyR@s$?&EpISZDlmV?B+^^{F6e$Y Xv8I*g=`E`r2;R<_T|A(!4zTzK8q~zw literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif new file mode 100644 index 0000000000000000000000000000000000000000..023a6d4bd7b72c780d173567f7e3ce552951c45c GIT binary patch literal 2462 zcmd6m`8OMg8ivzyXM`x-QPZJfTAHHK&QR5AsWql$w2Ic!kg?USY8f{w=)@9er5!BYj=!_Znuek4d&imtcp6{IRvvaUDGxu`>TnBsx>}7X% zcXj>C>iTB}dwftJ85GP)Wg9E&Uo1Q`ExocVy)wHN7qccO5q!QCi)HPXdjpQM@yoS^ z<80wr`+z*>pu(FW#WzEWTpr?GAL8A@pSed8-6IK}F(l8JlKXLGKJgX4dz8Zy$%y32 zpp@#+)Y|a$=Mm|3(Z5q4Wi=#VntsEz{Dy5#Euy1}=;)Hp%#toFnT6ZqML|_BzP1lv z%O=+Mmo{+9_86cv^XeGGw9XMadz{fX(aRTcMrQ<5i(^v@<6@cc-O{vlRU}!Smv2gC z>zD6kUAdoac`x&-cg|Js>}$Rln+N}Hfwc?Bv-QV1{+bU9DsTzIyN2Q2BA&TN5#6H* z9x)`3J^51KgbJVda^HkNIx;ywJRucKExZxS#M0F%$@0wnhiU1`^4h23 zIyRB|s`TH1jRRHfd}`MSy>GmS_qOkkY0m2z-q@@_v^X;Pet2STd|D=5+K?=+Eq(a3 zxUx0ydS+;1P9R!%Gc6O&EWMlmAeOF7N#ydiPfH&@F0O2T*!;4(@p*oEQ@XUixVp8n z@p+5pvo+PcIom(cSJ~E5QbaCFCln?X;9{}4@RT%CQ*#ZywX2u;FZ~1UUCjCl0v=M6=ct7?-u|{y8s0xZTrTum#IpJ4ete-9NX^-(sLx5 zjq28Bsv880&YUkqW@s2kX*=M2AsIT>2ne@%&LQ9Md^@pr%^!dMnebcY(T`kPn2*k^h*qzHBmNX&LLS^Yx*k$~C`&M|yaW#4P zwpXVVDo!~0aeg`$I7Ao2>zT*6$*orQgO3~er<8q*_aXAbjE_E^iH*^`P#OuoVn$FH za<NG<$-i0f=2;479^fm%nqlV1qOp|i=^OqhBUpxs zg$`Q3AFSd62x?y$72v16Pw++^pu;eQZtXl!iBGz%BPo$qA*%w?+OMJQDC82k>A4#(plak`tK^*UGs^qGYI5P28SQsv~s)?1no zM#zskgA6H8@;;YeFAwO1=Kvc>WNuuowDQCl6Y80CzCR?GANk8wF4U2u2Y1`3JYBuqNL4>Bh4vi%gU{k?s)%$m zaBE+uDk=O2&1W3T_>DXv&DFT)Po4;%;BP8!5XfbBV5T11_uAe7L%Kiml9GqWH4pNr z^vO`@?iwzksh%o;gr6n0by-jS8H-Wtt8bl76o?p@hX>t2roSBaZsuOon~oKKd#)S7 zkGDR+oFsekk?%tXY|KO+gF|aPh87qit0W{}TFSE+@i<@Bn!PaPKCl`uxuFJ5_`sA8 z@6eyCDSn+vi@WlZ7^rHkGMD31zw;XRS@ki1?Mup=Z#+>76_n?G2*(PIYR{+iT79EUXyWKy zU}JMbZB4UGxDHygIJ;ZAg9jvb#s-*}G*7aYrLfS(aU;J5rf-<(%Z1%py91Qn82I}b zz@>?segZ1J39IFKlW+wX5t;n}@5DOD3nyzU9ggDyd@2qd8A4Wpv)7cs_vCk0OrIJr zQck)Uw4~2vrkQB4vJfU@;sR{Jd?=m=+W;cb)|?+B%^eLd>SQ}ORy`lb@BSQJ(Lxl! zdM%i?t*FrGLLZsS76@Q-%o*L6-&&JJs{;24JrZ>4<6DNmE~ouBAt1;AQM zG1@gLit4S)d294DjR(=elXy-%fWJj7OFH z0D2-Mx@-JrKPcnJu^;ZJ8qPd9m_?yQ=j7VoCH)y^nQ#<*40reX?KG{|{^;i7{pNKJ z`gqiLuFmx;A$Q$&+;aC(E^2lI(tW>m6836+YD_=+jg>nYO2Lc=` z;10rd$VEf*`oIJ~7}SQK*kAl9zcL#|5*1#VY-+94HZU9(>ghS9rr7|Gr+l|-#OujH znik#PI8OmpeG2jF{C9Yc)q&DyA+ zqB-mOGUlUao^O;hE;99xBU87lLfH=0v&sP-RDF4fpRCY-X@j|3j{Q3(kb$ literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties new file mode 100644 index 000000000..51b197608 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties @@ -0,0 +1,65 @@ +# + +pluginName = Property Editor +providerName = www.example.org + +_UI_PropertyEditor_menu = &Property 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_PropertyModelWizard_label = Property Model +_UI_PropertyModelWizard_description = Create a new Property model + +_UI_PropertyEditor_label = Property Model Editor + +_UI_PropertyEditorFilenameDefaultBase = My +_UI_PropertyEditorFilenameExtensions = property + +_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? + +_UI_ScenarioEditor_menu = &Scenario Editor +_UI_ScenarioModelWizard_label = Scenario Model +_UI_ScenarioModelWizard_description = Create a new Scenario model +_UI_ScenarioEditor_label = Scenario Model Editor +_UI_ScenarioEditorFilenameDefaultBase = My +_UI_ScenarioEditorFilenameExtensions = scenario +_UI_ReportEditor_menu = &Report Editor +_UI_ReportModelWizard_label = Report Model +_UI_ReportModelWizard_description = Create a new Report model +_UI_ReportEditor_label = Report Model Editor +_UI_ReportEditorFilenameDefaultBase = My +_UI_ReportEditorFilenameExtensions = report diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml new file mode 100644 index 000000000..4f56b1874 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + %_UI_PropertyModelWizard_description + + + + + + + + + + + + + + + %_UI_ReportModelWizard_description + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyActionBarContributor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyActionBarContributor.java new file mode 100644 index 000000000..6b4b25ebd --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyActionBarContributor.java @@ -0,0 +1,423 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.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 Property model editor. + * + * + * @generated + */ +public class PropertyActionBarContributor + 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(PropertyEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + PropertyEditorPlugin.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(PropertyEditorPlugin.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 PropertyActionBarContributor() { + 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("property-settings")); + toolBarManager.add(new Separator("property-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(PropertyEditorPlugin.INSTANCE.getString("_UI_PropertyEditor_menu"), "fr.inria.diverse.event.commons.model.propertyMenuID"); + 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(PropertyEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(PropertyEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + submenuManager.insertBefore("additions", createSiblingMenuManager); + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener + (new IMenuListener() { + 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 + */ + 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(PropertyEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(PropertyEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditor.java new file mode 100644 index 000000000..6f472cd7e --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditor.java @@ -0,0 +1,1822 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.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.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.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.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.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 fr.inria.diverse.event.commons.model.property.provider.PropertyItemProviderAdapterFactory; + +import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; + +import org.eclipse.ui.actions.WorkspaceModifyOperation; + + +/** + * This is an example of a Property model editor. + * + * + * @generated + */ +public class PropertyEditor + 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() { + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(PropertyEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(PropertyEditor.this); + handleActivate(); + } + } + else if (p == PropertyEditor.this) { + handleActivate(); + } + } + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + 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() { + 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() { + public void run() { + updateProblemIndication(); + } + }); + } + } + }; + + /** + * This listens for workspace changes. + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = + new IResourceChangeListener() { + 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(); + + 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() { + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(PropertyEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == PropertyEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + PropertyEditorPlugin.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(PropertyEditor.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, + "fr.inria.diverse.event.commons.model.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) { + PropertyEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + markerHelper.deleteMarkers(editingDomain.getResourceSet()); + if (diagnostic.getSeverity() != Diagnostic.OK) { + try { + markerHelper.createMarkers(diagnostic); + } + catch (CoreException exception) { + PropertyEditorPlugin.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 PropertyEditor() { + 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 PropertyItemProviderAdapterFactory()); + 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() { + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec + (new Runnable() { + 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() { + 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 + */ + 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. + // + 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 + */ + 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(), editingDomain.getResourceSet().getURIConverter()); + 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) { + boolean hasErrors = !resource.getErrors().isEmpty(); + if (hasErrors || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = + new BasicDiagnostic + (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, + "fr.inria.diverse.event.commons.model.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, + "fr.inria.diverse.event.commons.model.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(), PropertyEditor.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(), PropertyEditor.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(), PropertyEditor.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(), PropertyEditor.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(), PropertyEditor.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(), PropertyEditor.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() { + 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() { + 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. + // + 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) { + PropertyEditor.this.setSelectionToViewer(selection); + PropertyEditor.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. + // + PropertyEditorPlugin.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 + */ + 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 + */ + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * @generated + */ + 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 + */ + 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 PropertyEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return PropertyEditorPlugin.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 + */ + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditorPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditorPlugin.java new file mode 100644 index 000000000..3ccef04c7 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditorPlugin.java @@ -0,0 +1,94 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.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; + +/** + * This is the central singleton for the Property editor plugin. + * + * + * @generated + */ +public final class PropertyEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final PropertyEditorPlugin INSTANCE = new PropertyEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public PropertyEditorPlugin() { + super + (new ResourceLocator [] { + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java new file mode 100644 index 000000000..941bf3af3 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java @@ -0,0 +1,627 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.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.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.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.xmi.XMLResource; + +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; + +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.jface.dialogs.MessageDialog; + +import org.eclipse.jface.viewers.IStructuredSelection; + +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; + +import org.eclipse.swt.SWT; + +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.ModifyEvent; + +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.actions.WorkspaceModifyOperation; + +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; + +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin; + + +import org.eclipse.core.runtime.Path; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; + +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; + + +/** + * This is a simple wizard for creating a new model file. + * + * + * @generated + */ +public class PropertyModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(PropertyEditorPlugin.INSTANCE.getString("_UI_PropertyEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + PropertyEditorPlugin.INSTANCE.getString("_UI_PropertyEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected PropertyPackage propertyPackage = PropertyPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected PropertyFactory propertyFactory = propertyPackage.getPropertyFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected PropertyModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected PropertyModelWizardInitialObjectCreationPage 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 + */ + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(PropertyEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(PropertyEditorPlugin.INSTANCE.getImage("full/wizban/NewProperty"))); + } + + /** + * 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 : propertyPackage.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)propertyPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = propertyFactory.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) { + PropertyEditorPlugin.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() { + 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(), PropertyEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } + catch (Exception exception) { + PropertyEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class PropertyModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public PropertyModelWizardNewFileCreationPage(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(PropertyEditorPlugin.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 PropertyModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public PropertyModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * @generated + */ + 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(PropertyEditorPlugin.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(PropertyEditorPlugin.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() { + 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 PropertyEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } + catch(MissingResourceException mre) { + PropertyEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(PropertyEditorPlugin.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 PropertyModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(PropertyEditorPlugin.INSTANCE.getString("_UI_PropertyModelWizard_label")); + newFileCreationPage.setDescription(PropertyEditorPlugin.INSTANCE.getString("_UI_PropertyModelWizard_description")); + newFileCreationPage.setFileName(PropertyEditorPlugin.INSTANCE.getString("_UI_PropertyEditorFilenameDefaultBase") + "." + 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 = PropertyEditorPlugin.INSTANCE.getString("_UI_PropertyEditorFilenameDefaultBase"); + 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 PropertyModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(PropertyEditorPlugin.INSTANCE.getString("_UI_PropertyModelWizard_label")); + initialObjectCreationPage.setDescription(PropertyEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java new file mode 100644 index 000000000..23179e8b8 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java @@ -0,0 +1,423 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.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 Report model editor. + * + * + * @generated + */ +public class ReportActionBarContributor + 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(ReportEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + ReportEditorPlugin.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(ReportEditorPlugin.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 ReportActionBarContributor() { + 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("report-settings")); + toolBarManager.add(new Separator("report-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(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditor_menu"), "fr.inria.diverse.event.commons.model.reportMenuID"); + 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(ReportEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(ReportEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + submenuManager.insertBefore("additions", createSiblingMenuManager); + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener + (new IMenuListener() { + 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 + */ + 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(ReportEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(ReportEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java new file mode 100644 index 000000000..0a1092f33 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java @@ -0,0 +1,1828 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.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.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.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.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.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 fr.inria.diverse.event.commons.model.report.provider.ReportItemProviderAdapterFactory; + +import fr.inria.diverse.event.commons.model.property.provider.PropertyItemProviderAdapterFactory; + +import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioItemProviderAdapterFactory; + +import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; + +import org.eclipse.ui.actions.WorkspaceModifyOperation; + + +/** + * This is an example of a Report model editor. + * + * + * @generated + */ +public class ReportEditor + 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() { + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(ReportEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(ReportEditor.this); + handleActivate(); + } + } + else if (p == ReportEditor.this) { + handleActivate(); + } + } + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + 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() { + 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() { + public void run() { + updateProblemIndication(); + } + }); + } + } + }; + + /** + * This listens for workspace changes. + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = + new IResourceChangeListener() { + 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(); + + 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() { + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(ReportEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == ReportEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + ReportEditorPlugin.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(ReportEditor.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, + "fr.inria.diverse.event.commons.model.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) { + ReportEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + markerHelper.deleteMarkers(editingDomain.getResourceSet()); + if (diagnostic.getSeverity() != Diagnostic.OK) { + try { + markerHelper.createMarkers(diagnostic); + } + catch (CoreException exception) { + ReportEditorPlugin.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 ReportEditor() { + 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 ReportItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new PropertyItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new ScenarioItemProviderAdapterFactory()); + 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() { + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec + (new Runnable() { + 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() { + 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 + */ + 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. + // + 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 + */ + 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(), editingDomain.getResourceSet().getURIConverter()); + 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) { + boolean hasErrors = !resource.getErrors().isEmpty(); + if (hasErrors || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = + new BasicDiagnostic + (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, + "fr.inria.diverse.event.commons.model.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, + "fr.inria.diverse.event.commons.model.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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() { + 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() { + 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. + // + 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) { + ReportEditor.this.setSelectionToViewer(selection); + ReportEditor.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. + // + ReportEditorPlugin.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 + */ + 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 + */ + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * @generated + */ + 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 + */ + 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 ReportEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return ReportEditorPlugin.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 + */ + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java new file mode 100644 index 000000000..4d1d39678 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java @@ -0,0 +1,100 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.presentation; + +import fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin; + +import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioEditPlugin; + +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; + +/** + * This is the central singleton for the Report editor plugin. + * + * + * @generated + */ +public final class ReportEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final ReportEditorPlugin INSTANCE = new ReportEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public ReportEditorPlugin() { + super + (new ResourceLocator [] { + EcoreEditPlugin.INSTANCE, + PropertyEditPlugin.INSTANCE, + ScenarioEditPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java new file mode 100644 index 000000000..9147c66ed --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java @@ -0,0 +1,627 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.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.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.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.xmi.XMLResource; + +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; + +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.jface.dialogs.MessageDialog; + +import org.eclipse.jface.viewers.IStructuredSelection; + +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; + +import org.eclipse.swt.SWT; + +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.ModifyEvent; + +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.actions.WorkspaceModifyOperation; + +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; + +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + +import fr.inria.diverse.event.commons.model.report.ReportFactory; +import fr.inria.diverse.event.commons.model.report.ReportPackage; +import fr.inria.diverse.event.commons.model.report.provider.ReportEditPlugin; + + +import org.eclipse.core.runtime.Path; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; + +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; + + +/** + * This is a simple wizard for creating a new model file. + * + * + * @generated + */ +public class ReportModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected ReportPackage reportPackage = ReportPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected ReportFactory reportFactory = reportPackage.getReportFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected ReportModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected ReportModelWizardInitialObjectCreationPage 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 + */ + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(ReportEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(ReportEditorPlugin.INSTANCE.getImage("full/wizban/NewReport"))); + } + + /** + * 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 : reportPackage.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)reportPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = reportFactory.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) { + ReportEditorPlugin.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() { + 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(), ReportEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } + catch (Exception exception) { + ReportEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class ReportModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public ReportModelWizardNewFileCreationPage(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(ReportEditorPlugin.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 ReportModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public ReportModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * @generated + */ + 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(ReportEditorPlugin.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(ReportEditorPlugin.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() { + 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 ReportEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } + catch(MissingResourceException mre) { + ReportEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(ReportEditorPlugin.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 ReportModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_label")); + newFileCreationPage.setDescription(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_description")); + newFileCreationPage.setFileName(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameDefaultBase") + "." + 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 = ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameDefaultBase"); + 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 ReportModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_label")); + initialObjectCreationPage.setDescription(ReportEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioEditorPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioEditorPlugin.java new file mode 100644 index 000000000..2c0224559 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioEditorPlugin.java @@ -0,0 +1,97 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.presentation; + +import fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin; + +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; + +/** + * This is the central singleton for the Scenario editor plugin. + * + * + * @generated + */ +public final class ScenarioEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final ScenarioEditorPlugin INSTANCE = new ScenarioEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public ScenarioEditorPlugin() { + super + (new ResourceLocator [] { + EcoreEditPlugin.INSTANCE, + PropertyEditPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.classpath b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.classpath new file mode 100644 index 000000000..428337e56 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.project b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.project new file mode 100644 index 000000000..526e9a87c --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.project @@ -0,0 +1,34 @@ + + + fr.inria.diverse.event.commons.model + + + + + + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.settings/org.eclipse.jdt.core.prefs b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..0c68a61dc --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/.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.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF new file mode 100644 index 000000000..dd4447134 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.inria.diverse.event.commons.model;singleton:=true +Bundle-Version: 2.3.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: fr.inria.diverse.event.commons.model, + fr.inria.diverse.event.commons.model.scenario, + fr.inria.diverse.event.commons.model.scenario.impl, + fr.inria.diverse.event.commons.model.scenario.util, + fr.inria.diverse.event.commons.model.property, + fr.inria.diverse.event.commons.model.property.impl, + fr.inria.diverse.event.commons.model.property.util, + fr.inria.diverse.event.commons.model.report, + fr.inria.diverse.event.commons.model.report.impl, + fr.inria.diverse.event.commons.model.report.util +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport, + fr.inria.diverse.event.commons.model;visibility:=reexport, + com.google.guava, + org.eclipse.xtext.xbase.lib, + org.eclipse.xtend.lib, + org.eclipse.xtend.lib.macro, + org.gemoc.xdsmlframework.api;bundle-version="2.3.0" +Bundle-ActivationPolicy: lazy + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/build.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/build.properties new file mode 100644 index 000000000..4465407fc --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/build.properties @@ -0,0 +1,10 @@ +# + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore new file mode 100644 index 000000000..ffa54262e --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.genmodel b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.genmodel new file mode 100644 index 000000000..699575879 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.genmodel @@ -0,0 +1,44 @@ + + + property.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore new file mode 100644 index 000000000..863c012ef --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.genmodel b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.genmodel new file mode 100644 index 000000000..c52c3c264 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.genmodel @@ -0,0 +1,19 @@ + + + report.ecore + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore new file mode 100644 index 000000000..a0b673bcb --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.genmodel b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.genmodel new file mode 100644 index 000000000..4a7e04cd3 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.genmodel @@ -0,0 +1,27 @@ + + + scenario.ecore + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.properties new file mode 100644 index 000000000..f6073b142 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.properties @@ -0,0 +1,4 @@ +# + +pluginName = Scenario Model +providerName = www.example.org diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.xml new file mode 100644 index 000000000..c16fc064f --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/EventManagerRegistry.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/EventManagerRegistry.java new file mode 100644 index 000000000..eb14ac480 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/EventManagerRegistry.java @@ -0,0 +1,38 @@ +package fr.inria.diverse.event.commons.model; + +import java.util.HashSet; +import java.util.Set; + +public class EventManagerRegistry { + + private static EventManagerRegistry instance; + + private Set registeredManagers; + + private EventManagerRegistry () { + this.registeredManagers = new HashSet(); + } + + public static EventManagerRegistry getInstance() { + if(instance == null) { + instance = new EventManagerRegistry(); + } + return instance; + } + + public void registerManager(IEventManager manager) { + if(manager != null) { + registeredManagers.add(manager); + } + } + + public void unregisterManager(IEventManager manager) { + if(manager != null) { + registeredManagers.remove(manager); + } + } + + public IEventManager findEventManager() { + return registeredManagers.stream().findFirst().orElse(null); + } +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java new file mode 100644 index 000000000..72046ca8b --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java @@ -0,0 +1,22 @@ +package fr.inria.diverse.event.commons.model; + +import java.util.Set; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; + +public interface IEventManager extends IEngineAddon { + + void sendEvent(Object event); + + void manageEvents(); + + void waitForEvents(); + + Set getEventClasses(); + + boolean canSendEvent(Object event); + + void loadScenario(String path, ResourceSet resourceSet); +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BinaryProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BinaryProperty.java new file mode 100644 index 000000000..d3e149df2 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BinaryProperty.java @@ -0,0 +1,106 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Binary Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.BinaryProperty#getOperator Operator}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.BinaryProperty#getLeft Left}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.BinaryProperty#getRight Right}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBinaryProperty() + * @model abstract="true" + * @generated + */ +public interface BinaryProperty

, T> extends ClassProperty { + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.BooleanOperator}. + * + *

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

+ * + * @return the value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.BooleanOperator + * @see #setOperator(BooleanOperator) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBinaryProperty_Operator() + * @model required="true" + * @generated + */ + BooleanOperator getOperator(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.BooleanOperator + * @see #getOperator() + * @generated + */ + void setOperator(BooleanOperator value); + + /** + * Returns the value of the 'Left' containment reference. + * + *

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

+ * + * @return the value of the 'Left' containment reference. + * @see #setLeft(ClassProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBinaryProperty_Left() + * @model containment="true" required="true" + * @generated + */ + P getLeft(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty#getLeft Left}' containment reference. + * + * + * @param value the new value of the 'Left' containment reference. + * @see #getLeft() + * @generated + */ + void setLeft(P value); + + /** + * Returns the value of the 'Right' containment reference. + * + *

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

+ * + * @return the value of the 'Right' containment reference. + * @see #setRight(ClassProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBinaryProperty_Right() + * @model containment="true" required="true" + * @generated + */ + P getRight(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty#getRight Right}' containment reference. + * + * + * @param value the new value of the 'Right' containment reference. + * @see #getRight() + * @generated + */ + void setRight(P value); + +} // BinaryProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java new file mode 100644 index 000000000..a87391b29 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java @@ -0,0 +1,79 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Boolean Attribute Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty#isValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty#getOperator Operator}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBooleanAttributeProperty() + * @model abstract="true" + * @generated + */ +public interface BooleanAttributeProperty extends ClassProperty { + /** + * 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(boolean) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBooleanAttributeProperty_Value() + * @model + * @generated + */ + boolean isValue(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty#isValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #isValue() + * @generated + */ + void setValue(boolean value); + + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * + *

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

+ * + * @return the value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBooleanAttributeProperty_Operator() + * @model + * @generated + */ + Operator getOperator(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #getOperator() + * @generated + */ + void setOperator(Operator value); + +} // BooleanAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanOperator.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanOperator.java new file mode 100644 index 000000000..254ee0cc4 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanOperator.java @@ -0,0 +1,241 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +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 'Boolean Operator', + * and utility methods for working with them. + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBooleanOperator() + * @model + * @generated + */ +public enum BooleanOperator implements Enumerator { + /** + * The 'AND' literal object. + * + * + * @see #AND_VALUE + * @generated + * @ordered + */ + AND(0, "AND", "AND"), + + /** + * The 'OR' literal object. + * + * + * @see #OR_VALUE + * @generated + * @ordered + */ + OR(1, "OR", "OR"), + + /** + * The 'IMPLIES' literal object. + * + * + * @see #IMPLIES_VALUE + * @generated + * @ordered + */ + IMPLIES(2, "IMPLIES", "IMPLIES"); + + /** + * The 'AND' literal value. + * + *

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

+ * + * @see #AND + * @model + * @generated + * @ordered + */ + public static final int AND_VALUE = 0; + + /** + * The 'OR' literal value. + * + *

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

+ * + * @see #OR + * @model + * @generated + * @ordered + */ + public static final int OR_VALUE = 1; + + /** + * The 'IMPLIES' literal value. + * + *

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

+ * + * @see #IMPLIES + * @model + * @generated + * @ordered + */ + public static final int IMPLIES_VALUE = 2; + + /** + * An array of all the 'Boolean Operator' enumerators. + * + * + * @generated + */ + private static final BooleanOperator[] VALUES_ARRAY = + new BooleanOperator[] { + AND, + OR, + IMPLIES, + }; + + /** + * A public read-only list of all the 'Boolean Operator' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Boolean Operator' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static BooleanOperator get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + BooleanOperator result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Boolean Operator' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static BooleanOperator getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + BooleanOperator result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Boolean Operator' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static BooleanOperator get(int value) { + switch (value) { + case AND_VALUE: return AND; + case OR_VALUE: return OR; + case IMPLIES_VALUE: return IMPLIES; + } + 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 BooleanOperator(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //BooleanOperator diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ClassProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ClassProperty.java new file mode 100644 index 000000000..948dca65e --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ClassProperty.java @@ -0,0 +1,67 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; + +/** + * + * A representation of the model object 'Class Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.ClassProperty#getTarget Target}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.ClassProperty#getFeature Feature}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getClassProperty() + * @model abstract="true" + * @generated + */ +public interface ClassProperty extends EObject { + /** + * Returns the value of the 'Target' reference. + * + *

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

+ * + * @return the value of the 'Target' reference. + * @see #setTarget(Object) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getClassProperty_Target() + * @model kind="reference" + * @generated + */ + T getTarget(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ClassProperty#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(T value); + + /** + * Returns the value of the 'Feature' reference. + * + *

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

+ * + * @return the value of the 'Feature' reference. + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getClassProperty_Feature() + * @model transient="true" changeable="false" derived="true" + * @generated + */ + EStructuralFeature getFeature(); + +} // ClassProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ContainerReferenceProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ContainerReferenceProperty.java new file mode 100644 index 000000000..27daebde8 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ContainerReferenceProperty.java @@ -0,0 +1,49 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Container Reference Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty#getProperty Property}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getContainerReferenceProperty() + * @model + * @generated + */ +public interface ContainerReferenceProperty

, T> extends ClassProperty { + /** + * Returns the value of the 'Property' containment reference. + * + *

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

+ * + * @return the value of the 'Property' containment reference. + * @see #setProperty(ClassProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getContainerReferenceProperty_Property() + * @model containment="true" + * @generated + */ + P getProperty(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty#getProperty Property}' containment reference. + * + * + * @param value the new value of the 'Property' containment reference. + * @see #getProperty() + * @generated + */ + void setProperty(P value); + +} // ContainerReferenceProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java new file mode 100644 index 000000000..30e01ca8f --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java @@ -0,0 +1,79 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Integer Attribute Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty#getValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty#getOperator Operator}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getIntegerAttributeProperty() + * @model abstract="true" + * @generated + */ +public interface IntegerAttributeProperty extends ClassProperty { + /** + * 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 fr.inria.diverse.event.commons.model.property.PropertyPackage#getIntegerAttributeProperty_Value() + * @model + * @generated + */ + int getValue(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(int value); + + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * + *

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

+ * + * @return the value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getIntegerAttributeProperty_Operator() + * @model + * @generated + */ + Operator getOperator(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #getOperator() + * @generated + */ + void setOperator(Operator value); + +} // IntegerAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java new file mode 100644 index 000000000..5c9388e82 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java @@ -0,0 +1,108 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +/** + * + * A representation of the model object 'Many Boolean Attribute Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#getQuantifier Quantifier}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#isValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#getOperator Operator}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyBooleanAttributeProperty() + * @model + * @generated + */ +public interface ManyBooleanAttributeProperty extends ClassProperty { + /** + * Returns the value of the 'Quantifier' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Quantifier}. + * + *

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

+ * + * @return the value of the 'Quantifier' attribute. + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see #setQuantifier(Quantifier) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyBooleanAttributeProperty_Quantifier() + * @model + * @generated + */ + Quantifier getQuantifier(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#getQuantifier Quantifier}' attribute. + * + * + * @param value the new value of the 'Quantifier' attribute. + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see #getQuantifier() + * @generated + */ + void setQuantifier(Quantifier 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(boolean) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyBooleanAttributeProperty_Value() + * @model + * @generated + */ + boolean isValue(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#isValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #isValue() + * @generated + */ + void setValue(boolean value); + + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * + *

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

+ * + * @return the value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyBooleanAttributeProperty_Operator() + * @model + * @generated + */ + Operator getOperator(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #getOperator() + * @generated + */ + void setOperator(Operator value); + +} // ManyBooleanAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java new file mode 100644 index 000000000..9bd44f327 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java @@ -0,0 +1,108 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +/** + * + * A representation of the model object 'Many Integer Attribute Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getQuantifier Quantifier}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getOperator Operator}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyIntegerAttributeProperty() + * @model + * @generated + */ +public interface ManyIntegerAttributeProperty extends ClassProperty { + /** + * Returns the value of the 'Quantifier' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Quantifier}. + * + *

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

+ * + * @return the value of the 'Quantifier' attribute. + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see #setQuantifier(Quantifier) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyIntegerAttributeProperty_Quantifier() + * @model + * @generated + */ + Quantifier getQuantifier(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getQuantifier Quantifier}' attribute. + * + * + * @param value the new value of the 'Quantifier' attribute. + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see #getQuantifier() + * @generated + */ + void setQuantifier(Quantifier 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(int) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyIntegerAttributeProperty_Value() + * @model + * @generated + */ + int getValue(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(int value); + + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * + *

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

+ * + * @return the value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyIntegerAttributeProperty_Operator() + * @model + * @generated + */ + Operator getOperator(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #getOperator() + * @generated + */ + void setOperator(Operator value); + +} // ManyIntegerAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyReferenceProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyReferenceProperty.java new file mode 100644 index 000000000..493cafaf9 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyReferenceProperty.java @@ -0,0 +1,79 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Many Reference Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyReferenceProperty#getProperty Property}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyReferenceProperty#getQuantifier Quantifier}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyReferenceProperty() + * @model abstract="true" + * @generated + */ +public interface ManyReferenceProperty

, T> extends ClassProperty { + /** + * Returns the value of the 'Property' containment reference. + * + *

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

+ * + * @return the value of the 'Property' containment reference. + * @see #setProperty(ClassProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyReferenceProperty_Property() + * @model containment="true" required="true" + * @generated + */ + P getProperty(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyReferenceProperty#getProperty Property}' containment reference. + * + * + * @param value the new value of the 'Property' containment reference. + * @see #getProperty() + * @generated + */ + void setProperty(P value); + + /** + * Returns the value of the 'Quantifier' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Quantifier}. + * + *

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

+ * + * @return the value of the 'Quantifier' attribute. + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see #setQuantifier(Quantifier) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyReferenceProperty_Quantifier() + * @model + * @generated + */ + Quantifier getQuantifier(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyReferenceProperty#getQuantifier Quantifier}' attribute. + * + * + * @param value the new value of the 'Quantifier' attribute. + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see #getQuantifier() + * @generated + */ + void setQuantifier(Quantifier value); + +} // ManyReferenceProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java new file mode 100644 index 000000000..ba9f58efe --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java @@ -0,0 +1,108 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +/** + * + * A representation of the model object 'Many String Attribute Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getQuantifier Quantifier}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getOperator Operator}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyStringAttributeProperty() + * @model + * @generated + */ +public interface ManyStringAttributeProperty extends ClassProperty { + /** + * Returns the value of the 'Quantifier' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Quantifier}. + * + *

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

+ * + * @return the value of the 'Quantifier' attribute. + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see #setQuantifier(Quantifier) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyStringAttributeProperty_Quantifier() + * @model + * @generated + */ + Quantifier getQuantifier(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getQuantifier Quantifier}' attribute. + * + * + * @param value the new value of the 'Quantifier' attribute. + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see #getQuantifier() + * @generated + */ + void setQuantifier(Quantifier 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 fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyStringAttributeProperty_Value() + * @model + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * + *

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

+ * + * @return the value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyStringAttributeProperty_Operator() + * @model + * @generated + */ + Operator getOperator(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #getOperator() + * @generated + */ + void setOperator(Operator value); + +} // ManyStringAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Operator.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Operator.java new file mode 100644 index 000000000..187779322 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Operator.java @@ -0,0 +1,187 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +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 'Operator', + * and utility methods for working with them. + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getOperator() + * @model + * @generated + */ +public enum Operator implements Enumerator { + /** + * The 'EQUAL' literal object. + * + * + * @see #EQUAL_VALUE + * @generated + * @ordered + */ + EQUAL(0, "EQUAL", "EQUAL"); + + /** + * The 'EQUAL' literal value. + * + *

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

+ * + * @see #EQUAL + * @model + * @generated + * @ordered + */ + public static final int EQUAL_VALUE = 0; + + /** + * An array of all the 'Operator' enumerators. + * + * + * @generated + */ + private static final Operator[] VALUES_ARRAY = + new Operator[] { + EQUAL, + }; + + /** + * A public read-only list of all the 'Operator' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Operator' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static Operator get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + Operator result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Operator' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static Operator getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + Operator result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Operator' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static Operator get(int value) { + switch (value) { + case EQUAL_VALUE: return EQUAL; + } + 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 Operator(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //Operator diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java new file mode 100644 index 000000000..ad2a1c7df --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java @@ -0,0 +1,69 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +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 fr.inria.diverse.event.commons.model.property.PropertyPackage + * @generated + */ +public interface PropertyFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + PropertyFactory eINSTANCE = fr.inria.diverse.event.commons.model.property.impl.PropertyFactoryImpl.init(); + + /** + * Returns a new object of class 'Container Reference Property'. + * + * + * @return a new object of class 'Container Reference Property'. + * @generated + */ +

, T> ContainerReferenceProperty createContainerReferenceProperty(); + + /** + * Returns a new object of class 'Many Boolean Attribute Property'. + * + * + * @return a new object of class 'Many Boolean Attribute Property'. + * @generated + */ + ManyBooleanAttributeProperty createManyBooleanAttributeProperty(); + + /** + * Returns a new object of class 'Many Integer Attribute Property'. + * + * + * @return a new object of class 'Many Integer Attribute Property'. + * @generated + */ + ManyIntegerAttributeProperty createManyIntegerAttributeProperty(); + + /** + * Returns a new object of class 'Many String Attribute Property'. + * + * + * @return a new object of class 'Many String Attribute Property'. + * @generated + */ + ManyStringAttributeProperty createManyStringAttributeProperty(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + PropertyPackage getPropertyPackage(); + +} //PropertyFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java new file mode 100644 index 000000000..0e022bbdc --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java @@ -0,0 +1,1556 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +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 operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyFactory + * @model kind="package" + * @generated + */ +public interface PropertyPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "property"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.gemoc.org/property"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "property"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + PropertyPackage eINSTANCE = fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl.init(); + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl Class Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getClassProperty() + * @generated + */ + int CLASS_PROPERTY = 0; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int CLASS_PROPERTY__TARGET = 0; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int CLASS_PROPERTY__FEATURE = 1; + + /** + * The number of structural features of the 'Class Property' class. + * + * + * @generated + * @ordered + */ + int CLASS_PROPERTY_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Class Property' class. + * + * + * @generated + * @ordered + */ + int CLASS_PROPERTY_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl Binary Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBinaryProperty() + * @generated + */ + int BINARY_PROPERTY = 1; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int BINARY_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int BINARY_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Operator' attribute. + * + * + * @generated + * @ordered + */ + int BINARY_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Left' containment reference. + * + * + * @generated + * @ordered + */ + int BINARY_PROPERTY__LEFT = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Right' containment reference. + * + * + * @generated + * @ordered + */ + int BINARY_PROPERTY__RIGHT = CLASS_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Binary Property' class. + * + * + * @generated + * @ordered + */ + int BINARY_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 3; + + /** + * The number of operations of the 'Binary Property' class. + * + * + * @generated + * @ordered + */ + int BINARY_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl Many Reference Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyReferenceProperty() + * @generated + */ + int MANY_REFERENCE_PROPERTY = 2; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int MANY_REFERENCE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int MANY_REFERENCE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Property' containment reference. + * + * + * @generated + * @ordered + */ + int MANY_REFERENCE_PROPERTY__PROPERTY = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Quantifier' attribute. + * + * + * @generated + * @ordered + */ + int MANY_REFERENCE_PROPERTY__QUANTIFIER = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Many Reference Property' class. + * + * + * @generated + * @ordered + */ + int MANY_REFERENCE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Many Reference Property' class. + * + * + * @generated + * @ordered + */ + int MANY_REFERENCE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl Single Reference Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getSingleReferenceProperty() + * @generated + */ + int SINGLE_REFERENCE_PROPERTY = 3; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int SINGLE_REFERENCE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int SINGLE_REFERENCE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Property' containment reference. + * + * + * @generated + * @ordered + */ + int SINGLE_REFERENCE_PROPERTY__PROPERTY = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Single Reference Property' class. + * + * + * @generated + * @ordered + */ + int SINGLE_REFERENCE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Single Reference Property' class. + * + * + * @generated + * @ordered + */ + int SINGLE_REFERENCE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl Container Reference Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getContainerReferenceProperty() + * @generated + */ + int CONTAINER_REFERENCE_PROPERTY = 4; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int CONTAINER_REFERENCE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int CONTAINER_REFERENCE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Property' containment reference. + * + * + * @generated + * @ordered + */ + int CONTAINER_REFERENCE_PROPERTY__PROPERTY = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Container Reference Property' class. + * + * + * @generated + * @ordered + */ + int CONTAINER_REFERENCE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Container Reference Property' class. + * + * + * @generated + * @ordered + */ + int CONTAINER_REFERENCE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl Many Boolean Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyBooleanAttributeProperty() + * @generated + */ + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY = 5; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Quantifier' attribute. + * + * + * @generated + * @ordered + */ + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Operator' attribute. + * + * + * @generated + * @ordered + */ + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Many Boolean Attribute Property' class. + * + * + * @generated + * @ordered + */ + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 3; + + /** + * The number of operations of the 'Many Boolean Attribute Property' class. + * + * + * @generated + * @ordered + */ + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl Many Integer Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyIntegerAttributeProperty() + * @generated + */ + int MANY_INTEGER_ATTRIBUTE_PROPERTY = 6; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int MANY_INTEGER_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int MANY_INTEGER_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Quantifier' attribute. + * + * + * @generated + * @ordered + */ + int MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Operator' attribute. + * + * + * @generated + * @ordered + */ + int MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Many Integer Attribute Property' class. + * + * + * @generated + * @ordered + */ + int MANY_INTEGER_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 3; + + /** + * The number of operations of the 'Many Integer Attribute Property' class. + * + * + * @generated + * @ordered + */ + int MANY_INTEGER_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl Many String Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyStringAttributeProperty() + * @generated + */ + int MANY_STRING_ATTRIBUTE_PROPERTY = 7; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int MANY_STRING_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int MANY_STRING_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Quantifier' attribute. + * + * + * @generated + * @ordered + */ + int MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int MANY_STRING_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Operator' attribute. + * + * + * @generated + * @ordered + */ + int MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Many String Attribute Property' class. + * + * + * @generated + * @ordered + */ + int MANY_STRING_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 3; + + /** + * The number of operations of the 'Many String Attribute Property' class. + * + * + * @generated + * @ordered + */ + int MANY_STRING_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl Boolean Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanAttributeProperty() + * @generated + */ + int BOOLEAN_ATTRIBUTE_PROPERTY = 8; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int BOOLEAN_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int BOOLEAN_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int BOOLEAN_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Operator' attribute. + * + * + * @generated + * @ordered + */ + int BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Boolean Attribute Property' class. + * + * + * @generated + * @ordered + */ + int BOOLEAN_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Boolean Attribute Property' class. + * + * + * @generated + * @ordered + */ + int BOOLEAN_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl Integer Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getIntegerAttributeProperty() + * @generated + */ + int INTEGER_ATTRIBUTE_PROPERTY = 9; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int INTEGER_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int INTEGER_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int INTEGER_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Operator' attribute. + * + * + * @generated + * @ordered + */ + int INTEGER_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Integer Attribute Property' class. + * + * + * @generated + * @ordered + */ + int INTEGER_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Integer Attribute Property' class. + * + * + * @generated + * @ordered + */ + int INTEGER_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl String Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStringAttributeProperty() + * @generated + */ + int STRING_ATTRIBUTE_PROPERTY = 10; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int STRING_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + + /** + * The feature id for the 'Feature' reference. + * + * + * @generated + * @ordered + */ + int STRING_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int STRING_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Operator' attribute. + * + * + * @generated + * @ordered + */ + int STRING_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'String Attribute Property' class. + * + * + * @generated + * @ordered + */ + int STRING_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'String Attribute Property' class. + * + * + * @generated + * @ordered + */ + int STRING_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getOperator() + * @generated + */ + int OPERATOR = 11; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.BooleanOperator + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanOperator() + * @generated + */ + int BOOLEAN_OPERATOR = 12; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Quantifier Quantifier}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getQuantifier() + * @generated + */ + int QUANTIFIER = 13; + + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.ClassProperty Class Property}'. + * + * + * @return the meta object for class 'Class Property'. + * @see fr.inria.diverse.event.commons.model.property.ClassProperty + * @generated + */ + EClass getClassProperty(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.property.ClassProperty#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see fr.inria.diverse.event.commons.model.property.ClassProperty#getTarget() + * @see #getClassProperty() + * @generated + */ + EReference getClassProperty_Target(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.property.ClassProperty#getFeature Feature}'. + * + * + * @return the meta object for the reference 'Feature'. + * @see fr.inria.diverse.event.commons.model.property.ClassProperty#getFeature() + * @see #getClassProperty() + * @generated + */ + EReference getClassProperty_Feature(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty Binary Property}'. + * + * + * @return the meta object for class 'Binary Property'. + * @see fr.inria.diverse.event.commons.model.property.BinaryProperty + * @generated + */ + EClass getBinaryProperty(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty#getOperator Operator}'. + * + * + * @return the meta object for the attribute 'Operator'. + * @see fr.inria.diverse.event.commons.model.property.BinaryProperty#getOperator() + * @see #getBinaryProperty() + * @generated + */ + EAttribute getBinaryProperty_Operator(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty#getLeft Left}'. + * + * + * @return the meta object for the containment reference 'Left'. + * @see fr.inria.diverse.event.commons.model.property.BinaryProperty#getLeft() + * @see #getBinaryProperty() + * @generated + */ + EReference getBinaryProperty_Left(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty#getRight Right}'. + * + * + * @return the meta object for the containment reference 'Right'. + * @see fr.inria.diverse.event.commons.model.property.BinaryProperty#getRight() + * @see #getBinaryProperty() + * @generated + */ + EReference getBinaryProperty_Right(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.ManyReferenceProperty Many Reference Property}'. + * + * + * @return the meta object for class 'Many Reference Property'. + * @see fr.inria.diverse.event.commons.model.property.ManyReferenceProperty + * @generated + */ + EClass getManyReferenceProperty(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.ManyReferenceProperty#getProperty Property}'. + * + * + * @return the meta object for the containment reference 'Property'. + * @see fr.inria.diverse.event.commons.model.property.ManyReferenceProperty#getProperty() + * @see #getManyReferenceProperty() + * @generated + */ + EReference getManyReferenceProperty_Property(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyReferenceProperty#getQuantifier Quantifier}'. + * + * + * @return the meta object for the attribute 'Quantifier'. + * @see fr.inria.diverse.event.commons.model.property.ManyReferenceProperty#getQuantifier() + * @see #getManyReferenceProperty() + * @generated + */ + EAttribute getManyReferenceProperty_Quantifier(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.SingleReferenceProperty Single Reference Property}'. + * + * + * @return the meta object for class 'Single Reference Property'. + * @see fr.inria.diverse.event.commons.model.property.SingleReferenceProperty + * @generated + */ + EClass getSingleReferenceProperty(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.SingleReferenceProperty#getProperty Property}'. + * + * + * @return the meta object for the containment reference 'Property'. + * @see fr.inria.diverse.event.commons.model.property.SingleReferenceProperty#getProperty() + * @see #getSingleReferenceProperty() + * @generated + */ + EReference getSingleReferenceProperty_Property(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty Container Reference Property}'. + * + * + * @return the meta object for class 'Container Reference Property'. + * @see fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty + * @generated + */ + EClass getContainerReferenceProperty(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty#getProperty Property}'. + * + * + * @return the meta object for the containment reference 'Property'. + * @see fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty#getProperty() + * @see #getContainerReferenceProperty() + * @generated + */ + EReference getContainerReferenceProperty_Property(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty Many Boolean Attribute Property}'. + * + * + * @return the meta object for class 'Many Boolean Attribute Property'. + * @see fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty + * @generated + */ + EClass getManyBooleanAttributeProperty(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#getQuantifier Quantifier}'. + * + * + * @return the meta object for the attribute 'Quantifier'. + * @see fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#getQuantifier() + * @see #getManyBooleanAttributeProperty() + * @generated + */ + EAttribute getManyBooleanAttributeProperty_Quantifier(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#isValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#isValue() + * @see #getManyBooleanAttributeProperty() + * @generated + */ + EAttribute getManyBooleanAttributeProperty_Value(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#getOperator Operator}'. + * + * + * @return the meta object for the attribute 'Operator'. + * @see fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#getOperator() + * @see #getManyBooleanAttributeProperty() + * @generated + */ + EAttribute getManyBooleanAttributeProperty_Operator(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty Many Integer Attribute Property}'. + * + * + * @return the meta object for class 'Many Integer Attribute Property'. + * @see fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty + * @generated + */ + EClass getManyIntegerAttributeProperty(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getQuantifier Quantifier}'. + * + * + * @return the meta object for the attribute 'Quantifier'. + * @see fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getQuantifier() + * @see #getManyIntegerAttributeProperty() + * @generated + */ + EAttribute getManyIntegerAttributeProperty_Quantifier(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getValue() + * @see #getManyIntegerAttributeProperty() + * @generated + */ + EAttribute getManyIntegerAttributeProperty_Value(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getOperator Operator}'. + * + * + * @return the meta object for the attribute 'Operator'. + * @see fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getOperator() + * @see #getManyIntegerAttributeProperty() + * @generated + */ + EAttribute getManyIntegerAttributeProperty_Operator(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty Many String Attribute Property}'. + * + * + * @return the meta object for class 'Many String Attribute Property'. + * @see fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty + * @generated + */ + EClass getManyStringAttributeProperty(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getQuantifier Quantifier}'. + * + * + * @return the meta object for the attribute 'Quantifier'. + * @see fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getQuantifier() + * @see #getManyStringAttributeProperty() + * @generated + */ + EAttribute getManyStringAttributeProperty_Quantifier(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getValue() + * @see #getManyStringAttributeProperty() + * @generated + */ + EAttribute getManyStringAttributeProperty_Value(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getOperator Operator}'. + * + * + * @return the meta object for the attribute 'Operator'. + * @see fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getOperator() + * @see #getManyStringAttributeProperty() + * @generated + */ + EAttribute getManyStringAttributeProperty_Operator(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty Boolean Attribute Property}'. + * + * + * @return the meta object for class 'Boolean Attribute Property'. + * @see fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty + * @generated + */ + EClass getBooleanAttributeProperty(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty#isValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty#isValue() + * @see #getBooleanAttributeProperty() + * @generated + */ + EAttribute getBooleanAttributeProperty_Value(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty#getOperator Operator}'. + * + * + * @return the meta object for the attribute 'Operator'. + * @see fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty#getOperator() + * @see #getBooleanAttributeProperty() + * @generated + */ + EAttribute getBooleanAttributeProperty_Operator(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty Integer Attribute Property}'. + * + * + * @return the meta object for class 'Integer Attribute Property'. + * @see fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty + * @generated + */ + EClass getIntegerAttributeProperty(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty#getValue() + * @see #getIntegerAttributeProperty() + * @generated + */ + EAttribute getIntegerAttributeProperty_Value(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty#getOperator Operator}'. + * + * + * @return the meta object for the attribute 'Operator'. + * @see fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty#getOperator() + * @see #getIntegerAttributeProperty() + * @generated + */ + EAttribute getIntegerAttributeProperty_Operator(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty String Attribute Property}'. + * + * + * @return the meta object for class 'String Attribute Property'. + * @see fr.inria.diverse.event.commons.model.property.StringAttributeProperty + * @generated + */ + EClass getStringAttributeProperty(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see fr.inria.diverse.event.commons.model.property.StringAttributeProperty#getValue() + * @see #getStringAttributeProperty() + * @generated + */ + EAttribute getStringAttributeProperty_Value(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty#getOperator Operator}'. + * + * + * @return the meta object for the attribute 'Operator'. + * @see fr.inria.diverse.event.commons.model.property.StringAttributeProperty#getOperator() + * @see #getStringAttributeProperty() + * @generated + */ + EAttribute getStringAttributeProperty_Operator(); + + /** + * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}'. + * + * + * @return the meta object for enum 'Operator'. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @generated + */ + EEnum getOperator(); + + /** + * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}'. + * + * + * @return the meta object for enum 'Boolean Operator'. + * @see fr.inria.diverse.event.commons.model.property.BooleanOperator + * @generated + */ + EEnum getBooleanOperator(); + + /** + * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.Quantifier Quantifier}'. + * + * + * @return the meta object for enum 'Quantifier'. + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @generated + */ + EEnum getQuantifier(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + PropertyFactory getPropertyFactory(); + + /** + * + * 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 fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl Class Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getClassProperty() + * @generated + */ + EClass CLASS_PROPERTY = eINSTANCE.getClassProperty(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference CLASS_PROPERTY__TARGET = eINSTANCE.getClassProperty_Target(); + + /** + * The meta object literal for the 'Feature' reference feature. + * + * + * @generated + */ + EReference CLASS_PROPERTY__FEATURE = eINSTANCE.getClassProperty_Feature(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl Binary Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBinaryProperty() + * @generated + */ + EClass BINARY_PROPERTY = eINSTANCE.getBinaryProperty(); + + /** + * The meta object literal for the 'Operator' attribute feature. + * + * + * @generated + */ + EAttribute BINARY_PROPERTY__OPERATOR = eINSTANCE.getBinaryProperty_Operator(); + + /** + * The meta object literal for the 'Left' containment reference feature. + * + * + * @generated + */ + EReference BINARY_PROPERTY__LEFT = eINSTANCE.getBinaryProperty_Left(); + + /** + * The meta object literal for the 'Right' containment reference feature. + * + * + * @generated + */ + EReference BINARY_PROPERTY__RIGHT = eINSTANCE.getBinaryProperty_Right(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl Many Reference Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyReferenceProperty() + * @generated + */ + EClass MANY_REFERENCE_PROPERTY = eINSTANCE.getManyReferenceProperty(); + + /** + * The meta object literal for the 'Property' containment reference feature. + * + * + * @generated + */ + EReference MANY_REFERENCE_PROPERTY__PROPERTY = eINSTANCE.getManyReferenceProperty_Property(); + + /** + * The meta object literal for the 'Quantifier' attribute feature. + * + * + * @generated + */ + EAttribute MANY_REFERENCE_PROPERTY__QUANTIFIER = eINSTANCE.getManyReferenceProperty_Quantifier(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl Single Reference Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getSingleReferenceProperty() + * @generated + */ + EClass SINGLE_REFERENCE_PROPERTY = eINSTANCE.getSingleReferenceProperty(); + + /** + * The meta object literal for the 'Property' containment reference feature. + * + * + * @generated + */ + EReference SINGLE_REFERENCE_PROPERTY__PROPERTY = eINSTANCE.getSingleReferenceProperty_Property(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl Container Reference Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getContainerReferenceProperty() + * @generated + */ + EClass CONTAINER_REFERENCE_PROPERTY = eINSTANCE.getContainerReferenceProperty(); + + /** + * The meta object literal for the 'Property' containment reference feature. + * + * + * @generated + */ + EReference CONTAINER_REFERENCE_PROPERTY__PROPERTY = eINSTANCE.getContainerReferenceProperty_Property(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl Many Boolean Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyBooleanAttributeProperty() + * @generated + */ + EClass MANY_BOOLEAN_ATTRIBUTE_PROPERTY = eINSTANCE.getManyBooleanAttributeProperty(); + + /** + * The meta object literal for the 'Quantifier' attribute feature. + * + * + * @generated + */ + EAttribute MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER = eINSTANCE.getManyBooleanAttributeProperty_Quantifier(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE = eINSTANCE.getManyBooleanAttributeProperty_Value(); + + /** + * The meta object literal for the 'Operator' attribute feature. + * + * + * @generated + */ + EAttribute MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR = eINSTANCE.getManyBooleanAttributeProperty_Operator(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl Many Integer Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyIntegerAttributeProperty() + * @generated + */ + EClass MANY_INTEGER_ATTRIBUTE_PROPERTY = eINSTANCE.getManyIntegerAttributeProperty(); + + /** + * The meta object literal for the 'Quantifier' attribute feature. + * + * + * @generated + */ + EAttribute MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER = eINSTANCE.getManyIntegerAttributeProperty_Quantifier(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE = eINSTANCE.getManyIntegerAttributeProperty_Value(); + + /** + * The meta object literal for the 'Operator' attribute feature. + * + * + * @generated + */ + EAttribute MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR = eINSTANCE.getManyIntegerAttributeProperty_Operator(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl Many String Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyStringAttributeProperty() + * @generated + */ + EClass MANY_STRING_ATTRIBUTE_PROPERTY = eINSTANCE.getManyStringAttributeProperty(); + + /** + * The meta object literal for the 'Quantifier' attribute feature. + * + * + * @generated + */ + EAttribute MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER = eINSTANCE.getManyStringAttributeProperty_Quantifier(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute MANY_STRING_ATTRIBUTE_PROPERTY__VALUE = eINSTANCE.getManyStringAttributeProperty_Value(); + + /** + * The meta object literal for the 'Operator' attribute feature. + * + * + * @generated + */ + EAttribute MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR = eINSTANCE.getManyStringAttributeProperty_Operator(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl Boolean Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanAttributeProperty() + * @generated + */ + EClass BOOLEAN_ATTRIBUTE_PROPERTY = eINSTANCE.getBooleanAttributeProperty(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute BOOLEAN_ATTRIBUTE_PROPERTY__VALUE = eINSTANCE.getBooleanAttributeProperty_Value(); + + /** + * The meta object literal for the 'Operator' attribute feature. + * + * + * @generated + */ + EAttribute BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR = eINSTANCE.getBooleanAttributeProperty_Operator(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl Integer Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getIntegerAttributeProperty() + * @generated + */ + EClass INTEGER_ATTRIBUTE_PROPERTY = eINSTANCE.getIntegerAttributeProperty(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute INTEGER_ATTRIBUTE_PROPERTY__VALUE = eINSTANCE.getIntegerAttributeProperty_Value(); + + /** + * The meta object literal for the 'Operator' attribute feature. + * + * + * @generated + */ + EAttribute INTEGER_ATTRIBUTE_PROPERTY__OPERATOR = eINSTANCE.getIntegerAttributeProperty_Operator(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl String Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStringAttributeProperty() + * @generated + */ + EClass STRING_ATTRIBUTE_PROPERTY = eINSTANCE.getStringAttributeProperty(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute STRING_ATTRIBUTE_PROPERTY__VALUE = eINSTANCE.getStringAttributeProperty_Value(); + + /** + * The meta object literal for the 'Operator' attribute feature. + * + * + * @generated + */ + EAttribute STRING_ATTRIBUTE_PROPERTY__OPERATOR = eINSTANCE.getStringAttributeProperty_Operator(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getOperator() + * @generated + */ + EEnum OPERATOR = eINSTANCE.getOperator(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.BooleanOperator + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanOperator() + * @generated + */ + EEnum BOOLEAN_OPERATOR = eINSTANCE.getBooleanOperator(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.Quantifier Quantifier}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getQuantifier() + * @generated + */ + EEnum QUANTIFIER = eINSTANCE.getQuantifier(); + + } + +} //PropertyPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Quantifier.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Quantifier.java new file mode 100644 index 000000000..3a24ef089 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Quantifier.java @@ -0,0 +1,214 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +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 'Quantifier', + * and utility methods for working with them. + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getQuantifier() + * @model + * @generated + */ +public enum Quantifier implements Enumerator { + /** + * The 'EXISTS' literal object. + * + * + * @see #EXISTS_VALUE + * @generated + * @ordered + */ + EXISTS(0, "EXISTS", "EXISTS"), + + /** + * The 'FORALL' literal object. + * + * + * @see #FORALL_VALUE + * @generated + * @ordered + */ + FORALL(1, "FORALL", "FORALL"); + + /** + * The 'EXISTS' literal value. + * + *

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

+ * + * @see #EXISTS + * @model + * @generated + * @ordered + */ + public static final int EXISTS_VALUE = 0; + + /** + * The 'FORALL' literal value. + * + *

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

+ * + * @see #FORALL + * @model + * @generated + * @ordered + */ + public static final int FORALL_VALUE = 1; + + /** + * An array of all the 'Quantifier' enumerators. + * + * + * @generated + */ + private static final Quantifier[] VALUES_ARRAY = + new Quantifier[] { + EXISTS, + FORALL, + }; + + /** + * A public read-only list of all the 'Quantifier' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Quantifier' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static Quantifier get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + Quantifier result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Quantifier' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static Quantifier getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + Quantifier result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Quantifier' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static Quantifier get(int value) { + switch (value) { + case EXISTS_VALUE: return EXISTS; + case FORALL_VALUE: return FORALL; + } + 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 Quantifier(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //Quantifier diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/SingleReferenceProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/SingleReferenceProperty.java new file mode 100644 index 000000000..0a1de206a --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/SingleReferenceProperty.java @@ -0,0 +1,49 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Single Reference Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.SingleReferenceProperty#getProperty Property}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getSingleReferenceProperty() + * @model abstract="true" + * @generated + */ +public interface SingleReferenceProperty

, T> extends ClassProperty { + /** + * Returns the value of the 'Property' containment reference. + * + *

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

+ * + * @return the value of the 'Property' containment reference. + * @see #setProperty(ClassProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getSingleReferenceProperty_Property() + * @model containment="true" + * @generated + */ + P getProperty(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.SingleReferenceProperty#getProperty Property}' containment reference. + * + * + * @param value the new value of the 'Property' containment reference. + * @see #getProperty() + * @generated + */ + void setProperty(P value); + +} // SingleReferenceProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java new file mode 100644 index 000000000..06e039406 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java @@ -0,0 +1,79 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'String Attribute Property'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty#getValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty#getOperator Operator}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStringAttributeProperty() + * @model abstract="true" + * @generated + */ +public interface StringAttributeProperty extends ClassProperty { + /** + * 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 fr.inria.diverse.event.commons.model.property.PropertyPackage#getStringAttributeProperty_Value() + * @model + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * + *

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

+ * + * @return the value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStringAttributeProperty_Operator() + * @model + * @generated + */ + Operator getOperator(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.Operator + * @see #getOperator() + * @generated + */ + void setOperator(Operator value); + +} // StringAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BinaryPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BinaryPropertyImpl.java new file mode 100644 index 000000000..a000d57f9 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BinaryPropertyImpl.java @@ -0,0 +1,322 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.BinaryProperty; +import fr.inria.diverse.event.commons.model.property.BooleanOperator; +import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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; + +/** + * + * An implementation of the model object 'Binary Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl#getOperator Operator}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl#getLeft Left}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl#getRight Right}
  • + *
+ * + * @generated + */ +public abstract class BinaryPropertyImpl

, T> extends ClassPropertyImpl implements BinaryProperty { + /** + * The default value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected static final BooleanOperator OPERATOR_EDEFAULT = BooleanOperator.AND; + + /** + * The cached value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected BooleanOperator operator = OPERATOR_EDEFAULT; + + /** + * The cached value of the '{@link #getLeft() Left}' containment reference. + * + * + * @see #getLeft() + * @generated + * @ordered + */ + protected P left; + + /** + * The cached value of the '{@link #getRight() Right}' containment reference. + * + * + * @see #getRight() + * @generated + * @ordered + */ + protected P right; + + /** + * + * + * @generated + */ + protected BinaryPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.BINARY_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public BooleanOperator getOperator() { + return operator; + } + + /** + * + * + * @generated + */ + public void setOperator(BooleanOperator newOperator) { + BooleanOperator oldOperator = operator; + operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.BINARY_PROPERTY__OPERATOR, oldOperator, operator)); + } + + /** + * + * + * @generated + */ + public P getLeft() { + return left; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLeft(P newLeft, NotificationChain msgs) { + P oldLeft = left; + left = newLeft; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.BINARY_PROPERTY__LEFT, oldLeft, newLeft); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setLeft(P newLeft) { + if (newLeft != left) { + NotificationChain msgs = null; + if (left != null) + msgs = ((InternalEObject)left).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.BINARY_PROPERTY__LEFT, null, msgs); + if (newLeft != null) + msgs = ((InternalEObject)newLeft).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.BINARY_PROPERTY__LEFT, null, msgs); + msgs = basicSetLeft(newLeft, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.BINARY_PROPERTY__LEFT, newLeft, newLeft)); + } + + /** + * + * + * @generated + */ + public P getRight() { + return right; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRight(P newRight, NotificationChain msgs) { + P oldRight = right; + right = newRight; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.BINARY_PROPERTY__RIGHT, oldRight, newRight); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setRight(P newRight) { + if (newRight != right) { + NotificationChain msgs = null; + if (right != null) + msgs = ((InternalEObject)right).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.BINARY_PROPERTY__RIGHT, null, msgs); + if (newRight != null) + msgs = ((InternalEObject)newRight).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.BINARY_PROPERTY__RIGHT, null, msgs); + msgs = basicSetRight(newRight, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.BINARY_PROPERTY__RIGHT, newRight, newRight)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.BINARY_PROPERTY__LEFT: + return basicSetLeft(null, msgs); + case PropertyPackage.BINARY_PROPERTY__RIGHT: + return basicSetRight(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.BINARY_PROPERTY__OPERATOR: + return getOperator(); + case PropertyPackage.BINARY_PROPERTY__LEFT: + return getLeft(); + case PropertyPackage.BINARY_PROPERTY__RIGHT: + return getRight(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.BINARY_PROPERTY__OPERATOR: + setOperator((BooleanOperator)newValue); + return; + case PropertyPackage.BINARY_PROPERTY__LEFT: + setLeft((P)newValue); + return; + case PropertyPackage.BINARY_PROPERTY__RIGHT: + setRight((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.BINARY_PROPERTY__OPERATOR: + setOperator(OPERATOR_EDEFAULT); + return; + case PropertyPackage.BINARY_PROPERTY__LEFT: + setLeft((P)null); + return; + case PropertyPackage.BINARY_PROPERTY__RIGHT: + setRight((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.BINARY_PROPERTY__OPERATOR: + return operator != OPERATOR_EDEFAULT; + case PropertyPackage.BINARY_PROPERTY__LEFT: + return left != null; + case PropertyPackage.BINARY_PROPERTY__RIGHT: + return right != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (operator: "); + result.append(operator); + result.append(')'); + return result.toString(); + } + +} //BinaryPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java new file mode 100644 index 000000000..b824e984e --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java @@ -0,0 +1,228 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty; +import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Boolean Attribute Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl#isValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl#getOperator Operator}
  • + *
+ * + * @generated + */ +public abstract class BooleanAttributePropertyImpl extends ClassPropertyImpl implements BooleanAttributeProperty { + /** + * The default value of the '{@link #isValue() Value}' attribute. + * + * + * @see #isValue() + * @generated + * @ordered + */ + protected static final boolean VALUE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isValue() Value}' attribute. + * + * + * @see #isValue() + * @generated + * @ordered + */ + protected boolean value = VALUE_EDEFAULT; + + /** + * The default value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + + /** + * The cached value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected Operator operator = OPERATOR_EDEFAULT; + + /** + * + * + * @generated + */ + protected BooleanAttributePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.BOOLEAN_ATTRIBUTE_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public boolean isValue() { + return value; + } + + /** + * + * + * @generated + */ + public void setValue(boolean newValue) { + boolean oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + public Operator getOperator() { + return operator; + } + + /** + * + * + * @generated + */ + public void setOperator(Operator newOperator) { + Operator oldOperator = operator; + operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + return isValue(); + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + return getOperator(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + setValue((Boolean)newValue); + return; + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator((Operator)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + setValue(VALUE_EDEFAULT); + return; + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator(OPERATOR_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + return value != VALUE_EDEFAULT; + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + return operator != OPERATOR_EDEFAULT; + } + 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(", operator: "); + result.append(operator); + result.append(')'); + return result.toString(); + } + +} //BooleanAttributePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ClassPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ClassPropertyImpl.java new file mode 100644 index 000000000..5a7507716 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ClassPropertyImpl.java @@ -0,0 +1,202 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Class Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl#getTarget Target}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl#getFeature Feature}
  • + *
+ * + * @generated + */ +public abstract class ClassPropertyImpl extends MinimalEObjectImpl.Container implements ClassProperty { + /** + * The cached value of the '{@link #getTarget() Target}' reference. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected T target; + + /** + * The cached value of the '{@link #getFeature() Feature}' reference. + * + * + * @see #getFeature() + * @generated + * @ordered + */ + protected EStructuralFeature feature; + + /** + * + * + * @generated + */ + protected ClassPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.CLASS_PROPERTY; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public T getTarget() { + if (target != null && ((EObject)target).eIsProxy()) { + InternalEObject oldTarget = (InternalEObject)target; + target = (T)eResolveProxy(oldTarget); + if (target != oldTarget) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertyPackage.CLASS_PROPERTY__TARGET, oldTarget, target)); + } + } + return target; + } + + /** + * + * + * @generated + */ + public T basicGetTarget() { + return target; + } + + /** + * + * + * @generated + */ + public void setTarget(T newTarget) { + T oldTarget = target; + target = newTarget; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.CLASS_PROPERTY__TARGET, oldTarget, target)); + } + + /** + * + * + * @generated + */ + public EStructuralFeature getFeature() { + if (feature != null && feature.eIsProxy()) { + InternalEObject oldFeature = (InternalEObject)feature; + feature = (EStructuralFeature)eResolveProxy(oldFeature); + if (feature != oldFeature) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertyPackage.CLASS_PROPERTY__FEATURE, oldFeature, feature)); + } + } + return feature; + } + + /** + * + * + * @generated + */ + public EStructuralFeature basicGetFeature() { + return feature; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.CLASS_PROPERTY__TARGET: + if (resolve) return getTarget(); + return basicGetTarget(); + case PropertyPackage.CLASS_PROPERTY__FEATURE: + if (resolve) return getFeature(); + return basicGetFeature(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.CLASS_PROPERTY__TARGET: + setTarget((T)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.CLASS_PROPERTY__TARGET: + setTarget((T)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.CLASS_PROPERTY__TARGET: + return target != null; + case PropertyPackage.CLASS_PROPERTY__FEATURE: + return feature != null; + } + return super.eIsSet(featureID); + } + +} //ClassPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ContainerReferencePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ContainerReferencePropertyImpl.java new file mode 100644 index 000000000..ee26d6bb4 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ContainerReferencePropertyImpl.java @@ -0,0 +1,187 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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; + +/** + * + * An implementation of the model object 'Container Reference Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl#getProperty Property}
  • + *
+ * + * @generated + */ +public class ContainerReferencePropertyImpl

, T> extends ClassPropertyImpl implements ContainerReferenceProperty { + /** + * The cached value of the '{@link #getProperty() Property}' containment reference. + * + * + * @see #getProperty() + * @generated + * @ordered + */ + protected P property; + + /** + * + * + * @generated + */ + protected ContainerReferencePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.CONTAINER_REFERENCE_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public P getProperty() { + return property; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProperty(P newProperty, NotificationChain msgs) { + P oldProperty = property; + property = newProperty; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY, oldProperty, newProperty); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setProperty(P newProperty) { + if (newProperty != property) { + NotificationChain msgs = null; + if (property != null) + msgs = ((InternalEObject)property).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY, null, msgs); + if (newProperty != null) + msgs = ((InternalEObject)newProperty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY, null, msgs); + msgs = basicSetProperty(newProperty, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY, newProperty, newProperty)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY: + return basicSetProperty(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY: + return getProperty(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY: + setProperty((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY: + setProperty((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.CONTAINER_REFERENCE_PROPERTY__PROPERTY: + return property != null; + } + return super.eIsSet(featureID); + } + +} //ContainerReferencePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java new file mode 100644 index 000000000..4e006ab67 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java @@ -0,0 +1,228 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty; +import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Integer Attribute Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl#getValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl#getOperator Operator}
  • + *
+ * + * @generated + */ +public abstract class IntegerAttributePropertyImpl extends ClassPropertyImpl implements IntegerAttributeProperty { + /** + * 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 default value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + + /** + * The cached value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected Operator operator = OPERATOR_EDEFAULT; + + /** + * + * + * @generated + */ + protected IntegerAttributePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.INTEGER_ATTRIBUTE_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public void setValue(int newValue) { + int oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + public Operator getOperator() { + return operator; + } + + /** + * + * + * @generated + */ + public void setOperator(Operator newOperator) { + Operator oldOperator = operator; + operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__VALUE: + return getValue(); + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + return getOperator(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__VALUE: + setValue((Integer)newValue); + return; + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator((Operator)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__VALUE: + setValue(VALUE_EDEFAULT); + return; + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator(OPERATOR_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__VALUE: + return value != VALUE_EDEFAULT; + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + return operator != OPERATOR_EDEFAULT; + } + 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(", operator: "); + result.append(operator); + result.append(')'); + return result.toString(); + } + +} //IntegerAttributePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java new file mode 100644 index 000000000..e2dd54e41 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java @@ -0,0 +1,282 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty; +import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.Quantifier; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Many Boolean Attribute Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl#getQuantifier Quantifier}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl#isValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl#getOperator Operator}
  • + *
+ * + * @generated + */ +public class ManyBooleanAttributePropertyImpl extends ClassPropertyImpl implements ManyBooleanAttributeProperty { + /** + * The default value of the '{@link #getQuantifier() Quantifier}' attribute. + * + * + * @see #getQuantifier() + * @generated + * @ordered + */ + protected static final Quantifier QUANTIFIER_EDEFAULT = Quantifier.EXISTS; + + /** + * The cached value of the '{@link #getQuantifier() Quantifier}' attribute. + * + * + * @see #getQuantifier() + * @generated + * @ordered + */ + protected Quantifier quantifier = QUANTIFIER_EDEFAULT; + + /** + * The default value of the '{@link #isValue() Value}' attribute. + * + * + * @see #isValue() + * @generated + * @ordered + */ + protected static final boolean VALUE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isValue() Value}' attribute. + * + * + * @see #isValue() + * @generated + * @ordered + */ + protected boolean value = VALUE_EDEFAULT; + + /** + * The default value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + + /** + * The cached value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected Operator operator = OPERATOR_EDEFAULT; + + /** + * + * + * @generated + */ + protected ManyBooleanAttributePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.MANY_BOOLEAN_ATTRIBUTE_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public Quantifier getQuantifier() { + return quantifier; + } + + /** + * + * + * @generated + */ + public void setQuantifier(Quantifier newQuantifier) { + Quantifier oldQuantifier = quantifier; + quantifier = newQuantifier == null ? QUANTIFIER_EDEFAULT : newQuantifier; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER, oldQuantifier, quantifier)); + } + + /** + * + * + * @generated + */ + public boolean isValue() { + return value; + } + + /** + * + * + * @generated + */ + public void setValue(boolean newValue) { + boolean oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + public Operator getOperator() { + return operator; + } + + /** + * + * + * @generated + */ + public void setOperator(Operator newOperator) { + Operator oldOperator = operator; + operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER: + return getQuantifier(); + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + return isValue(); + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + return getOperator(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER: + setQuantifier((Quantifier)newValue); + return; + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + setValue((Boolean)newValue); + return; + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator((Operator)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER: + setQuantifier(QUANTIFIER_EDEFAULT); + return; + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + setValue(VALUE_EDEFAULT); + return; + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator(OPERATOR_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER: + return quantifier != QUANTIFIER_EDEFAULT; + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE: + return value != VALUE_EDEFAULT; + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: + return operator != OPERATOR_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (quantifier: "); + result.append(quantifier); + result.append(", value: "); + result.append(value); + result.append(", operator: "); + result.append(operator); + result.append(')'); + return result.toString(); + } + +} //ManyBooleanAttributePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java new file mode 100644 index 000000000..43073b134 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java @@ -0,0 +1,282 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty; +import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.Quantifier; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Many Integer Attribute Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl#getQuantifier Quantifier}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl#getValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl#getOperator Operator}
  • + *
+ * + * @generated + */ +public class ManyIntegerAttributePropertyImpl extends ClassPropertyImpl implements ManyIntegerAttributeProperty { + /** + * The default value of the '{@link #getQuantifier() Quantifier}' attribute. + * + * + * @see #getQuantifier() + * @generated + * @ordered + */ + protected static final Quantifier QUANTIFIER_EDEFAULT = Quantifier.EXISTS; + + /** + * The cached value of the '{@link #getQuantifier() Quantifier}' attribute. + * + * + * @see #getQuantifier() + * @generated + * @ordered + */ + protected Quantifier quantifier = QUANTIFIER_EDEFAULT; + + /** + * 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 default value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + + /** + * The cached value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected Operator operator = OPERATOR_EDEFAULT; + + /** + * + * + * @generated + */ + protected ManyIntegerAttributePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.MANY_INTEGER_ATTRIBUTE_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public Quantifier getQuantifier() { + return quantifier; + } + + /** + * + * + * @generated + */ + public void setQuantifier(Quantifier newQuantifier) { + Quantifier oldQuantifier = quantifier; + quantifier = newQuantifier == null ? QUANTIFIER_EDEFAULT : newQuantifier; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER, oldQuantifier, quantifier)); + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public void setValue(int newValue) { + int oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + public Operator getOperator() { + return operator; + } + + /** + * + * + * @generated + */ + public void setOperator(Operator newOperator) { + Operator oldOperator = operator; + operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER: + return getQuantifier(); + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE: + return getValue(); + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + return getOperator(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER: + setQuantifier((Quantifier)newValue); + return; + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE: + setValue((Integer)newValue); + return; + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator((Operator)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER: + setQuantifier(QUANTIFIER_EDEFAULT); + return; + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE: + setValue(VALUE_EDEFAULT); + return; + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator(OPERATOR_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER: + return quantifier != QUANTIFIER_EDEFAULT; + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE: + return value != VALUE_EDEFAULT; + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: + return operator != OPERATOR_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (quantifier: "); + result.append(quantifier); + result.append(", value: "); + result.append(value); + result.append(", operator: "); + result.append(operator); + result.append(')'); + return result.toString(); + } + +} //ManyIntegerAttributePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyReferencePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyReferencePropertyImpl.java new file mode 100644 index 000000000..805348f34 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyReferencePropertyImpl.java @@ -0,0 +1,256 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.ManyReferenceProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.Quantifier; + +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; + +/** + * + * An implementation of the model object 'Many Reference Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl#getProperty Property}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl#getQuantifier Quantifier}
  • + *
+ * + * @generated + */ +public abstract class ManyReferencePropertyImpl

, T> extends ClassPropertyImpl implements ManyReferenceProperty { + /** + * The cached value of the '{@link #getProperty() Property}' containment reference. + * + * + * @see #getProperty() + * @generated + * @ordered + */ + protected P property; + + /** + * The default value of the '{@link #getQuantifier() Quantifier}' attribute. + * + * + * @see #getQuantifier() + * @generated + * @ordered + */ + protected static final Quantifier QUANTIFIER_EDEFAULT = Quantifier.EXISTS; + + /** + * The cached value of the '{@link #getQuantifier() Quantifier}' attribute. + * + * + * @see #getQuantifier() + * @generated + * @ordered + */ + protected Quantifier quantifier = QUANTIFIER_EDEFAULT; + + /** + * + * + * @generated + */ + protected ManyReferencePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.MANY_REFERENCE_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public P getProperty() { + return property; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProperty(P newProperty, NotificationChain msgs) { + P oldProperty = property; + property = newProperty; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY, oldProperty, newProperty); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setProperty(P newProperty) { + if (newProperty != property) { + NotificationChain msgs = null; + if (property != null) + msgs = ((InternalEObject)property).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY, null, msgs); + if (newProperty != null) + msgs = ((InternalEObject)newProperty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY, null, msgs); + msgs = basicSetProperty(newProperty, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY, newProperty, newProperty)); + } + + /** + * + * + * @generated + */ + public Quantifier getQuantifier() { + return quantifier; + } + + /** + * + * + * @generated + */ + public void setQuantifier(Quantifier newQuantifier) { + Quantifier oldQuantifier = quantifier; + quantifier = newQuantifier == null ? QUANTIFIER_EDEFAULT : newQuantifier; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_REFERENCE_PROPERTY__QUANTIFIER, oldQuantifier, quantifier)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY: + return basicSetProperty(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY: + return getProperty(); + case PropertyPackage.MANY_REFERENCE_PROPERTY__QUANTIFIER: + return getQuantifier(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY: + setProperty((P)newValue); + return; + case PropertyPackage.MANY_REFERENCE_PROPERTY__QUANTIFIER: + setQuantifier((Quantifier)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY: + setProperty((P)null); + return; + case PropertyPackage.MANY_REFERENCE_PROPERTY__QUANTIFIER: + setQuantifier(QUANTIFIER_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.MANY_REFERENCE_PROPERTY__PROPERTY: + return property != null; + case PropertyPackage.MANY_REFERENCE_PROPERTY__QUANTIFIER: + return quantifier != QUANTIFIER_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (quantifier: "); + result.append(quantifier); + result.append(')'); + return result.toString(); + } + +} //ManyReferencePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java new file mode 100644 index 000000000..323447880 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java @@ -0,0 +1,282 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty; +import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.Quantifier; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Many String Attribute Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl#getQuantifier Quantifier}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl#getValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl#getOperator Operator}
  • + *
+ * + * @generated + */ +public class ManyStringAttributePropertyImpl extends ClassPropertyImpl implements ManyStringAttributeProperty { + /** + * The default value of the '{@link #getQuantifier() Quantifier}' attribute. + * + * + * @see #getQuantifier() + * @generated + * @ordered + */ + protected static final Quantifier QUANTIFIER_EDEFAULT = Quantifier.EXISTS; + + /** + * The cached value of the '{@link #getQuantifier() Quantifier}' attribute. + * + * + * @see #getQuantifier() + * @generated + * @ordered + */ + protected Quantifier quantifier = QUANTIFIER_EDEFAULT; + + /** + * 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 #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + + /** + * The cached value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected Operator operator = OPERATOR_EDEFAULT; + + /** + * + * + * @generated + */ + protected ManyStringAttributePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.MANY_STRING_ATTRIBUTE_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public Quantifier getQuantifier() { + return quantifier; + } + + /** + * + * + * @generated + */ + public void setQuantifier(Quantifier newQuantifier) { + Quantifier oldQuantifier = quantifier; + quantifier = newQuantifier == null ? QUANTIFIER_EDEFAULT : newQuantifier; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER, oldQuantifier, quantifier)); + } + + /** + * + * + * @generated + */ + public String getValue() { + return value; + } + + /** + * + * + * @generated + */ + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + public Operator getOperator() { + return operator; + } + + /** + * + * + * @generated + */ + public void setOperator(Operator newOperator) { + Operator oldOperator = operator; + operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER: + return getQuantifier(); + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__VALUE: + return getValue(); + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR: + return getOperator(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER: + setQuantifier((Quantifier)newValue); + return; + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__VALUE: + setValue((String)newValue); + return; + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator((Operator)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER: + setQuantifier(QUANTIFIER_EDEFAULT); + return; + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__VALUE: + setValue(VALUE_EDEFAULT); + return; + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator(OPERATOR_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER: + return quantifier != QUANTIFIER_EDEFAULT; + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR: + return operator != OPERATOR_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (quantifier: "); + result.append(quantifier); + result.append(", value: "); + result.append(value); + result.append(", operator: "); + result.append(operator); + result.append(')'); + return result.toString(); + } + +} //ManyStringAttributePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java new file mode 100644 index 000000000..41ebc4042 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java @@ -0,0 +1,227 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.*; + +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; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class PropertyFactoryImpl extends EFactoryImpl implements PropertyFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static PropertyFactory init() { + try { + PropertyFactory thePropertyFactory = (PropertyFactory)EPackage.Registry.INSTANCE.getEFactory(PropertyPackage.eNS_URI); + if (thePropertyFactory != null) { + return thePropertyFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new PropertyFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public PropertyFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case PropertyPackage.CONTAINER_REFERENCE_PROPERTY: return createContainerReferenceProperty(); + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY: return createManyBooleanAttributeProperty(); + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY: return createManyIntegerAttributeProperty(); + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY: return createManyStringAttributeProperty(); + 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 PropertyPackage.OPERATOR: + return createOperatorFromString(eDataType, initialValue); + case PropertyPackage.BOOLEAN_OPERATOR: + return createBooleanOperatorFromString(eDataType, initialValue); + case PropertyPackage.QUANTIFIER: + return createQuantifierFromString(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 PropertyPackage.OPERATOR: + return convertOperatorToString(eDataType, instanceValue); + case PropertyPackage.BOOLEAN_OPERATOR: + return convertBooleanOperatorToString(eDataType, instanceValue); + case PropertyPackage.QUANTIFIER: + return convertQuantifierToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public

, T> ContainerReferenceProperty createContainerReferenceProperty() { + ContainerReferencePropertyImpl containerReferenceProperty = new ContainerReferencePropertyImpl(); + return containerReferenceProperty; + } + + /** + * + * + * @generated + */ + public ManyBooleanAttributeProperty createManyBooleanAttributeProperty() { + ManyBooleanAttributePropertyImpl manyBooleanAttributeProperty = new ManyBooleanAttributePropertyImpl(); + return manyBooleanAttributeProperty; + } + + /** + * + * + * @generated + */ + public ManyIntegerAttributeProperty createManyIntegerAttributeProperty() { + ManyIntegerAttributePropertyImpl manyIntegerAttributeProperty = new ManyIntegerAttributePropertyImpl(); + return manyIntegerAttributeProperty; + } + + /** + * + * + * @generated + */ + public ManyStringAttributeProperty createManyStringAttributeProperty() { + ManyStringAttributePropertyImpl manyStringAttributeProperty = new ManyStringAttributePropertyImpl(); + return manyStringAttributeProperty; + } + + /** + * + * + * @generated + */ + public Operator createOperatorFromString(EDataType eDataType, String initialValue) { + Operator result = Operator.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertOperatorToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public BooleanOperator createBooleanOperatorFromString(EDataType eDataType, String initialValue) { + BooleanOperator result = BooleanOperator.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertBooleanOperatorToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public Quantifier createQuantifierFromString(EDataType eDataType, String initialValue) { + Quantifier result = Quantifier.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertQuantifierToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public PropertyPackage getPropertyPackage() { + return (PropertyPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static PropertyPackage getPackage() { + return PropertyPackage.eINSTANCE; + } + +} //PropertyFactoryImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java new file mode 100644 index 000000000..97a7f78aa --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java @@ -0,0 +1,797 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.BinaryProperty; +import fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty; +import fr.inria.diverse.event.commons.model.property.BooleanOperator; +import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty; +import fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty; +import fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty; +import fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty; +import fr.inria.diverse.event.commons.model.property.ManyReferenceProperty; +import fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty; +import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.Quantifier; +import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty; +import fr.inria.diverse.event.commons.model.property.StringAttributeProperty; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.ETypeParameter; +import org.eclipse.emf.ecore.EcorePackage; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage { + /** + * + * + * @generated + */ + private EClass classPropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass binaryPropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass manyReferencePropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass singleReferencePropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass containerReferencePropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass manyBooleanAttributePropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass manyIntegerAttributePropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass manyStringAttributePropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass booleanAttributePropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass integerAttributePropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass stringAttributePropertyEClass = null; + + /** + * + * + * @generated + */ + private EEnum operatorEEnum = null; + + /** + * + * + * @generated + */ + private EEnum booleanOperatorEEnum = null; + + /** + * + * + * @generated + */ + private EEnum quantifierEEnum = 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 fr.inria.diverse.event.commons.model.property.PropertyPackage#eNS_URI + * @see #init() + * @generated + */ + private PropertyPackageImpl() { + super(eNS_URI, PropertyFactory.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 PropertyPackage#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 PropertyPackage init() { + if (isInited) return (PropertyPackage)EPackage.Registry.INSTANCE.getEPackage(PropertyPackage.eNS_URI); + + // Obtain or create and register package + PropertyPackageImpl thePropertyPackage = (PropertyPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PropertyPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PropertyPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + EcorePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + thePropertyPackage.createPackageContents(); + + // Initialize created meta-data + thePropertyPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + thePropertyPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(PropertyPackage.eNS_URI, thePropertyPackage); + return thePropertyPackage; + } + + /** + * + * + * @generated + */ + public EClass getClassProperty() { + return classPropertyEClass; + } + + /** + * + * + * @generated + */ + public EReference getClassProperty_Target() { + return (EReference)classPropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getClassProperty_Feature() { + return (EReference)classPropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getBinaryProperty() { + return binaryPropertyEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getBinaryProperty_Operator() { + return (EAttribute)binaryPropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getBinaryProperty_Left() { + return (EReference)binaryPropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getBinaryProperty_Right() { + return (EReference)binaryPropertyEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getManyReferenceProperty() { + return manyReferencePropertyEClass; + } + + /** + * + * + * @generated + */ + public EReference getManyReferenceProperty_Property() { + return (EReference)manyReferencePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getManyReferenceProperty_Quantifier() { + return (EAttribute)manyReferencePropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getSingleReferenceProperty() { + return singleReferencePropertyEClass; + } + + /** + * + * + * @generated + */ + public EReference getSingleReferenceProperty_Property() { + return (EReference)singleReferencePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getContainerReferenceProperty() { + return containerReferencePropertyEClass; + } + + /** + * + * + * @generated + */ + public EReference getContainerReferenceProperty_Property() { + return (EReference)containerReferencePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getManyBooleanAttributeProperty() { + return manyBooleanAttributePropertyEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getManyBooleanAttributeProperty_Quantifier() { + return (EAttribute)manyBooleanAttributePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getManyBooleanAttributeProperty_Value() { + return (EAttribute)manyBooleanAttributePropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getManyBooleanAttributeProperty_Operator() { + return (EAttribute)manyBooleanAttributePropertyEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getManyIntegerAttributeProperty() { + return manyIntegerAttributePropertyEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getManyIntegerAttributeProperty_Quantifier() { + return (EAttribute)manyIntegerAttributePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getManyIntegerAttributeProperty_Value() { + return (EAttribute)manyIntegerAttributePropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getManyIntegerAttributeProperty_Operator() { + return (EAttribute)manyIntegerAttributePropertyEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getManyStringAttributeProperty() { + return manyStringAttributePropertyEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getManyStringAttributeProperty_Quantifier() { + return (EAttribute)manyStringAttributePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getManyStringAttributeProperty_Value() { + return (EAttribute)manyStringAttributePropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getManyStringAttributeProperty_Operator() { + return (EAttribute)manyStringAttributePropertyEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getBooleanAttributeProperty() { + return booleanAttributePropertyEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getBooleanAttributeProperty_Value() { + return (EAttribute)booleanAttributePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getBooleanAttributeProperty_Operator() { + return (EAttribute)booleanAttributePropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getIntegerAttributeProperty() { + return integerAttributePropertyEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getIntegerAttributeProperty_Value() { + return (EAttribute)integerAttributePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getIntegerAttributeProperty_Operator() { + return (EAttribute)integerAttributePropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getStringAttributeProperty() { + return stringAttributePropertyEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getStringAttributeProperty_Value() { + return (EAttribute)stringAttributePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getStringAttributeProperty_Operator() { + return (EAttribute)stringAttributePropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EEnum getOperator() { + return operatorEEnum; + } + + /** + * + * + * @generated + */ + public EEnum getBooleanOperator() { + return booleanOperatorEEnum; + } + + /** + * + * + * @generated + */ + public EEnum getQuantifier() { + return quantifierEEnum; + } + + /** + * + * + * @generated + */ + public PropertyFactory getPropertyFactory() { + return (PropertyFactory)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 + classPropertyEClass = createEClass(CLASS_PROPERTY); + createEReference(classPropertyEClass, CLASS_PROPERTY__TARGET); + createEReference(classPropertyEClass, CLASS_PROPERTY__FEATURE); + + binaryPropertyEClass = createEClass(BINARY_PROPERTY); + createEAttribute(binaryPropertyEClass, BINARY_PROPERTY__OPERATOR); + createEReference(binaryPropertyEClass, BINARY_PROPERTY__LEFT); + createEReference(binaryPropertyEClass, BINARY_PROPERTY__RIGHT); + + manyReferencePropertyEClass = createEClass(MANY_REFERENCE_PROPERTY); + createEReference(manyReferencePropertyEClass, MANY_REFERENCE_PROPERTY__PROPERTY); + createEAttribute(manyReferencePropertyEClass, MANY_REFERENCE_PROPERTY__QUANTIFIER); + + singleReferencePropertyEClass = createEClass(SINGLE_REFERENCE_PROPERTY); + createEReference(singleReferencePropertyEClass, SINGLE_REFERENCE_PROPERTY__PROPERTY); + + containerReferencePropertyEClass = createEClass(CONTAINER_REFERENCE_PROPERTY); + createEReference(containerReferencePropertyEClass, CONTAINER_REFERENCE_PROPERTY__PROPERTY); + + manyBooleanAttributePropertyEClass = createEClass(MANY_BOOLEAN_ATTRIBUTE_PROPERTY); + createEAttribute(manyBooleanAttributePropertyEClass, MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER); + createEAttribute(manyBooleanAttributePropertyEClass, MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE); + createEAttribute(manyBooleanAttributePropertyEClass, MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR); + + manyIntegerAttributePropertyEClass = createEClass(MANY_INTEGER_ATTRIBUTE_PROPERTY); + createEAttribute(manyIntegerAttributePropertyEClass, MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER); + createEAttribute(manyIntegerAttributePropertyEClass, MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE); + createEAttribute(manyIntegerAttributePropertyEClass, MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR); + + manyStringAttributePropertyEClass = createEClass(MANY_STRING_ATTRIBUTE_PROPERTY); + createEAttribute(manyStringAttributePropertyEClass, MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER); + createEAttribute(manyStringAttributePropertyEClass, MANY_STRING_ATTRIBUTE_PROPERTY__VALUE); + createEAttribute(manyStringAttributePropertyEClass, MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR); + + booleanAttributePropertyEClass = createEClass(BOOLEAN_ATTRIBUTE_PROPERTY); + createEAttribute(booleanAttributePropertyEClass, BOOLEAN_ATTRIBUTE_PROPERTY__VALUE); + createEAttribute(booleanAttributePropertyEClass, BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR); + + integerAttributePropertyEClass = createEClass(INTEGER_ATTRIBUTE_PROPERTY); + createEAttribute(integerAttributePropertyEClass, INTEGER_ATTRIBUTE_PROPERTY__VALUE); + createEAttribute(integerAttributePropertyEClass, INTEGER_ATTRIBUTE_PROPERTY__OPERATOR); + + stringAttributePropertyEClass = createEClass(STRING_ATTRIBUTE_PROPERTY); + createEAttribute(stringAttributePropertyEClass, STRING_ATTRIBUTE_PROPERTY__VALUE); + createEAttribute(stringAttributePropertyEClass, STRING_ATTRIBUTE_PROPERTY__OPERATOR); + + // Create enums + operatorEEnum = createEEnum(OPERATOR); + booleanOperatorEEnum = createEEnum(BOOLEAN_OPERATOR); + quantifierEEnum = createEEnum(QUANTIFIER); + } + + /** + * + * + * @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 + ETypeParameter classPropertyEClass_T = addETypeParameter(classPropertyEClass, "T"); + ETypeParameter binaryPropertyEClass_P = addETypeParameter(binaryPropertyEClass, "P"); + ETypeParameter binaryPropertyEClass_T = addETypeParameter(binaryPropertyEClass, "T"); + ETypeParameter manyReferencePropertyEClass_P = addETypeParameter(manyReferencePropertyEClass, "P"); + ETypeParameter manyReferencePropertyEClass_T = addETypeParameter(manyReferencePropertyEClass, "T"); + ETypeParameter singleReferencePropertyEClass_P = addETypeParameter(singleReferencePropertyEClass, "P"); + ETypeParameter singleReferencePropertyEClass_T = addETypeParameter(singleReferencePropertyEClass, "T"); + ETypeParameter containerReferencePropertyEClass_P = addETypeParameter(containerReferencePropertyEClass, "P"); + ETypeParameter containerReferencePropertyEClass_T = addETypeParameter(containerReferencePropertyEClass, "T"); + ETypeParameter manyBooleanAttributePropertyEClass_T = addETypeParameter(manyBooleanAttributePropertyEClass, "T"); + ETypeParameter manyIntegerAttributePropertyEClass_T = addETypeParameter(manyIntegerAttributePropertyEClass, "T"); + ETypeParameter manyStringAttributePropertyEClass_T = addETypeParameter(manyStringAttributePropertyEClass, "T"); + ETypeParameter booleanAttributePropertyEClass_T = addETypeParameter(booleanAttributePropertyEClass, "T"); + ETypeParameter integerAttributePropertyEClass_T = addETypeParameter(integerAttributePropertyEClass, "T"); + ETypeParameter stringAttributePropertyEClass_T = addETypeParameter(stringAttributePropertyEClass, "T"); + + // Set bounds for type parameters + EGenericType g1 = createEGenericType(this.getClassProperty()); + EGenericType g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + binaryPropertyEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + manyReferencePropertyEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + singleReferencePropertyEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + containerReferencePropertyEClass_P.getEBounds().add(g1); + + // Add supertypes to classes + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(binaryPropertyEClass_T); + g1.getETypeArguments().add(g2); + binaryPropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(manyReferencePropertyEClass_T); + g1.getETypeArguments().add(g2); + manyReferencePropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(singleReferencePropertyEClass_T); + g1.getETypeArguments().add(g2); + singleReferencePropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(containerReferencePropertyEClass_T); + g1.getETypeArguments().add(g2); + containerReferencePropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(manyBooleanAttributePropertyEClass_T); + g1.getETypeArguments().add(g2); + manyBooleanAttributePropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(manyIntegerAttributePropertyEClass_T); + g1.getETypeArguments().add(g2); + manyIntegerAttributePropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(manyStringAttributePropertyEClass_T); + g1.getETypeArguments().add(g2); + manyStringAttributePropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(booleanAttributePropertyEClass_T); + g1.getETypeArguments().add(g2); + booleanAttributePropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(integerAttributePropertyEClass_T); + g1.getETypeArguments().add(g2); + integerAttributePropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getClassProperty()); + g2 = createEGenericType(stringAttributePropertyEClass_T); + g1.getETypeArguments().add(g2); + stringAttributePropertyEClass.getEGenericSuperTypes().add(g1); + + // Initialize classes, features, and operations; add parameters + initEClass(classPropertyEClass, ClassProperty.class, "ClassProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(classPropertyEClass_T); + initEReference(getClassProperty_Target(), g1, null, "target", null, 0, 1, ClassProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getClassProperty_Feature(), theEcorePackage.getEStructuralFeature(), null, "feature", null, 0, 1, ClassProperty.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(binaryPropertyEClass, BinaryProperty.class, "BinaryProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBinaryProperty_Operator(), this.getBooleanOperator(), "operator", null, 1, 1, BinaryProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(binaryPropertyEClass_P); + initEReference(getBinaryProperty_Left(), g1, null, "left", null, 1, 1, BinaryProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(binaryPropertyEClass_P); + initEReference(getBinaryProperty_Right(), g1, null, "right", null, 1, 1, BinaryProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(manyReferencePropertyEClass, ManyReferenceProperty.class, "ManyReferenceProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(manyReferencePropertyEClass_P); + initEReference(getManyReferenceProperty_Property(), g1, null, "property", null, 1, 1, ManyReferenceProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyReferenceProperty_Quantifier(), this.getQuantifier(), "quantifier", null, 0, 1, ManyReferenceProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(singleReferencePropertyEClass, SingleReferenceProperty.class, "SingleReferenceProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(singleReferencePropertyEClass_P); + initEReference(getSingleReferenceProperty_Property(), g1, null, "property", null, 0, 1, SingleReferenceProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(containerReferencePropertyEClass, ContainerReferenceProperty.class, "ContainerReferenceProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(containerReferencePropertyEClass_P); + initEReference(getContainerReferenceProperty_Property(), g1, null, "property", null, 0, 1, ContainerReferenceProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(manyBooleanAttributePropertyEClass, ManyBooleanAttributeProperty.class, "ManyBooleanAttributeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getManyBooleanAttributeProperty_Quantifier(), this.getQuantifier(), "quantifier", null, 0, 1, ManyBooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyBooleanAttributeProperty_Value(), theEcorePackage.getEBoolean(), "value", null, 0, 1, ManyBooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyBooleanAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, ManyBooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(manyIntegerAttributePropertyEClass, ManyIntegerAttributeProperty.class, "ManyIntegerAttributeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getManyIntegerAttributeProperty_Quantifier(), this.getQuantifier(), "quantifier", null, 0, 1, ManyIntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyIntegerAttributeProperty_Value(), theEcorePackage.getEInt(), "value", null, 0, 1, ManyIntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyIntegerAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, ManyIntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(manyStringAttributePropertyEClass, ManyStringAttributeProperty.class, "ManyStringAttributeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getManyStringAttributeProperty_Quantifier(), this.getQuantifier(), "quantifier", null, 0, 1, ManyStringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyStringAttributeProperty_Value(), theEcorePackage.getEString(), "value", null, 0, 1, ManyStringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyStringAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, ManyStringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(booleanAttributePropertyEClass, BooleanAttributeProperty.class, "BooleanAttributeProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBooleanAttributeProperty_Value(), theEcorePackage.getEBoolean(), "value", null, 0, 1, BooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getBooleanAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, BooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(integerAttributePropertyEClass, IntegerAttributeProperty.class, "IntegerAttributeProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getIntegerAttributeProperty_Value(), theEcorePackage.getEInt(), "value", null, 0, 1, IntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getIntegerAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, IntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(stringAttributePropertyEClass, StringAttributeProperty.class, "StringAttributeProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getStringAttributeProperty_Value(), theEcorePackage.getEString(), "value", null, 0, 1, StringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getStringAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, StringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(operatorEEnum, Operator.class, "Operator"); + addEEnumLiteral(operatorEEnum, Operator.EQUAL); + + initEEnum(booleanOperatorEEnum, BooleanOperator.class, "BooleanOperator"); + addEEnumLiteral(booleanOperatorEEnum, BooleanOperator.AND); + addEEnumLiteral(booleanOperatorEEnum, BooleanOperator.OR); + addEEnumLiteral(booleanOperatorEEnum, BooleanOperator.IMPLIES); + + initEEnum(quantifierEEnum, Quantifier.class, "Quantifier"); + addEEnumLiteral(quantifierEEnum, Quantifier.EXISTS); + addEEnumLiteral(quantifierEEnum, Quantifier.FORALL); + + // Create resource + createResource(eNS_URI); + } + +} //PropertyPackageImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/SingleReferencePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/SingleReferencePropertyImpl.java new file mode 100644 index 000000000..a1c80211b --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/SingleReferencePropertyImpl.java @@ -0,0 +1,187 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty; + +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; + +/** + * + * An implementation of the model object 'Single Reference Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl#getProperty Property}
  • + *
+ * + * @generated + */ +public abstract class SingleReferencePropertyImpl

, T> extends ClassPropertyImpl implements SingleReferenceProperty { + /** + * The cached value of the '{@link #getProperty() Property}' containment reference. + * + * + * @see #getProperty() + * @generated + * @ordered + */ + protected P property; + + /** + * + * + * @generated + */ + protected SingleReferencePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.SINGLE_REFERENCE_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public P getProperty() { + return property; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProperty(P newProperty, NotificationChain msgs) { + P oldProperty = property; + property = newProperty; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY, oldProperty, newProperty); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setProperty(P newProperty) { + if (newProperty != property) { + NotificationChain msgs = null; + if (property != null) + msgs = ((InternalEObject)property).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY, null, msgs); + if (newProperty != null) + msgs = ((InternalEObject)newProperty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY, null, msgs); + msgs = basicSetProperty(newProperty, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY, newProperty, newProperty)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY: + return basicSetProperty(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY: + return getProperty(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY: + setProperty((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY: + setProperty((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.SINGLE_REFERENCE_PROPERTY__PROPERTY: + return property != null; + } + return super.eIsSet(featureID); + } + +} //SingleReferencePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java new file mode 100644 index 000000000..8a4de2749 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java @@ -0,0 +1,228 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.StringAttributeProperty; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'String Attribute Property'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl#getValue Value}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl#getOperator Operator}
  • + *
+ * + * @generated + */ +public abstract class StringAttributePropertyImpl extends ClassPropertyImpl implements StringAttributeProperty { + /** + * 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 #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + + /** + * The cached value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected Operator operator = OPERATOR_EDEFAULT; + + /** + * + * + * @generated + */ + protected StringAttributePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.STRING_ATTRIBUTE_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public String getValue() { + return value; + } + + /** + * + * + * @generated + */ + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.STRING_ATTRIBUTE_PROPERTY__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + public Operator getOperator() { + return operator; + } + + /** + * + * + * @generated + */ + public void setOperator(Operator newOperator) { + Operator oldOperator = operator; + operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.STRING_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__VALUE: + return getValue(); + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__OPERATOR: + return getOperator(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__VALUE: + setValue((String)newValue); + return; + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator((Operator)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__VALUE: + setValue(VALUE_EDEFAULT); + return; + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__OPERATOR: + setOperator(OPERATOR_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__OPERATOR: + return operator != OPERATOR_EDEFAULT; + } + 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(", operator: "); + result.append(operator); + result.append(')'); + return result.toString(); + } + +} //StringAttributePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java new file mode 100644 index 000000000..8f34511f6 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java @@ -0,0 +1,300 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.util; + +import fr.inria.diverse.event.commons.model.property.*; + +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; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage + * @generated + */ +public class PropertyAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static PropertyPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public PropertyAdapterFactory() { + if (modelPackage == null) { + modelPackage = PropertyPackage.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 PropertySwitch modelSwitch = + new PropertySwitch() { + @Override + public Adapter caseClassProperty(ClassProperty object) { + return createClassPropertyAdapter(); + } + @Override + public

, T> Adapter caseBinaryProperty(BinaryProperty object) { + return createBinaryPropertyAdapter(); + } + @Override + public

, T> Adapter caseManyReferenceProperty(ManyReferenceProperty object) { + return createManyReferencePropertyAdapter(); + } + @Override + public

, T> Adapter caseSingleReferenceProperty(SingleReferenceProperty object) { + return createSingleReferencePropertyAdapter(); + } + @Override + public

, T> Adapter caseContainerReferenceProperty(ContainerReferenceProperty object) { + return createContainerReferencePropertyAdapter(); + } + @Override + public Adapter caseManyBooleanAttributeProperty(ManyBooleanAttributeProperty object) { + return createManyBooleanAttributePropertyAdapter(); + } + @Override + public Adapter caseManyIntegerAttributeProperty(ManyIntegerAttributeProperty object) { + return createManyIntegerAttributePropertyAdapter(); + } + @Override + public Adapter caseManyStringAttributeProperty(ManyStringAttributeProperty object) { + return createManyStringAttributePropertyAdapter(); + } + @Override + public Adapter caseBooleanAttributeProperty(BooleanAttributeProperty object) { + return createBooleanAttributePropertyAdapter(); + } + @Override + public Adapter caseIntegerAttributeProperty(IntegerAttributeProperty object) { + return createIntegerAttributePropertyAdapter(); + } + @Override + public Adapter caseStringAttributeProperty(StringAttributeProperty object) { + return createStringAttributePropertyAdapter(); + } + @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 fr.inria.diverse.event.commons.model.property.ClassProperty Class 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 fr.inria.diverse.event.commons.model.property.ClassProperty + * @generated + */ + public Adapter createClassPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty Binary 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 fr.inria.diverse.event.commons.model.property.BinaryProperty + * @generated + */ + public Adapter createBinaryPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.ManyReferenceProperty Many Reference 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 fr.inria.diverse.event.commons.model.property.ManyReferenceProperty + * @generated + */ + public Adapter createManyReferencePropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.SingleReferenceProperty Single Reference 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 fr.inria.diverse.event.commons.model.property.SingleReferenceProperty + * @generated + */ + public Adapter createSingleReferencePropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty Container Reference 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 fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty + * @generated + */ + public Adapter createContainerReferencePropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty Many Boolean Attribute 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 fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty + * @generated + */ + public Adapter createManyBooleanAttributePropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty Many Integer Attribute 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 fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty + * @generated + */ + public Adapter createManyIntegerAttributePropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty Many String Attribute 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 fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty + * @generated + */ + public Adapter createManyStringAttributePropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty Boolean Attribute 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 fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty + * @generated + */ + public Adapter createBooleanAttributePropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty Integer Attribute 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 fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty + * @generated + */ + public Adapter createIntegerAttributePropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty String Attribute 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 fr.inria.diverse.event.commons.model.property.StringAttributeProperty + * @generated + */ + public Adapter createStringAttributePropertyAdapter() { + 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; + } + +} //PropertyAdapterFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java new file mode 100644 index 000000000..aeda1bbd1 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java @@ -0,0 +1,330 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.util; + +import fr.inria.diverse.event.commons.model.property.*; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * 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 fr.inria.diverse.event.commons.model.property.PropertyPackage + * @generated + */ +public class PropertySwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static PropertyPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public PropertySwitch() { + if (modelPackage == null) { + modelPackage = PropertyPackage.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 T1 doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case PropertyPackage.CLASS_PROPERTY: { + ClassProperty classProperty = (ClassProperty)theEObject; + T1 result = caseClassProperty(classProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.BINARY_PROPERTY: { + BinaryProperty binaryProperty = (BinaryProperty)theEObject; + T1 result = caseBinaryProperty(binaryProperty); + if (result == null) result = caseClassProperty(binaryProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.MANY_REFERENCE_PROPERTY: { + ManyReferenceProperty manyReferenceProperty = (ManyReferenceProperty)theEObject; + T1 result = caseManyReferenceProperty(manyReferenceProperty); + if (result == null) result = caseClassProperty(manyReferenceProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.SINGLE_REFERENCE_PROPERTY: { + SingleReferenceProperty singleReferenceProperty = (SingleReferenceProperty)theEObject; + T1 result = caseSingleReferenceProperty(singleReferenceProperty); + if (result == null) result = caseClassProperty(singleReferenceProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.CONTAINER_REFERENCE_PROPERTY: { + ContainerReferenceProperty containerReferenceProperty = (ContainerReferenceProperty)theEObject; + T1 result = caseContainerReferenceProperty(containerReferenceProperty); + if (result == null) result = caseClassProperty(containerReferenceProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY: { + ManyBooleanAttributeProperty manyBooleanAttributeProperty = (ManyBooleanAttributeProperty)theEObject; + T1 result = caseManyBooleanAttributeProperty(manyBooleanAttributeProperty); + if (result == null) result = caseClassProperty(manyBooleanAttributeProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY: { + ManyIntegerAttributeProperty manyIntegerAttributeProperty = (ManyIntegerAttributeProperty)theEObject; + T1 result = caseManyIntegerAttributeProperty(manyIntegerAttributeProperty); + if (result == null) result = caseClassProperty(manyIntegerAttributeProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY: { + ManyStringAttributeProperty manyStringAttributeProperty = (ManyStringAttributeProperty)theEObject; + T1 result = caseManyStringAttributeProperty(manyStringAttributeProperty); + if (result == null) result = caseClassProperty(manyStringAttributeProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY: { + BooleanAttributeProperty booleanAttributeProperty = (BooleanAttributeProperty)theEObject; + T1 result = caseBooleanAttributeProperty(booleanAttributeProperty); + if (result == null) result = caseClassProperty(booleanAttributeProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY: { + IntegerAttributeProperty integerAttributeProperty = (IntegerAttributeProperty)theEObject; + T1 result = caseIntegerAttributeProperty(integerAttributeProperty); + if (result == null) result = caseClassProperty(integerAttributeProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.STRING_ATTRIBUTE_PROPERTY: { + StringAttributeProperty stringAttributeProperty = (StringAttributeProperty)theEObject; + T1 result = caseStringAttributeProperty(stringAttributeProperty); + if (result == null) result = caseClassProperty(stringAttributeProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Class 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 'Class Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseClassProperty(ClassProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Binary 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 'Binary Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

, T> T1 caseBinaryProperty(BinaryProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Many Reference 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 'Many Reference Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

, T> T1 caseManyReferenceProperty(ManyReferenceProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Single Reference 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 'Single Reference Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

, T> T1 caseSingleReferenceProperty(SingleReferenceProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Container Reference 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 'Container Reference Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

, T> T1 caseContainerReferenceProperty(ContainerReferenceProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Many Boolean Attribute 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 'Many Boolean Attribute Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseManyBooleanAttributeProperty(ManyBooleanAttributeProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Many Integer Attribute 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 'Many Integer Attribute Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseManyIntegerAttributeProperty(ManyIntegerAttributeProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Many String Attribute 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 'Many String Attribute Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseManyStringAttributeProperty(ManyStringAttributeProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Boolean Attribute 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 'Boolean Attribute Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseBooleanAttributeProperty(BooleanAttributeProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Integer Attribute 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 'Integer Attribute Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseIntegerAttributeProperty(IntegerAttributeProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'String Attribute 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 'String Attribute Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseStringAttributeProperty(StringAttributeProperty 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 T1 defaultCase(EObject object) { + return null; + } + +} //PropertySwitch diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java new file mode 100644 index 000000000..3b2ea97c0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java @@ -0,0 +1,41 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Report'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.report.Report#getStages Stages}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getReport() + * @model + * @generated + */ +public interface Report extends EObject { + /** + * Returns the value of the 'Stages' containment reference list. + * The list contents are of type {@link fr.inria.diverse.event.commons.model.report.StageReport}. + * + *

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

+ * + * @return the value of the 'Stages' containment reference list. + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getReport_Stages() + * @model containment="true" + * @generated + */ + EList getStages(); + +} // Report diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java new file mode 100644 index 000000000..f06bdee2d --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java @@ -0,0 +1,51 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report; + +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 fr.inria.diverse.event.commons.model.report.ReportPackage + * @generated + */ +public interface ReportFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + ReportFactory eINSTANCE = fr.inria.diverse.event.commons.model.report.impl.ReportFactoryImpl.init(); + + /** + * Returns a new object of class 'Report'. + * + * + * @return a new object of class 'Report'. + * @generated + */ + Report createReport(); + + /** + * Returns a new object of class 'Stage Report'. + * + * + * @return a new object of class 'Stage Report'. + * @generated + */ + StageReport createStageReport(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + ReportPackage getReportPackage(); + +} //ReportFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java new file mode 100644 index 000000000..4638e65d1 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java @@ -0,0 +1,264 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report; + +import org.eclipse.emf.ecore.EClass; +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 operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.report.ReportFactory + * @model kind="package" + * @generated + */ +public interface ReportPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "report"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.gemoc.org/report"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "report"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + ReportPackage eINSTANCE = fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl.init(); + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.report.impl.ReportImpl Report}' class. + * + * + * @see fr.inria.diverse.event.commons.model.report.impl.ReportImpl + * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getReport() + * @generated + */ + int REPORT = 0; + + /** + * The feature id for the 'Stages' containment reference list. + * + * + * @generated + * @ordered + */ + int REPORT__STAGES = 0; + + /** + * The number of structural features of the 'Report' class. + * + * + * @generated + * @ordered + */ + int REPORT_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Report' class. + * + * + * @generated + * @ordered + */ + int REPORT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl Stage Report}' class. + * + * + * @see fr.inria.diverse.event.commons.model.report.impl.StageReportImpl + * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getStageReport() + * @generated + */ + int STAGE_REPORT = 1; + + /** + * The feature id for the 'Stage' reference. + * + * + * @generated + * @ordered + */ + int STAGE_REPORT__STAGE = 0; + + /** + * The feature id for the 'Matches' reference list. + * + * + * @generated + * @ordered + */ + int STAGE_REPORT__MATCHES = 1; + + /** + * The number of structural features of the 'Stage Report' class. + * + * + * @generated + * @ordered + */ + int STAGE_REPORT_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Stage Report' class. + * + * + * @generated + * @ordered + */ + int STAGE_REPORT_OPERATION_COUNT = 0; + + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.report.Report Report}'. + * + * + * @return the meta object for class 'Report'. + * @see fr.inria.diverse.event.commons.model.report.Report + * @generated + */ + EClass getReport(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.report.Report#getStages Stages}'. + * + * + * @return the meta object for the containment reference list 'Stages'. + * @see fr.inria.diverse.event.commons.model.report.Report#getStages() + * @see #getReport() + * @generated + */ + EReference getReport_Stages(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.report.StageReport Stage Report}'. + * + * + * @return the meta object for class 'Stage Report'. + * @see fr.inria.diverse.event.commons.model.report.StageReport + * @generated + */ + EClass getStageReport(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.report.StageReport#getStage Stage}'. + * + * + * @return the meta object for the reference 'Stage'. + * @see fr.inria.diverse.event.commons.model.report.StageReport#getStage() + * @see #getStageReport() + * @generated + */ + EReference getStageReport_Stage(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.report.StageReport#getMatches Matches}'. + * + * + * @return the meta object for the reference list 'Matches'. + * @see fr.inria.diverse.event.commons.model.report.StageReport#getMatches() + * @see #getStageReport() + * @generated + */ + EReference getStageReport_Matches(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + ReportFactory getReportFactory(); + + /** + * + * 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 fr.inria.diverse.event.commons.model.report.impl.ReportImpl Report}' class. + * + * + * @see fr.inria.diverse.event.commons.model.report.impl.ReportImpl + * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getReport() + * @generated + */ + EClass REPORT = eINSTANCE.getReport(); + + /** + * The meta object literal for the 'Stages' containment reference list feature. + * + * + * @generated + */ + EReference REPORT__STAGES = eINSTANCE.getReport_Stages(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl Stage Report}' class. + * + * + * @see fr.inria.diverse.event.commons.model.report.impl.StageReportImpl + * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getStageReport() + * @generated + */ + EClass STAGE_REPORT = eINSTANCE.getStageReport(); + + /** + * The meta object literal for the 'Stage' reference feature. + * + * + * @generated + */ + EReference STAGE_REPORT__STAGE = eINSTANCE.getStageReport_Stage(); + + /** + * The meta object literal for the 'Matches' reference list feature. + * + * + * @generated + */ + EReference STAGE_REPORT__MATCHES = eINSTANCE.getStageReport_Matches(); + + } + +} //ReportPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java new file mode 100644 index 000000000..aa0196ec0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java @@ -0,0 +1,71 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report; + +import fr.inria.diverse.event.commons.model.scenario.Stage; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Stage Report'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.report.StageReport#getStage Stage}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.StageReport#getMatches Matches}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getStageReport() + * @model + * @generated + */ +public interface StageReport extends EObject { + /** + * Returns the value of the 'Stage' reference. + * + *

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

+ * + * @return the value of the 'Stage' reference. + * @see #setStage(Stage) + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getStageReport_Stage() + * @model + * @generated + */ + Stage getStage(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.report.StageReport#getStage Stage}' reference. + * + * + * @param value the new value of the 'Stage' reference. + * @see #getStage() + * @generated + */ + void setStage(Stage value); + + /** + * Returns the value of the 'Matches' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. + * + *

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

+ * + * @return the value of the 'Matches' reference list. + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getStageReport_Matches() + * @model + * @generated + */ + EList getMatches(); + +} // StageReport diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java new file mode 100644 index 000000000..5a90500fc --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java @@ -0,0 +1,106 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.impl; + +import fr.inria.diverse.event.commons.model.report.*; + +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; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class ReportFactoryImpl extends EFactoryImpl implements ReportFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static ReportFactory init() { + try { + ReportFactory theReportFactory = (ReportFactory)EPackage.Registry.INSTANCE.getEFactory(ReportPackage.eNS_URI); + if (theReportFactory != null) { + return theReportFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new ReportFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public ReportFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case ReportPackage.REPORT: return createReport(); + case ReportPackage.STAGE_REPORT: return createStageReport(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public Report createReport() { + ReportImpl report = new ReportImpl(); + return report; + } + + /** + * + * + * @generated + */ + public StageReport createStageReport() { + StageReportImpl stageReport = new StageReportImpl(); + return stageReport; + } + + /** + * + * + * @generated + */ + public ReportPackage getReportPackage() { + return (ReportPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static ReportPackage getPackage() { + return ReportPackage.eINSTANCE; + } + +} //ReportFactoryImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java new file mode 100644 index 000000000..3c8b61d18 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java @@ -0,0 +1,148 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.impl; + +import fr.inria.diverse.event.commons.model.report.Report; +import fr.inria.diverse.event.commons.model.report.ReportPackage; +import fr.inria.diverse.event.commons.model.report.StageReport; + +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.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Report'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.report.impl.ReportImpl#getStages Stages}
  • + *
+ * + * @generated + */ +public class ReportImpl extends MinimalEObjectImpl.Container implements Report { + /** + * The cached value of the '{@link #getStages() Stages}' containment reference list. + * + * + * @see #getStages() + * @generated + * @ordered + */ + protected EList stages; + + /** + * + * + * @generated + */ + protected ReportImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ReportPackage.Literals.REPORT; + } + + /** + * + * + * @generated + */ + public EList getStages() { + if (stages == null) { + stages = new EObjectContainmentEList(StageReport.class, this, ReportPackage.REPORT__STAGES); + } + return stages; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ReportPackage.REPORT__STAGES: + return ((InternalEList)getStages()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ReportPackage.REPORT__STAGES: + return getStages(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ReportPackage.REPORT__STAGES: + getStages().clear(); + getStages().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ReportPackage.REPORT__STAGES: + getStages().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ReportPackage.REPORT__STAGES: + return stages != null && !stages.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ReportImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java new file mode 100644 index 000000000..e51e60b3a --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java @@ -0,0 +1,233 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.impl; + +import fr.inria.diverse.event.commons.model.report.Report; +import fr.inria.diverse.event.commons.model.report.ReportFactory; +import fr.inria.diverse.event.commons.model.report.ReportPackage; +import fr.inria.diverse.event.commons.model.report.StageReport; + +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class ReportPackageImpl extends EPackageImpl implements ReportPackage { + /** + * + * + * @generated + */ + private EClass reportEClass = null; + + /** + * + * + * @generated + */ + private EClass stageReportEClass = 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 fr.inria.diverse.event.commons.model.report.ReportPackage#eNS_URI + * @see #init() + * @generated + */ + private ReportPackageImpl() { + super(eNS_URI, ReportFactory.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 ReportPackage#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 ReportPackage init() { + if (isInited) return (ReportPackage)EPackage.Registry.INSTANCE.getEPackage(ReportPackage.eNS_URI); + + // Obtain or create and register package + ReportPackageImpl theReportPackage = (ReportPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ReportPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ReportPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + ScenarioPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theReportPackage.createPackageContents(); + + // Initialize created meta-data + theReportPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theReportPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(ReportPackage.eNS_URI, theReportPackage); + return theReportPackage; + } + + /** + * + * + * @generated + */ + public EClass getReport() { + return reportEClass; + } + + /** + * + * + * @generated + */ + public EReference getReport_Stages() { + return (EReference)reportEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getStageReport() { + return stageReportEClass; + } + + /** + * + * + * @generated + */ + public EReference getStageReport_Stage() { + return (EReference)stageReportEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getStageReport_Matches() { + return (EReference)stageReportEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public ReportFactory getReportFactory() { + return (ReportFactory)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 + reportEClass = createEClass(REPORT); + createEReference(reportEClass, REPORT__STAGES); + + stageReportEClass = createEClass(STAGE_REPORT); + createEReference(stageReportEClass, STAGE_REPORT__STAGE); + createEReference(stageReportEClass, STAGE_REPORT__MATCHES); + } + + /** + * + * + * @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 + ScenarioPackage theScenarioPackage = (ScenarioPackage)EPackage.Registry.INSTANCE.getEPackage(ScenarioPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(reportEClass, Report.class, "Report", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getReport_Stages(), this.getStageReport(), null, "stages", null, 0, -1, Report.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(stageReportEClass, StageReport.class, "StageReport", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + EGenericType g1 = createEGenericType(theScenarioPackage.getStage()); + EGenericType g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + initEReference(getStageReport_Stage(), g1, null, "stage", null, 0, 1, StageReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getStageReport_Matches(), ecorePackage.getEObject(), null, "matches", null, 0, -1, StageReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //ReportPackageImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java new file mode 100644 index 000000000..086853dfb --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java @@ -0,0 +1,200 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.impl; + +import fr.inria.diverse.event.commons.model.report.ReportPackage; +import fr.inria.diverse.event.commons.model.report.StageReport; + +import fr.inria.diverse.event.commons.model.scenario.Stage; + +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.EObject; +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.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Stage Report'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl#getStage Stage}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl#getMatches Matches}
  • + *
+ * + * @generated + */ +public class StageReportImpl extends MinimalEObjectImpl.Container implements StageReport { + /** + * The cached value of the '{@link #getStage() Stage}' reference. + * + * + * @see #getStage() + * @generated + * @ordered + */ + protected Stage stage; + + /** + * The cached value of the '{@link #getMatches() Matches}' reference list. + * + * + * @see #getMatches() + * @generated + * @ordered + */ + protected EList matches; + + /** + * + * + * @generated + */ + protected StageReportImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ReportPackage.Literals.STAGE_REPORT; + } + + /** + * + * + * @generated + */ + public Stage getStage() { + if (stage != null && stage.eIsProxy()) { + InternalEObject oldStage = (InternalEObject)stage; + stage = (Stage)eResolveProxy(oldStage); + if (stage != oldStage) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReportPackage.STAGE_REPORT__STAGE, oldStage, stage)); + } + } + return stage; + } + + /** + * + * + * @generated + */ + public Stage basicGetStage() { + return stage; + } + + /** + * + * + * @generated + */ + public void setStage(Stage newStage) { + Stage oldStage = stage; + stage = newStage; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ReportPackage.STAGE_REPORT__STAGE, oldStage, stage)); + } + + /** + * + * + * @generated + */ + public EList getMatches() { + if (matches == null) { + matches = new EObjectResolvingEList(EObject.class, this, ReportPackage.STAGE_REPORT__MATCHES); + } + return matches; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ReportPackage.STAGE_REPORT__STAGE: + if (resolve) return getStage(); + return basicGetStage(); + case ReportPackage.STAGE_REPORT__MATCHES: + return getMatches(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ReportPackage.STAGE_REPORT__STAGE: + setStage((Stage)newValue); + return; + case ReportPackage.STAGE_REPORT__MATCHES: + getMatches().clear(); + getMatches().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ReportPackage.STAGE_REPORT__STAGE: + setStage((Stage)null); + return; + case ReportPackage.STAGE_REPORT__MATCHES: + getMatches().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ReportPackage.STAGE_REPORT__STAGE: + return stage != null; + case ReportPackage.STAGE_REPORT__MATCHES: + return matches != null && !matches.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //StageReportImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java new file mode 100644 index 000000000..06ef7520a --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java @@ -0,0 +1,138 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.util; + +import fr.inria.diverse.event.commons.model.report.*; + +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; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see fr.inria.diverse.event.commons.model.report.ReportPackage + * @generated + */ +public class ReportAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static ReportPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public ReportAdapterFactory() { + if (modelPackage == null) { + modelPackage = ReportPackage.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 ReportSwitch modelSwitch = + new ReportSwitch() { + @Override + public Adapter caseReport(Report object) { + return createReportAdapter(); + } + @Override + public Adapter caseStageReport(StageReport object) { + return createStageReportAdapter(); + } + @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 fr.inria.diverse.event.commons.model.report.Report Report}'. + * + * 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 fr.inria.diverse.event.commons.model.report.Report + * @generated + */ + public Adapter createReportAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.report.StageReport Stage Report}'. + * + * 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 fr.inria.diverse.event.commons.model.report.StageReport + * @generated + */ + public Adapter createStageReportAdapter() { + 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; + } + +} //ReportAdapterFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java new file mode 100644 index 000000000..952b6443d --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java @@ -0,0 +1,131 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.util; + +import fr.inria.diverse.event.commons.model.report.*; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * 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 fr.inria.diverse.event.commons.model.report.ReportPackage + * @generated + */ +public class ReportSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static ReportPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public ReportSwitch() { + if (modelPackage == null) { + modelPackage = ReportPackage.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 ReportPackage.REPORT: { + Report report = (Report)theEObject; + T result = caseReport(report); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ReportPackage.STAGE_REPORT: { + StageReport stageReport = (StageReport)theEObject; + T result = caseStageReport(stageReport); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Report'. + * + * 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 'Report'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseReport(Report object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Stage Report'. + * + * 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 'Stage Report'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseStageReport(StageReport 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; + } + +} //ReportSwitch diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Event.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Event.java new file mode 100644 index 000000000..b050b65d7 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Event.java @@ -0,0 +1,50 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Event'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.Event#getTarget Target}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getEvent() + * @model abstract="true" + * @generated + */ +public interface Event extends EObject { + /** + * Returns the value of the 'Target' reference. + * + *

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

+ * + * @return the value of the 'Target' reference. + * @see #setTarget(Object) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getEvent_Target() + * @model kind="reference" + * @generated + */ + T getTarget(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Event#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(T value); + +} // Event diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java new file mode 100644 index 000000000..70b6c16fd --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java @@ -0,0 +1,41 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Scenario'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.Scenario#getStages Stages}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenario() + * @model abstract="true" + * @generated + */ +public interface Scenario> extends EObject { + /** + * Returns the value of the 'Stages' containment reference list. + * + *

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

+ * + * @return the value of the 'Stages' containment reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenario_Stages() + * @model containment="true" + * @generated + */ + EList getStages(); + +} // Scenario diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFactory.java new file mode 100644 index 000000000..585ac29a6 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFactory.java @@ -0,0 +1,33 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +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 fr.inria.diverse.event.commons.model.scenario.ScenarioPackage + * @generated + */ +public interface ScenarioFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + ScenarioFactory eINSTANCE = fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFactoryImpl.init(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + ScenarioPackage getScenarioPackage(); + +} //ScenarioFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java new file mode 100644 index 000000000..ed9f04da0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java @@ -0,0 +1,340 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import org.eclipse.emf.ecore.EClass; +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 operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFactory + * @model kind="package" + * @generated + */ +public interface ScenarioPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "scenario"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.gemoc.org/scenario"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "scenario"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + ScenarioPackage eINSTANCE = fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl.init(); + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioImpl Scenario}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenario() + * @generated + */ + int SCENARIO = 0; + + /** + * The feature id for the 'Stages' containment reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO__STAGES = 0; + + /** + * The number of structural features of the 'Scenario' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Scenario' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.EventImpl Event}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.EventImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getEvent() + * @generated + */ + int EVENT = 1; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int EVENT__TARGET = 0; + + /** + * The number of structural features of the 'Event' class. + * + * + * @generated + * @ordered + */ + int EVENT_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Event' class. + * + * + * @generated + * @ordered + */ + int EVENT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl Stage}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.StageImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getStage() + * @generated + */ + int STAGE = 2; + + /** + * The feature id for the 'Property' containment reference. + * + * + * @generated + * @ordered + */ + int STAGE__PROPERTY = 0; + + /** + * The feature id for the 'Event' containment reference. + * + * + * @generated + * @ordered + */ + int STAGE__EVENT = 1; + + /** + * The number of structural features of the 'Stage' class. + * + * + * @generated + * @ordered + */ + int STAGE_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Stage' class. + * + * + * @generated + * @ordered + */ + int STAGE_OPERATION_COUNT = 0; + + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Scenario Scenario}'. + * + * + * @return the meta object for class 'Scenario'. + * @see fr.inria.diverse.event.commons.model.scenario.Scenario + * @generated + */ + EClass getScenario(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.Scenario#getStages Stages}'. + * + * + * @return the meta object for the containment reference list 'Stages'. + * @see fr.inria.diverse.event.commons.model.scenario.Scenario#getStages() + * @see #getScenario() + * @generated + */ + EReference getScenario_Stages(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Event Event}'. + * + * + * @return the meta object for class 'Event'. + * @see fr.inria.diverse.event.commons.model.scenario.Event + * @generated + */ + EClass getEvent(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.scenario.Event#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see fr.inria.diverse.event.commons.model.scenario.Event#getTarget() + * @see #getEvent() + * @generated + */ + EReference getEvent_Target(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Stage Stage}'. + * + * + * @return the meta object for class 'Stage'. + * @see fr.inria.diverse.event.commons.model.scenario.Stage + * @generated + */ + EClass getStage(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.Stage#getProperty Property}'. + * + * + * @return the meta object for the containment reference 'Property'. + * @see fr.inria.diverse.event.commons.model.scenario.Stage#getProperty() + * @see #getStage() + * @generated + */ + EReference getStage_Property(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.Stage#getEvent Event}'. + * + * + * @return the meta object for the containment reference 'Event'. + * @see fr.inria.diverse.event.commons.model.scenario.Stage#getEvent() + * @see #getStage() + * @generated + */ + EReference getStage_Event(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + ScenarioFactory getScenarioFactory(); + + /** + * + * 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 fr.inria.diverse.event.commons.model.scenario.impl.ScenarioImpl Scenario}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenario() + * @generated + */ + EClass SCENARIO = eINSTANCE.getScenario(); + + /** + * The meta object literal for the 'Stages' containment reference list feature. + * + * + * @generated + */ + EReference SCENARIO__STAGES = eINSTANCE.getScenario_Stages(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.EventImpl Event}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.EventImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getEvent() + * @generated + */ + EClass EVENT = eINSTANCE.getEvent(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference EVENT__TARGET = eINSTANCE.getEvent_Target(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl Stage}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.StageImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getStage() + * @generated + */ + EClass STAGE = eINSTANCE.getStage(); + + /** + * The meta object literal for the 'Property' containment reference feature. + * + * + * @generated + */ + EReference STAGE__PROPERTY = eINSTANCE.getStage_Property(); + + /** + * The meta object literal for the 'Event' containment reference feature. + * + * + * @generated + */ + EReference STAGE__EVENT = eINSTANCE.getStage_Event(); + + } + +} //ScenarioPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java new file mode 100644 index 000000000..1cfeecd9e --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java @@ -0,0 +1,79 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import fr.inria.diverse.event.commons.model.property.ClassProperty; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Stage'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.Stage#getProperty Property}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.Stage#getEvent Event}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getStage() + * @model abstract="true" + * @generated + */ +public interface Stage, P extends ClassProperty> extends EObject { + /** + * Returns the value of the 'Property' containment reference. + * + *

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

+ * + * @return the value of the 'Property' containment reference. + * @see #setProperty(ClassProperty) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getStage_Property() + * @model containment="true" + * @generated + */ + P getProperty(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Stage#getProperty Property}' containment reference. + * + * + * @param value the new value of the 'Property' containment reference. + * @see #getProperty() + * @generated + */ + void setProperty(P value); + + /** + * Returns the value of the 'Event' containment reference. + * + *

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

+ * + * @return the value of the 'Event' containment reference. + * @see #setEvent(Event) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getStage_Event() + * @model containment="true" + * @generated + */ + E getEvent(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Stage#getEvent Event}' containment reference. + * + * + * @param value the new value of the 'Event' containment reference. + * @see #getEvent() + * @generated + */ + void setEvent(E value); + +} // Stage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventImpl.java new file mode 100644 index 000000000..f350a5ecb --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventImpl.java @@ -0,0 +1,159 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Event'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.EventImpl#getTarget Target}
  • + *
+ * + * @generated + */ +public abstract class EventImpl extends MinimalEObjectImpl.Container implements Event { + /** + * The cached value of the '{@link #getTarget() Target}' reference. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected T target; + + /** + * + * + * @generated + */ + protected EventImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.EVENT; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public T getTarget() { + if (target != null && ((EObject)target).eIsProxy()) { + InternalEObject oldTarget = (InternalEObject)target; + target = (T)eResolveProxy(oldTarget); + if (target != oldTarget) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScenarioPackage.EVENT__TARGET, oldTarget, target)); + } + } + return target; + } + + /** + * + * + * @generated + */ + public T basicGetTarget() { + return target; + } + + /** + * + * + * @generated + */ + public void setTarget(T newTarget) { + T oldTarget = target; + target = newTarget; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.EVENT__TARGET, oldTarget, target)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.EVENT__TARGET: + if (resolve) return getTarget(); + return basicGetTarget(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.EVENT__TARGET: + setTarget((T)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.EVENT__TARGET: + setTarget((T)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.EVENT__TARGET: + return target != null; + } + return super.eIsSet(featureID); + } + +} //EventImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFactoryImpl.java new file mode 100644 index 000000000..522db3a74 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFactoryImpl.java @@ -0,0 +1,84 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.scenario.*; + +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; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class ScenarioFactoryImpl extends EFactoryImpl implements ScenarioFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static ScenarioFactory init() { + try { + ScenarioFactory theScenarioFactory = (ScenarioFactory)EPackage.Registry.INSTANCE.getEFactory(ScenarioPackage.eNS_URI); + if (theScenarioFactory != null) { + return theScenarioFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new ScenarioFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public ScenarioFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public ScenarioPackage getScenarioPackage() { + return (ScenarioPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static ScenarioPackage getPackage() { + return ScenarioPackage.eINSTANCE; + } + +} //ScenarioFactoryImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java new file mode 100644 index 000000000..4c1853fd9 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java @@ -0,0 +1,152 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.scenario.Scenario; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.Stage; + +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.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Scenario'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioImpl#getStages Stages}
  • + *
+ * + * @generated + */ +public abstract class ScenarioImpl> extends MinimalEObjectImpl.Container implements Scenario { + /** + * The cached value of the '{@link #getStages() Stages}' containment reference list. + * + * + * @see #getStages() + * @generated + * @ordered + */ + protected EList stages; + + /** + * + * + * @generated + */ + protected ScenarioImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.SCENARIO; + } + + /** + * + * + * @generated + */ + public EList getStages() { + if (stages == null) { + stages = new EObjectContainmentEList(Stage.class, this, ScenarioPackage.SCENARIO__STAGES); + } + return stages; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.SCENARIO__STAGES: + return ((InternalEList)getStages()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.SCENARIO__STAGES: + return getStages(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.SCENARIO__STAGES: + getStages().clear(); + getStages().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO__STAGES: + getStages().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO__STAGES: + return stages != null && !stages.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ScenarioImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java new file mode 100644 index 000000000..f5419fd77 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java @@ -0,0 +1,284 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.Scenario; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFactory; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.Stage; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.ETypeParameter; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class ScenarioPackageImpl extends EPackageImpl implements ScenarioPackage { + /** + * + * + * @generated + */ + private EClass scenarioEClass = null; + + /** + * + * + * @generated + */ + private EClass eventEClass = null; + + /** + * + * + * @generated + */ + private EClass stageEClass = 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 fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#eNS_URI + * @see #init() + * @generated + */ + private ScenarioPackageImpl() { + super(eNS_URI, ScenarioFactory.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 ScenarioPackage#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 ScenarioPackage init() { + if (isInited) return (ScenarioPackage)EPackage.Registry.INSTANCE.getEPackage(ScenarioPackage.eNS_URI); + + // Obtain or create and register package + ScenarioPackageImpl theScenarioPackage = (ScenarioPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ScenarioPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ScenarioPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + PropertyPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theScenarioPackage.createPackageContents(); + + // Initialize created meta-data + theScenarioPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theScenarioPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(ScenarioPackage.eNS_URI, theScenarioPackage); + return theScenarioPackage; + } + + /** + * + * + * @generated + */ + public EClass getScenario() { + return scenarioEClass; + } + + /** + * + * + * @generated + */ + public EReference getScenario_Stages() { + return (EReference)scenarioEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getEvent() { + return eventEClass; + } + + /** + * + * + * @generated + */ + public EReference getEvent_Target() { + return (EReference)eventEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getStage() { + return stageEClass; + } + + /** + * + * + * @generated + */ + public EReference getStage_Property() { + return (EReference)stageEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getStage_Event() { + return (EReference)stageEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public ScenarioFactory getScenarioFactory() { + return (ScenarioFactory)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 + scenarioEClass = createEClass(SCENARIO); + createEReference(scenarioEClass, SCENARIO__STAGES); + + eventEClass = createEClass(EVENT); + createEReference(eventEClass, EVENT__TARGET); + + stageEClass = createEClass(STAGE); + createEReference(stageEClass, STAGE__PROPERTY); + createEReference(stageEClass, STAGE__EVENT); + } + + /** + * + * + * @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 + PropertyPackage thePropertyPackage = (PropertyPackage)EPackage.Registry.INSTANCE.getEPackage(PropertyPackage.eNS_URI); + + // Create type parameters + ETypeParameter scenarioEClass_T = addETypeParameter(scenarioEClass, "T"); + ETypeParameter eventEClass_T = addETypeParameter(eventEClass, "T"); + ETypeParameter stageEClass_E = addETypeParameter(stageEClass, "E"); + ETypeParameter stageEClass_P = addETypeParameter(stageEClass, "P"); + + // Set bounds for type parameters + EGenericType g1 = createEGenericType(this.getStage()); + EGenericType g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + scenarioEClass_T.getEBounds().add(g1); + g1 = createEGenericType(this.getEvent()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + stageEClass_E.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getClassProperty()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + stageEClass_P.getEBounds().add(g1); + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(scenarioEClass, Scenario.class, "Scenario", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(scenarioEClass_T); + initEReference(getScenario_Stages(), g1, null, "stages", null, 0, -1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(eventEClass, Event.class, "Event", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(eventEClass_T); + initEReference(getEvent_Target(), g1, null, "target", null, 0, 1, Event.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(stageEClass, Stage.class, "Stage", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(stageEClass_P); + initEReference(getStage_Property(), g1, null, "property", null, 0, 1, Stage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(stageEClass_E); + initEReference(getStage_Event(), g1, null, "event", null, 0, 1, Stage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //ScenarioPackageImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java new file mode 100644 index 000000000..6b6babfeb --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java @@ -0,0 +1,245 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.property.ClassProperty; + +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.Stage; + +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.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Stage'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl#getProperty Property}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl#getEvent Event}
  • + *
+ * + * @generated + */ +public abstract class StageImpl, P extends ClassProperty> extends MinimalEObjectImpl.Container implements Stage { + /** + * The cached value of the '{@link #getProperty() Property}' containment reference. + * + * + * @see #getProperty() + * @generated + * @ordered + */ + protected P property; + + /** + * The cached value of the '{@link #getEvent() Event}' containment reference. + * + * + * @see #getEvent() + * @generated + * @ordered + */ + protected E event; + + /** + * + * + * @generated + */ + protected StageImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.STAGE; + } + + /** + * + * + * @generated + */ + public P getProperty() { + return property; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProperty(P newProperty, NotificationChain msgs) { + P oldProperty = property; + property = newProperty; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.STAGE__PROPERTY, oldProperty, newProperty); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setProperty(P newProperty) { + if (newProperty != property) { + NotificationChain msgs = null; + if (property != null) + msgs = ((InternalEObject)property).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.STAGE__PROPERTY, null, msgs); + if (newProperty != null) + msgs = ((InternalEObject)newProperty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.STAGE__PROPERTY, null, msgs); + msgs = basicSetProperty(newProperty, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.STAGE__PROPERTY, newProperty, newProperty)); + } + + /** + * + * + * @generated + */ + public E getEvent() { + return event; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEvent(E newEvent, NotificationChain msgs) { + E oldEvent = event; + event = newEvent; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.STAGE__EVENT, oldEvent, newEvent); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setEvent(E newEvent) { + if (newEvent != event) { + NotificationChain msgs = null; + if (event != null) + msgs = ((InternalEObject)event).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.STAGE__EVENT, null, msgs); + if (newEvent != null) + msgs = ((InternalEObject)newEvent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.STAGE__EVENT, null, msgs); + msgs = basicSetEvent(newEvent, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.STAGE__EVENT, newEvent, newEvent)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.STAGE__PROPERTY: + return basicSetProperty(null, msgs); + case ScenarioPackage.STAGE__EVENT: + return basicSetEvent(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.STAGE__PROPERTY: + return getProperty(); + case ScenarioPackage.STAGE__EVENT: + return getEvent(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.STAGE__PROPERTY: + setProperty((P)newValue); + return; + case ScenarioPackage.STAGE__EVENT: + setEvent((E)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.STAGE__PROPERTY: + setProperty((P)null); + return; + case ScenarioPackage.STAGE__EVENT: + setEvent((E)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.STAGE__PROPERTY: + return property != null; + case ScenarioPackage.STAGE__EVENT: + return event != null; + } + return super.eIsSet(featureID); + } + +} //StageImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java new file mode 100644 index 000000000..640e92200 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java @@ -0,0 +1,158 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.util; + +import fr.inria.diverse.event.commons.model.property.ClassProperty; + +import fr.inria.diverse.event.commons.model.scenario.*; + +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; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage + * @generated + */ +public class ScenarioAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static ScenarioPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public ScenarioAdapterFactory() { + if (modelPackage == null) { + modelPackage = ScenarioPackage.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 ScenarioSwitch modelSwitch = + new ScenarioSwitch() { + @Override + public > Adapter caseScenario(Scenario object) { + return createScenarioAdapter(); + } + @Override + public Adapter caseEvent(Event object) { + return createEventAdapter(); + } + @Override + public , P extends ClassProperty> Adapter caseStage(Stage object) { + return createStageAdapter(); + } + @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 fr.inria.diverse.event.commons.model.scenario.Scenario Scenario}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.Scenario + * @generated + */ + public Adapter createScenarioAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.Event Event}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.Event + * @generated + */ + public Adapter createEventAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.Stage Stage}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.Stage + * @generated + */ + public Adapter createStageAdapter() { + 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; + } + +} //ScenarioAdapterFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java new file mode 100644 index 000000000..e42dcd64c --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java @@ -0,0 +1,154 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.util; + +import fr.inria.diverse.event.commons.model.property.ClassProperty; + +import fr.inria.diverse.event.commons.model.scenario.*; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * 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 fr.inria.diverse.event.commons.model.scenario.ScenarioPackage + * @generated + */ +public class ScenarioSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static ScenarioPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public ScenarioSwitch() { + if (modelPackage == null) { + modelPackage = ScenarioPackage.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 T1 doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case ScenarioPackage.SCENARIO: { + Scenario scenario = (Scenario)theEObject; + T1 result = caseScenario(scenario); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.EVENT: { + Event event = (Event)theEObject; + T1 result = caseEvent(event); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.STAGE: { + Stage stage = (Stage)theEObject; + T1 result = caseStage(stage); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Scenario'. + * + * 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 'Scenario'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public > T1 caseScenario(Scenario object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Event'. + * + * 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 'Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseEvent(Event object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Stage'. + * + * 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 'Stage'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public , P extends ClassProperty> T1 caseStage(Stage 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 T1 defaultCase(EObject object) { + return null; + } + +} //ScenarioSwitch diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/plugin.xml b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/plugin.xml index 43f28086b..afd9dd3c4 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/plugin.xml +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/plugin.xml @@ -88,5 +88,9 @@ actionClass="org.gemoc.executionframework.engine.ui.debug.sirius.action.GemocToggleBreakpointAction" id="org.gemoc.executionframework.engine.ui.debug.sirius.action.GemocToggleBreakpointAction"> + + diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java index fd7110c78..b24885682 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java @@ -26,8 +26,6 @@ public class RunConfiguration implements IRunConfiguration { - - protected ILaunchConfiguration _launchConfiguration; public RunConfiguration(ILaunchConfiguration launchConfiguration) throws CoreException { @@ -50,6 +48,7 @@ protected void extractInformation() throws CoreException { _modelEntryPoint = getAttribute(LAUNCH_MODEL_ENTRY_POINT, ""); _modelInitializationMethod = getAttribute(LAUNCH_INITIALIZATION_METHOD, ""); _modelInitializationArguments = getAttribute(LAUNCH_INITIALIZATION_ARGUMENTS, ""); + _scenarioURI = URI.createPlatformResourceURI(getAttribute(LAUNCH_SCENARIO_URI, ""), true); _melangeQuery = getAttribute(LAUNCH_MELANGE_QUERY, ""); for (EngineAddonSpecificationExtension extension : EngineAddonSpecificationExtensionPoint.getSpecifications()) { @@ -78,8 +77,6 @@ public int getAnimationDelay() { return _animationDelay; } - - private URI _modelURI; @Override @@ -161,6 +158,13 @@ public String getModelInitializationArguments() { return _modelInitializationArguments; } + private URI _scenarioURI; + + @Override + public URI getScenarioURI() { + return _scenarioURI; + } + private boolean _breakStart; @Override diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/AbstractGemocDebugger.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/AbstractGemocDebugger.java index 381af6ab7..1ffa74807 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/AbstractGemocDebugger.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/AbstractGemocDebugger.java @@ -23,29 +23,12 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; import java.util.function.BiPredicate; -import java.util.function.Function; import java.util.stream.Collectors; -import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; -import org.eclipse.debug.internal.ui.views.launch.LaunchView; import org.eclipse.emf.common.util.TreeIterator; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; import org.gemoc.executionframework.engine.ui.Activator; import org.gemoc.executionframework.engine.ui.debug.semanticsopener.OpenSemanticsHandler; import org.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; @@ -57,12 +40,9 @@ import fr.inria.diverse.trace.commons.model.trace.MSEOccurrence; import fr.inria.diverse.trace.commons.model.trace.Step; -import fr.obeo.dsl.debug.StackFrame; import fr.obeo.dsl.debug.ide.AbstractDSLDebugger; -import fr.obeo.dsl.debug.ide.adapter.DSLStackFrameAdapter; import fr.obeo.dsl.debug.ide.event.IDSLDebugEventProcessor; -@SuppressWarnings("restriction") public abstract class AbstractGemocDebugger extends AbstractDSLDebugger implements IGemocDebugger { /** @@ -394,8 +374,6 @@ public void setVariableValue(String threadName, String stackName, String variabl data.setValue(value); } - private ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); - @Override public void updateData(String threadName, EObject instruction) { if (executedModelRoot == null) { @@ -408,72 +386,10 @@ public void updateData(String threadName, EObject instruction) { variable(threadName, frameName, "mutable data", m.getName(), m.getValue(), true); } } else { - // Updating mutable datas + // Updating mutable data updateVariables(threadName); } updateStack(threadName, instruction); - scheduleSelectLastStackframe(500); - } - - protected void scheduleSelectLastStackframe(long delay) { - executorService.schedule(() -> selectLastStackframe(), delay, TimeUnit.MILLISECONDS); - } - - private List flatten(List ts, Function> provider) { - if (ts.isEmpty()) { - return ts; - } else { - List res = new ArrayList<>(); - for (T t : ts) { - res.addAll(flatten(provider.apply(t), provider)); - res.add(t); - } - return res; - } - } - - private void selectLastStackframe() { - final IWorkbench workbench = PlatformUI.getWorkbench(); - workbench - .getDisplay() - .asyncExec( - () -> { - final IWorkbenchPage workbenchPage = workbench.getActiveWorkbenchWindow().getActivePage(); - final IViewPart view = workbenchPage.findView("org.eclipse.debug.ui.DebugView"); - if(view == null){ - Activator.warn("Cannot find view org.eclipse.debug.ui.DebugView and update the stack", null); - return; - } - view.setFocus(); - final ISelectionProvider selectionProvider = view.getSite().getSelectionProvider(); - selectionProvider.setSelection(StructuredSelection.EMPTY); - if (view instanceof LaunchView) { - final LaunchView launchView = (LaunchView) view; - final Viewer viewer = launchView.getViewer(); - final Tree tree = ((TreeModelViewer) viewer).getTree(); - final TreeItem[] items = tree.getItems(); - final List allItems = flatten(Arrays.asList(items), - t -> Arrays.asList(t.getItems())); - final List leafItems = allItems - .stream() - .filter(i -> i.getData() instanceof DSLStackFrameAdapter) - .filter(i -> ((DSLStackFrameAdapter) i.getData()).getTarget() instanceof StackFrame) - .collect(Collectors.toList()); - for (TreeItem item : leafItems) { - final DSLStackFrameAdapter stackFrameAdapter = (DSLStackFrameAdapter) item - .getData(); - final StackFrame s = (StackFrame) stackFrameAdapter.getTarget(); - if (s.getName().startsWith("Global context :")) { - tree.showItem(item); - tree.select(item); - final TreeSelection selection = (TreeSelection) viewer.getSelection(); - final TreePath[] paths = selection.getPathsFor(stackFrameAdapter); - selectionProvider.setSelection(new TreeSelection(paths)); - break; - } - } - } - }); } @Override @@ -494,14 +410,17 @@ public void engineAboutToDispose(IExecutionEngine engine) { public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { } + @SuppressWarnings("rawtypes") @Override public void aboutToSelectStep(IExecutionEngine engine, Collection logicalSteps) { } + @SuppressWarnings("rawtypes") @Override public void proposedStepsChanged(IExecutionEngine engine, Collection logicalSteps) { } + @SuppressWarnings("rawtypes") @Override public void stepSelected(IExecutionEngine engine, Step selectedLogicalStep) { } diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/breakpoint/GemocBreakpoint.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/breakpoint/GemocBreakpoint.java index 8804220ad..bda6cdb17 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/breakpoint/GemocBreakpoint.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/breakpoint/GemocBreakpoint.java @@ -36,6 +36,11 @@ public class GemocBreakpoint extends DSLBreakpoint { */ public static final String BREAK_ON_MSE_OCCURRENCE = "org.gemoc.gemoc_modeling_workbench.ui.breakpoint.breakOnMSE"; + /** + * The property. + */ + public static final String PROPERTY = "org.gemoc.gemoc_modeling_workbench.ui.breakpoint.property"; + /** diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/sirius/action/GemocToggleConditionalBreakpointAction.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/sirius/action/GemocToggleConditionalBreakpointAction.java new file mode 100644 index 000000000..ce2cf2430 --- /dev/null +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/debug/sirius/action/GemocToggleConditionalBreakpointAction.java @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright (c) 2016 Inria 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: + * Inria - initial API and implementation + *******************************************************************************/ +package org.gemoc.executionframework.engine.ui.debug.sirius.action; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.gemoc.executionframework.engine.ui.debug.breakpoint.GemocBreakpoint; +import org.gemoc.executionframework.engine.ui.launcher.AbstractGemocLauncher; + +import fr.inria.diverse.melange.resource.MelangeResource; +import fr.obeo.dsl.debug.ide.DSLBreakpoint; +import fr.obeo.dsl.debug.ide.sirius.ui.DSLToggleBreakpointsUtils; +import fr.obeo.dsl.debug.ide.sirius.ui.action.AbstractToggleBreakpointAction; + +/** + * commons class for all Gemoc based models + * + * @author dleroy + * + */ +public class GemocToggleConditionalBreakpointAction extends AbstractToggleBreakpointAction { + + @Override + protected String getModelIdentifier() { + return AbstractGemocLauncher.MODEL_ID; + } + + @Override + protected DSLToggleBreakpointsUtils createToggleBreakpointsUtils() { + return new DSLToggleBreakpointsUtils(getModelIdentifier()) { + @Override + protected void toggleBreakpoint(Object selected, EObject instruction) throws CoreException { + DSLBreakpoint breakpoint = getBreakpoint(instruction); + if (breakpoint != null) { + breakpoint.delete(); + } else { + PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { + public void run() { + try { + DSLBreakpoint breakpoint = createBreakpoint(selected, instruction); + DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint); + } catch (CoreException e) { + e.printStackTrace(); + } + } + }); + } + } + + @Override + protected DSLBreakpoint createBreakpoint(Object selected, EObject instruction) throws CoreException { + final Resource res = ((EObject) instruction).eResource(); + final ResourceSet resSet = res.getResourceSet(); + final Resource originalResource = resSet.getResources().stream().filter(r -> { + return r instanceof MelangeResource; + }).map(r -> (MelangeResource) r).findFirst().map(mr -> mr.getWrappedResource()).orElse(null); + + if (originalResource != null) { + final String fragmentURI = res.getURIFragment(instruction); + instruction = originalResource.getEObject(fragmentURI); + } + + final GemocBreakpoint breakpoint = new GemocBreakpoint(identifier, instruction, true); + + Shell activeShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + FileDialog dialog = new FileDialog(activeShell, SWT.OPEN); + try { + breakpoint.getMarker().setAttribute(GemocBreakpoint.PROPERTY, dialog.open()); + } catch (CoreException e) { + e.printStackTrace(); + } + + return breakpoint; + } + }; + } +} diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/META-INF/MANIFEST.MF index 41969111a..2a8020b44 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/META-INF/MANIFEST.MF @@ -13,7 +13,8 @@ Require-Bundle: org.gemoc.xdsmlframework.api, org.eclipse.emf.transaction;bundle-version="1.8.0", fr.inria.diverse.trace.gemoc.api;bundle-version="1.0.0", fr.inria.diverse.k3.al.annotationprocessor.plugin, - fr.inria.diverse.trace.commons.model;bundle-version="0.1.0" + fr.inria.diverse.trace.commons.model;bundle-version="0.1.0", + fr.inria.diverse.event.commons.model Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Export-Package: org.gemoc.executionframework.engine, diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/META-INF/MANIFEST.MF index 2f31e2855..3f1c8083e 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/META-INF/MANIFEST.MF @@ -11,6 +11,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.emf.ecore, fr.inria.diverse.trace.commons.model, org.eclipse.xtext, - fr.inria.diverse.k3.al.annotationprocessor.plugin;bundle-version="3.2.1" + fr.inria.diverse.event.commons.model;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java index a915fd6d9..147180711 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java @@ -23,8 +23,8 @@ import org.gemoc.xdsmlframework.api.core.IExecutionEngine; import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; -import fr.inria.diverse.k3.al.annotationprocessor.stepmanager.EventManagerRegistry; -import fr.inria.diverse.k3.al.annotationprocessor.stepmanager.IEventManager; +import fr.inria.diverse.event.commons.model.EventManagerRegistry; +import fr.inria.diverse.event.commons.model.IEventManager; import fr.inria.diverse.trace.commons.model.trace.Step; import javafx.application.Platform; import javafx.collections.FXCollections; diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerViewPart.java b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerViewPart.java index cbf52fd79..43de4b549 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerViewPart.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerViewPart.java @@ -45,7 +45,11 @@ public void setFocus() { @Override public void engineSelectionChanged(IExecutionEngine engine) { - eventManagerRenderer.setExecutedModel(engine.getExecutionContext().getResourceModel()); - engine.getExecutionContext().getExecutionPlatform().addEngineAddon(eventManagerRenderer); + if (engine != null) { + eventManagerRenderer.setExecutedModel(engine.getExecutionContext().getResourceModel()); + engine.getExecutionContext().getExecutionPlatform().addEngineAddon(eventManagerRenderer); + } else { + eventManagerRenderer.setExecutedModel(null); + } } } diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventPane.java b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventPane.java index f2cd900af..d80036f70 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventPane.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventPane.java @@ -13,7 +13,7 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.resource.Resource; -import fr.inria.diverse.k3.al.annotationprocessor.stepmanager.IEventManager; +import fr.inria.diverse.event.commons.model.IEventManager; import javafx.scene.layout.BorderPane; public class EventPane extends BorderPane { diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java index 674e77d58..71b11c521 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java @@ -18,6 +18,7 @@ import java.util.stream.Collectors; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EFactory; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; @@ -25,7 +26,8 @@ import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; import org.eclipse.xtext.naming.QualifiedName; -import fr.inria.diverse.k3.al.annotationprocessor.stepmanager.IEventManager; +import fr.inria.diverse.event.commons.model.IEventManager; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import javafx.application.Platform; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.value.ObservableValue; @@ -40,12 +42,16 @@ public class EventTableView extends TableView { private final EClass eventClass; + + private final EClassifier eventTargetClass; + + private final EReference eventTargetReference; private final EFactory factory; private final Resource executedModel; - private final List eventParameterClasses = new ArrayList<>(); +// private final List eventParameterClasses = new ArrayList<>(); private final Map> referenceToMatchingModelElements = new HashMap<>(); @@ -55,10 +61,11 @@ public class EventTableView extends TableView { public EventTableView(final EClass eventClass, final Resource executedModel, final IEventManager eventManager) { this.eventClass = eventClass; + eventTargetClass = eventClass.getEGenericSuperTypes().get(0).getETypeArguments().get(0).getEClassifier(); + eventTargetReference = ScenarioPackage.Literals.EVENT__TARGET; this.factory = eventClass.getEPackage().getEFactoryInstance(); this.executedModel = executedModel; - eventParameterClasses - .addAll(eventClass.getEReferences().stream().map(r -> r.eClass()).collect(Collectors.toList())); +// eventParameterClasses.addAll(eventClass.getEReferences().stream().map(r -> r.eClass()).collect(Collectors.toList())); setItems(events); canDisplayEventFunction = (event) -> { @@ -66,7 +73,7 @@ public EventTableView(final EClass eventClass, final Resource executedModel, fin }; final List> columns = new ArrayList<>(); - eventClass.getEReferences().stream().forEach(r -> { + eventClass.getEAllReferences().stream().forEach(r -> { final TableColumn col = new TableColumn(r.getName()); col.setCellValueFactory(new EObjectPropertyValueFactory(r)); columns.add(col); @@ -141,6 +148,15 @@ private void gatherPotentialParameters() { } elements.add(modelElement); }); + if (elementClass.getClassifierID() == eventTargetClass.getClassifierID() + || elementClass.getEAllSuperTypes().contains(eventTargetClass)) { + List elements = referenceToMatchingModelElements.get(eventTargetReference); + if (elements == null) { + elements = new ArrayList<>(); + referenceToMatchingModelElements.put(eventTargetReference, elements); + } + elements.add(modelElement); + } }); } diff --git a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IRunConfiguration.java b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IRunConfiguration.java index 8ef1f2054..3a03a481c 100644 --- a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IRunConfiguration.java +++ b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IRunConfiguration.java @@ -26,6 +26,7 @@ public interface IRunConfiguration { public static final String LAUNCH_METHOD_ENTRY_POINT = "LAUNCH_METHOD_ENTRY_POINT"; public static final String LAUNCH_INITIALIZATION_METHOD = "GEMOC_LAUNCH_INITIALIZATION_METHOD"; public static final String LAUNCH_INITIALIZATION_ARGUMENTS = "GEMOC_LAUNCH_INITIALIZATION_ARGUMENTS"; + public static final String LAUNCH_SCENARIO_URI = "GEMOC_LAUNCH_SCENARIO_URI"; public static final String LAUNCH_BREAK_START = "GEMOC_LAUNCH_BREAK_START"; public static final String DEBUG_MODEL_ID = "GEMOC_DEBUG_MODEL_ID"; @@ -56,6 +57,8 @@ public interface IRunConfiguration { String getModelInitializationArguments(); + URI getScenarioURI(); + String getDebugModelID(); boolean getBreakStart(); diff --git a/framework/xdsml_framework/plugins/org.gemoc.xdsmlframework.extensions.sirius/src/main/java/org/gemoc/xdsmlframework/extensions/sirius/command/AddDebugLayerHandler.java b/framework/xdsml_framework/plugins/org.gemoc.xdsmlframework.extensions.sirius/src/main/java/org/gemoc/xdsmlframework/extensions/sirius/command/AddDebugLayerHandler.java index 430b12df9..db83e7715 100644 --- a/framework/xdsml_framework/plugins/org.gemoc.xdsmlframework.extensions.sirius/src/main/java/org/gemoc/xdsmlframework/extensions/sirius/command/AddDebugLayerHandler.java +++ b/framework/xdsml_framework/plugins/org.gemoc.xdsmlframework.extensions.sirius/src/main/java/org/gemoc/xdsmlframework/extensions/sirius/command/AddDebugLayerHandler.java @@ -250,23 +250,41 @@ public static Layer createLayer(DiagramDescription description, initialOperation.setFirstModelOperations(debugJavaAction); debugAction.setInitialOperation(initialOperation); // Toggle breakpoint action - OperationAction toogleBreakpointAction = ToolPackage.eINSTANCE + OperationAction toggleBreakpointAction = ToolPackage.eINSTANCE .getToolFactory().createOperationAction(); - toogleBreakpointAction.setName("Toggle breakpoint"); - toogleBreakpointAction + toggleBreakpointAction.setName("Toggle breakpoint"); + toggleBreakpointAction .setIcon("/org.gemoc.executionframework.extensions.sirius/icons/debug_exc.gif"); - popupMenu.getMenuItemDescription().add(toogleBreakpointAction); - ExternalJavaAction toogleBreakpointJavaAction = ToolPackage.eINSTANCE + popupMenu.getMenuItemDescription().add(toggleBreakpointAction); + ExternalJavaAction toggleBreakpointJavaAction = ToolPackage.eINSTANCE .getToolFactory().createExternalJavaAction(); - toogleBreakpointJavaAction.setName("Toggle Gemoc breakpoint"); - toogleBreakpointJavaAction + toggleBreakpointJavaAction.setName("Toggle Gemoc breakpoint"); + toggleBreakpointJavaAction .setId("org.gemoc.execution.sequential.javaengine.ui.debug.sirius.action.GemocSequentialToggleBreakpointAction"); - toogleBreakpointJavaAction + toggleBreakpointJavaAction .setIcon("/org.gemoc.executionframework.extensions.sirius/icons/breakpoint.gif"); initialOperation = ToolPackage.eINSTANCE.getToolFactory() .createInitialOperation(); - initialOperation.setFirstModelOperations(toogleBreakpointJavaAction); - toogleBreakpointAction.setInitialOperation(initialOperation); + initialOperation.setFirstModelOperations(toggleBreakpointJavaAction); + toggleBreakpointAction.setInitialOperation(initialOperation); + // Toggle conditional breakpoint action + OperationAction toggleConditionalBreakpointAction = ToolPackage.eINSTANCE + .getToolFactory().createOperationAction(); + toggleConditionalBreakpointAction.setName("Toggle conditional breakpoint"); + toggleConditionalBreakpointAction + .setIcon("/org.gemoc.executionframework.extensions.sirius/icons/debug_exc.gif"); + popupMenu.getMenuItemDescription().add(toggleConditionalBreakpointAction); + ExternalJavaAction toggleConditionalBreakpointJavaAction = ToolPackage.eINSTANCE + .getToolFactory().createExternalJavaAction(); + toggleConditionalBreakpointJavaAction.setName("Toggle Gemoc conditional breakpoint"); + toggleConditionalBreakpointJavaAction + .setId("org.gemoc.execution.sequential.javaengine.ui.debug.sirius.action.GemocSequentialToggleConditionalBreakpointAction"); + toggleConditionalBreakpointJavaAction + .setIcon("/org.gemoc.executionframework.extensions.sirius/icons/breakpoint.gif"); + initialOperation = ToolPackage.eINSTANCE.getToolFactory() + .createInitialOperation(); + initialOperation.setFirstModelOperations(toggleConditionalBreakpointJavaAction); + toggleConditionalBreakpointAction.setInitialOperation(initialOperation); DecorationDescriptionsSet decorationSet = DescriptionPackage.eINSTANCE .getDescriptionFactory().createDecorationDescriptionsSet(); @@ -389,7 +407,25 @@ public static Layer createLayer(DiagramExtensionDescription descriptionExtension DecorationDescriptionsSet decorationSet = DescriptionPackage.eINSTANCE .getDescriptionFactory().createDecorationDescriptionsSet(); res.setDecorationDescriptionsSet(decorationSet); - + // Toggle conditional breakpoint action + OperationAction toggleConditionalBreakpointAction = ToolPackage.eINSTANCE + .getToolFactory().createOperationAction(); + toggleConditionalBreakpointAction.setName("Toggle conditional breakpoint"); + toggleConditionalBreakpointAction + .setIcon("/org.gemoc.executionframework.extensions.sirius/icons/debug_exc.gif"); + popupMenu.getMenuItemDescription().add(toggleConditionalBreakpointAction); + ExternalJavaAction toggleConditionalBreakpointJavaAction = ToolPackage.eINSTANCE + .getToolFactory().createExternalJavaAction(); + toggleConditionalBreakpointJavaAction.setName("Toggle Gemoc conditional breakpoint"); + toggleConditionalBreakpointJavaAction + .setId("org.gemoc.execution.sequential.javaengine.ui.debug.sirius.action.GemocSequentialToggleConditionalBreakpointAction"); + toggleConditionalBreakpointJavaAction + .setIcon("/org.gemoc.executionframework.extensions.sirius/icons/breakpoint.gif"); + initialOperation = ToolPackage.eINSTANCE.getToolFactory() + .createInitialOperation(); + initialOperation.setFirstModelOperations(toggleConditionalBreakpointJavaAction); + toggleConditionalBreakpointAction.setInitialOperation(initialOperation); + List mappings = getAllMapping(descriptionExtension); // enabled breakpoint decorator MappingBasedDecoration enabledBreakpoint = org.eclipse.sirius.diagram.description.DescriptionPackage.eINSTANCE diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/META-INF/MANIFEST.MF b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/META-INF/MANIFEST.MF index b8b7dd4a6..89fb4a802 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/META-INF/MANIFEST.MF +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/META-INF/MANIFEST.MF @@ -35,7 +35,9 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400", org.gemoc.xdsmlframework.ui.utils, org.eclipse.xtext, org.eclipse.xtend.lib, - fr.inria.diverse.melange.resource + fr.inria.diverse.melange.resource, + fr.inria.diverse.event.commons.model;bundle-version="2.3.0", + fr.inria.diverse.event.commons.interpreter;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-ClassPath: . diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/plugin.xml b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/plugin.xml index 2209697d3..5e64e5e09 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/plugin.xml +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/plugin.xml @@ -157,6 +157,10 @@ actionClass="org.gemoc.execution.sequential.javaengine.ui.debug.sirius.action.GemocSequentialToggleBreakpointAction" id="org.gemoc.execution.sequential.javaengine.ui.debug.sirius.action.GemocSequentialToggleBreakpointAction"> + + diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/commands/GemocToggleBreakpointHandler.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/commands/GemocToggleBreakpointHandler.java index 8af1bc3e7..68bdbb4e9 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/commands/GemocToggleBreakpointHandler.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/commands/GemocToggleBreakpointHandler.java @@ -62,7 +62,7 @@ else if (selected instanceof MSEOccurrence) { res = super.getInstruction(selected); } - + return res; } diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java index 52f65ae1c..c23f69f75 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java @@ -13,13 +13,18 @@ import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Deque; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.function.BiPredicate; +import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; import org.eclipse.xtext.naming.QualifiedName; import org.gemoc.execution.sequential.javaengine.PlainK3ExecutionEngine; @@ -28,6 +33,8 @@ import org.gemoc.executionframework.engine.ui.debug.breakpoint.GemocBreakpoint; import org.gemoc.xdsmlframework.api.core.IExecutionEngine; +import fr.inria.diverse.event.commons.interpreter.property.ClassPropertyAspect; +import fr.inria.diverse.event.commons.model.property.ClassProperty; import fr.inria.diverse.melange.resource.MelangeResourceImpl; import fr.inria.diverse.trace.commons.model.trace.MSE; import fr.inria.diverse.trace.commons.model.trace.MSEOccurrence; @@ -227,7 +234,30 @@ public boolean shouldBreak(EObject instruction) { } return false; } - + + private final Map propertyCache = new HashMap<>(); + + private boolean checkBreakpointProperty(EObject originalObject, EObject actualObject) { + boolean propertyResult = true; + final String propertyURI = (String)getBreakpointAttributes(originalObject, GemocBreakpoint.PROPERTY); + if (propertyURI != null && !propertyURI.isEmpty()) { + ClassProperty property = propertyCache.computeIfAbsent(propertyURI, p -> { + Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); + final Resource resource = originalObject.eResource().getResourceSet().getResource(URI.createFileURI(propertyURI), true); + EcoreUtil.resolveAll(resource); + final EObject content = resource.getContents().get(0); + if (content != null && content instanceof ClassProperty) { + return (ClassProperty) content; + } + return null; + }); + if (property != null) { + propertyResult = ClassPropertyAspect.evaluate(property, actualObject); + } + } + return propertyResult; + } + private boolean hasRegularBreakpointTrue(EObject o) { EObject target = o; // Try to get the original object if 'o' comes from @@ -253,7 +283,8 @@ private boolean hasRegularBreakpointTrue(EObject o) { return super.shouldBreak(target) && (Boolean.valueOf((String) getBreakpointAttributes(target, GemocBreakpoint.BREAK_ON_LOGICAL_STEP)) || Boolean - .valueOf((String) getBreakpointAttributes(target, GemocBreakpoint.BREAK_ON_MSE_OCCURRENCE))); + .valueOf((String) getBreakpointAttributes(target, GemocBreakpoint.BREAK_ON_MSE_OCCURRENCE))) + && checkBreakpointProperty(target, o); } private boolean shouldBreakMSEOccurence(MSEOccurrence mseOccurrence) { diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/sirius/action/GemocSequentialToggleBreakpointAction.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/sirius/action/GemocSequentialToggleBreakpointAction.java index f0dcf715a..e2f6eac7a 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/sirius/action/GemocSequentialToggleBreakpointAction.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/sirius/action/GemocSequentialToggleBreakpointAction.java @@ -19,12 +19,8 @@ * */ public class GemocSequentialToggleBreakpointAction extends GemocToggleBreakpointAction { - @Override protected String getModelIdentifier() { return Activator.DEBUG_MODEL_ID; } - - - } diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/sirius/action/GemocSequentialToggleConditionalBreakpointAction.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/sirius/action/GemocSequentialToggleConditionalBreakpointAction.java new file mode 100644 index 000000000..2665556ca --- /dev/null +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/sirius/action/GemocSequentialToggleConditionalBreakpointAction.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2016 Inria 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: + * Inria - initial API and implementation + *******************************************************************************/ +package org.gemoc.execution.sequential.javaengine.ui.debug.sirius.action; + +import org.gemoc.execution.sequential.javaengine.ui.Activator; +import org.gemoc.executionframework.engine.ui.debug.sirius.action.GemocToggleConditionalBreakpointAction; + +/** + * commons class for all Gemoc based models + * @author dvojtise + * + */ +public class GemocSequentialToggleConditionalBreakpointAction extends GemocToggleConditionalBreakpointAction { + @Override + protected String getModelIdentifier() { + return Activator.DEBUG_MODEL_ID; + } +} diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java index 546b16248..f172d54f6 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java @@ -73,6 +73,7 @@ public class LaunchConfigurationMainTab extends LaunchConfigurationTab { protected Text _modelLocationText; protected Text _modelInitializationMethodText; protected Text _modelInitializationArgumentsText; + protected Text _scenarioLocationText; protected Text _siriusRepresentationLocationText; protected Button _animateButton; protected Text _delayText; @@ -155,6 +156,10 @@ public void initializeFrom(ILaunchConfiguration configuration) { _languageCombo.setText(runConfiguration .getLanguageName()); _modelInitializationArgumentsText.setText(runConfiguration.getModelInitializationArguments()); + + _scenarioLocationText.setText(URIHelper + .removePlatformScheme(runConfiguration.getScenarioURI())); + _entryPointModelElementLabel.setText(""); updateMainElementName(); } catch (CoreException e) { @@ -184,6 +189,8 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) { _modelInitializationMethodText.getText()); configuration.setAttribute(RunConfiguration.LAUNCH_INITIALIZATION_ARGUMENTS, _modelInitializationArgumentsText.getText()); + configuration.setAttribute(RunConfiguration.LAUNCH_SCENARIO_URI, + _scenarioLocationText.getText()); configuration.setAttribute(RunConfiguration.LAUNCH_BREAK_START, _animationFirstBreak.getSelection()); // DebugModelID for sequential engine @@ -256,13 +263,32 @@ public void widgetSelected(SelectionEvent evt) { _modelInitializationArgumentsText.setFont(font); _modelInitializationArgumentsText.setEditable(true); _modelInitializationArgumentsText.addModifyListener(new ModifyListener() { - @Override public void modifyText(ModifyEvent e) { updateLaunchConfigurationDialog(); } }); createTextLabelLayout(parent, ""); + + // Scenario location text + createTextLabelLayout(parent, "Scenario"); + _scenarioLocationText = new Text(parent, SWT.SINGLE | SWT.BORDER); + _scenarioLocationText.setLayoutData(createStandardLayout()); + _scenarioLocationText.setFont(font); + _scenarioLocationText.addModifyListener(fBasicModifyListener); + Button scenarioLocationButton = createPushButton(parent, "Browse", null); + scenarioLocationButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent evt) { + SelectAnyIFileDialog dialog = new SelectAnyIFileDialog(); + if (dialog.open() == Dialog.OK) { + String scenarioPath = ((IResource) dialog.getResult()[0]) + .getFullPath().toPortableString(); + _scenarioLocationText.setText(scenarioPath); + updateLaunchConfigurationDialog(); + } + } + }); + return parent; } diff --git a/trace/generator/plugins/fr.inria.diverse.trace.gemoc/src/fr/inria/diverse/trace/gemoc/traceaddon/GenericTraceConstructor.java b/trace/generator/plugins/fr.inria.diverse.trace.gemoc/src/fr/inria/diverse/trace/gemoc/traceaddon/GenericTraceConstructor.java index e22256658..04cbc0a3f 100644 --- a/trace/generator/plugins/fr.inria.diverse.trace.gemoc/src/fr/inria/diverse/trace/gemoc/traceaddon/GenericTraceConstructor.java +++ b/trace/generator/plugins/fr.inria.diverse.trace.gemoc/src/fr/inria/diverse/trace/gemoc/traceaddon/GenericTraceConstructor.java @@ -138,7 +138,7 @@ private GenericValue getGenericValue(EObject object, EStructuralFeature mutableP } else { final EObject o = (EObject) object.eGet(mutableProperty); final SingleReferenceValue value = GenerictraceFactory.eINSTANCE.createSingleReferenceValue(); - if (isDynamic(o.eClass())) { + if (o != null && isDynamic(o.eClass())) { value.setReferenceValue(exeToTraced.get(o)); } else { value.setReferenceValue(o); diff --git a/trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/META-INF/MANIFEST.MF b/trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/META-INF/MANIFEST.MF index 3f2a8cd9c..d083f07e5 100644 --- a/trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/META-INF/MANIFEST.MF +++ b/trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/META-INF/MANIFEST.MF @@ -7,13 +7,13 @@ Require-Bundle: org.eclipse.xtend.lib, org.eclipse.xtend.lib.macro, com.google.guava, org.eclipse.xtext.xbase.lib, - fr.inria.diverse.ecorext;bundle-version="0.1.0", - org.eclipse.emf.ecore.xmi;bundle-version="2.10.1", - fr.inria.diverse.trace.commons;bundle-version="1.0.0", - org.eclipse.emf.codegen.ecore;bundle-version="2.10.2", + fr.inria.diverse.ecorext, + org.eclipse.emf.ecore.xmi, + fr.inria.diverse.trace.commons, + org.eclipse.emf.codegen.ecore, org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, - fr.inria.diverse.trace.commons.model;bundle-version="0.1.0";visibility:=reexport + fr.inria.diverse.trace.commons.model;visibility:=reexport Bundle-ActivationPolicy: lazy Export-Package: fr.inria.diverse.trace.metamodel.generator, base, diff --git a/trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/src/fr/inria/diverse/trace/metamodel/generator/TraceMMGeneratorStates.xtend b/trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/src/fr/inria/diverse/trace/metamodel/generator/TraceMMGeneratorStates.xtend index f978c82bb..d559a4d64 100644 --- a/trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/src/fr/inria/diverse/trace/metamodel/generator/TraceMMGeneratorStates.xtend +++ b/trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/src/fr/inria/diverse/trace/metamodel/generator/TraceMMGeneratorStates.xtend @@ -378,7 +378,6 @@ class TraceMMGeneratorStates { traceability.putDimensionClass(runtimeProperty, dimensionClass) traceability.putDimensionRef(runtimeProperty, dimensionRef) - traceability.putValueClass(runtimeProperty, valueClass) } val getDimensionsInternal = EcoreFactory.eINSTANCE.createEOperation @@ -403,7 +402,6 @@ class TraceMMGeneratorStates { ''') tracedClass.EOperations.add(getDimensionsInternal) - return tracedClass } else { return runtimeToTraced.get(runtimeClass) diff --git a/trace/generator/plugins/fr.inria.diverse.trace.plugin.generator/META-INF/MANIFEST.MF b/trace/generator/plugins/fr.inria.diverse.trace.plugin.generator/META-INF/MANIFEST.MF index 3b044e37d..bf59bda1b 100644 --- a/trace/generator/plugins/fr.inria.diverse.trace.plugin.generator/META-INF/MANIFEST.MF +++ b/trace/generator/plugins/fr.inria.diverse.trace.plugin.generator/META-INF/MANIFEST.MF @@ -7,23 +7,23 @@ Require-Bundle: com.google.guava, org.eclipse.xtext.xbase.lib, org.eclipse.xtend.lib, org.eclipse.xtend.lib.macro, - fr.inria.diverse.trace.metamodel.generator;bundle-version="1.0.0", + fr.inria.diverse.trace.metamodel.generator, org.eclipse.emf.ecore, org.eclipse.emf.ecore.xmi, - org.eclipse.pde.ui;bundle-version="3.8.101", - org.eclipse.core.resources;bundle-version="3.9.1", - org.eclipse.core.runtime;bundle-version="3.10.0", + org.eclipse.pde.ui, + org.eclipse.core.resources, + org.eclipse.core.runtime, org.eclipse.ui, org.eclipse.ui.ide, - org.eclipse.emf.importer.ecore;bundle-version="2.8.0", - org.eclipse.emf.converter;bundle-version="2.7.0", + org.eclipse.emf.importer.ecore, + org.eclipse.emf.converter, org.eclipse.emf.importer, - fr.inria.diverse.trace.commons;bundle-version="1.0.0", - fr.inria.diverse.ecorext;bundle-version="0.1.0", - org.eclipse.jdt.core;bundle-version="3.10.0", - fr.inria.diverse.trace.annotations;bundle-version="0.1.0", + fr.inria.diverse.trace.commons, + fr.inria.diverse.ecorext, + org.eclipse.jdt.core, + fr.inria.diverse.trace.annotations, org.eclipse.emf.codegen.ecore.ui, - org.eclipse.core.expressions;bundle-version="3.4.600" + org.eclipse.core.expressions Export-Package: fr.inria.diverse.trace.plugin.generator, fr.inria.diverse.trace.plugin.generator.clean Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/trace/generator/plugins/fr.inria.diverse.trace.plugin.generator/src/fr/inria/diverse/trace/plugin/generator/clean/StandaloneEMFProjectGenerator.xtend b/trace/generator/plugins/fr.inria.diverse.trace.plugin.generator/src/fr/inria/diverse/trace/plugin/generator/clean/StandaloneEMFProjectGenerator.xtend index f73af415e..aaeb16799 100644 --- a/trace/generator/plugins/fr.inria.diverse.trace.plugin.generator/src/fr/inria/diverse/trace/plugin/generator/clean/StandaloneEMFProjectGenerator.xtend +++ b/trace/generator/plugins/fr.inria.diverse.trace.plugin.generator/src/fr/inria/diverse/trace/plugin/generator/clean/StandaloneEMFProjectGenerator.xtend @@ -95,9 +95,6 @@ public class StandaloneEMFProjectGenerator extends AbstractEMFProjectGenerator { ecoreModelResource.unload ecoreModelResource.load(null) - ecoreModelResource.unload - ecoreModelResource.load(null) - // Check that all required ecore models are available checkReferencedPackages(ecoreModelResource); From 086fbeb3050a4755c5378e631d1af542fea31db2 Mon Sep 17 00:00:00 2001 From: d-leroy Date: Thu, 4 May 2017 11:42:34 +0200 Subject: [PATCH 02/31] Added support for output events, updated scenario and property metamodel --- .../event/AbstractEventManager.java | 96 ++-- .../property/propertyAspects.xtend | 85 +++- .../scenario/IScenarioManager.java | 5 +- .../interpreter/scenario/ScenarioManager.java | 155 +++--- .../scenario/scenarioAspects.xtend | 36 ++ .../META-INF/MANIFEST.MF | 2 +- ...Query_query_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...ery_query_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...ery_query_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...uery_query_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes .../CreateStageReport_events_EventReport.gif | Bin 0 -> 223 bytes ...ge_property_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes .../icons/full/obj16/EventParameter.gif | Bin 0 -> 129 bytes .../icons/full/obj16/EventReport.gif | Bin 0 -> 129 bytes .../icons/full/obj16/StepProperty.gif | Bin 0 -> 129 bytes .../plugin.properties | 32 +- .../provider/BinaryPropertyItemProvider.java | 2 +- .../BooleanAttributePropertyItemProvider.java | 2 +- ...ontainerReferencePropertyItemProvider.java | 2 +- .../IntegerAttributePropertyItemProvider.java | 2 +- ...yBooleanAttributePropertyItemProvider.java | 2 +- ...yIntegerAttributePropertyItemProvider.java | 2 +- .../ManyReferencePropertyItemProvider.java | 2 +- ...nyStringAttributePropertyItemProvider.java | 2 +- .../PropertyItemProviderAdapterFactory.java | 24 + .../SingleReferencePropertyItemProvider.java | 2 +- ...er.java => StatePropertyItemProvider.java} | 37 +- .../provider/StepPropertyItemProvider.java | 120 +++++ .../StringAttributePropertyItemProvider.java | 2 +- .../provider/EventParameterItemProvider.java | 120 +++++ .../provider/EventReportItemProvider.java | 192 +++++++ .../ReportItemProviderAdapterFactory.java | 48 ++ .../provider/StageReportItemProvider.java | 46 ++ .../scenario/provider/DateItemProvider.java | 119 +++++ .../provider/ElementProviderItemProvider.java | 109 ++++ .../provider/ElementQueryItemProvider.java | 147 ++++++ .../ElementReferenceItemProvider.java | 109 ++++ .../scenario/provider/EventItemProvider.java | 50 +- .../scenario/provider/PhaseItemProvider.java | 151 ++++++ .../provider/ScenarioItemProvider.java | 4 +- .../scenario/provider/StageItemProvider.java | 35 +- .../provider/TestSuiteItemProvider.java | 151 ++++++ .../META-INF/MANIFEST.MF | 2 +- .../presentation/PropertyModelWizard.java | 3 +- .../presentation/ReportModelWizard.java | 3 +- .../model/property.ecore | 67 +-- .../model/report.ecore | 13 + .../model/scenario.ecore | 78 ++- .../event/commons/model/EventInstance.java | 27 + .../event/commons/model/IEventManager.java | 9 +- .../commons/model/IEventManagerListener.java | 6 + .../model/property/BinaryProperty.java | 6 +- .../property/BooleanAttributeProperty.java | 2 +- .../property/ContainerReferenceProperty.java | 4 +- .../property/IntegerAttributeProperty.java | 2 +- .../ManyBooleanAttributeProperty.java | 3 +- .../ManyIntegerAttributeProperty.java | 3 +- .../model/property/ManyReferenceProperty.java | 4 +- .../property/ManyStringAttributeProperty.java | 3 +- .../model/property/PropertyFactory.java | 11 +- .../model/property/PropertyPackage.java | 324 +++++++----- .../property/SingleReferenceProperty.java | 4 +- ...{ClassProperty.java => StateProperty.java} | 24 +- .../commons/model/property/StepProperty.java | 18 + .../property/StringAttributeProperty.java | 2 +- .../property/impl/BinaryPropertyImpl.java | 4 +- .../impl/BooleanAttributePropertyImpl.java | 2 +- .../impl/ContainerReferencePropertyImpl.java | 4 +- .../impl/IntegerAttributePropertyImpl.java | 2 +- .../ManyBooleanAttributePropertyImpl.java | 5 +- .../ManyIntegerAttributePropertyImpl.java | 5 +- .../impl/ManyReferencePropertyImpl.java | 4 +- .../impl/ManyStringAttributePropertyImpl.java | 5 +- .../property/impl/PropertyFactoryImpl.java | 13 +- .../property/impl/PropertyPackageImpl.java | 83 +-- .../impl/SingleReferencePropertyImpl.java | 4 +- ...opertyImpl.java => StatePropertyImpl.java} | 81 ++- .../model/property/impl/StepPropertyImpl.java | 39 ++ .../impl/StringAttributePropertyImpl.java | 2 +- .../property/util/PropertyAdapterFactory.java | 36 +- .../model/property/util/PropertySwitch.java | 61 ++- .../commons/model/report/EventParameter.java | 18 + .../commons/model/report/EventReport.java | 98 ++++ .../event/commons/model/report/Report.java | 3 +- .../commons/model/report/ReportFactory.java | 18 + .../commons/model/report/ReportPackage.java | 210 +++++++- .../commons/model/report/StageReport.java | 17 + .../model/report/impl/EventParameterImpl.java | 39 ++ .../model/report/impl/EventReportImpl.java | 261 ++++++++++ .../model/report/impl/ReportFactoryImpl.java | 22 + .../commons/model/report/impl/ReportImpl.java | 4 + .../model/report/impl/ReportPackageImpl.java | 90 ++++ .../model/report/impl/StageReportImpl.java | 52 ++ .../report/util/ReportAdapterFactory.java | 36 ++ .../model/report/util/ReportSwitch.java | 42 ++ .../event/commons/model/scenario/Date.java | 49 ++ .../model/scenario/ElementProvider.java | 18 + .../commons/model/scenario/ElementQuery.java | 50 ++ .../model/scenario/ElementReference.java | 49 ++ .../event/commons/model/scenario/Event.java | 24 +- .../event/commons/model/scenario/Phase.java | 50 ++ .../commons/model/scenario/Scenario.java | 14 +- .../model/scenario/ScenarioPackage.java | 473 +++++++++++++++++- .../event/commons/model/scenario/Stage.java | 35 +- .../commons/model/scenario/TestSuite.java | 41 ++ .../commons/model/scenario/impl/DateImpl.java | 163 ++++++ .../scenario/impl/ElementProviderImpl.java | 39 ++ .../model/scenario/impl/ElementQueryImpl.java | 177 +++++++ .../scenario/impl/ElementReferenceImpl.java | 158 ++++++ .../model/scenario/impl/EventImpl.java | 80 +-- .../model/scenario/impl/PhaseImpl.java | 177 +++++++ .../model/scenario/impl/ScenarioImpl.java | 42 +- .../scenario/impl/ScenarioPackageImpl.java | 251 +++++++++- .../model/scenario/impl/StageImpl.java | 71 +-- .../model/scenario/impl/TestSuiteImpl.java | 152 ++++++ .../scenario/util/ScenarioAdapterFactory.java | 114 ++++- .../model/scenario/util/ScenarioSwitch.java | 136 ++++- .../engine/ui/commons/RunConfiguration.java | 3 +- .../AbstractSequentialExecutionEngine.java | 74 +-- .../META-INF/MANIFEST.MF | 3 +- .../views/EventManagerRenderer.java | 19 +- .../views/EventManagerViewPart.java | 6 +- .../eventmanager/views/EventTableView.java | 225 +++++---- .../debug/GenericSequentialModelDebugger.java | 10 +- .../tabs/LaunchConfigurationMainTab.java | 5 +- .../javaengine/PlainK3ExecutionEngine.java | 53 +- 126 files changed, 5592 insertions(+), 940 deletions(-) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/scenarioAspects.xtend create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStageReport_events_EventReport.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventParameter.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventReport.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/StepProperty.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/{ClassPropertyItemProvider.java => StatePropertyItemProvider.java} (75%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventParameterItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/DateItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementProviderItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementQueryItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementReferenceItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/PhaseItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/TestSuiteItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/EventInstance.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManagerListener.java rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/{ClassProperty.java => StateProperty.java} (58%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/{ClassPropertyImpl.java => StatePropertyImpl.java} (65%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventParameter.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventReport.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventParameterImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventReportImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Date.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementQuery.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementReference.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Phase.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TestSuite.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/DateImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementProviderImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementQueryImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementReferenceImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/PhaseImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/TestSuiteImpl.java diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java index a20681c68..3ebbf95f8 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java @@ -1,5 +1,6 @@ package fr.inria.diverse.event.commons.interpreter.event; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -16,31 +17,32 @@ import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; import fr.inria.diverse.event.commons.interpreter.scenario.ScenarioManager; +import fr.inria.diverse.event.commons.model.EventInstance; import fr.inria.diverse.event.commons.model.EventManagerRegistry; import fr.inria.diverse.event.commons.model.IEventManager; -import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.IEventManagerListener; import fr.inria.diverse.event.commons.model.scenario.Scenario; import fr.inria.diverse.trace.commons.model.trace.Step; public abstract class AbstractEventManager implements IEventManager { - + private Resource executedModel; - - private final Queue> eventQueue = new ConcurrentLinkedQueue<>(); - + + private final Queue eventQueue = new ConcurrentLinkedQueue<>(); + private boolean canManageEvents = true; - + private boolean waitForEvents = false; - + private Thread t = null; - + protected ScenarioManager scenarioManager; - + @Override public void sendEvent(Object input) { if (scenarioManager == null) { - if (input instanceof Event) { - eventQueue.add((Event) input); + if (input instanceof EventInstance) { + eventQueue.add((EventInstance) input); if (t != null) { synchronized (t) { t.notify(); @@ -51,6 +53,28 @@ public void sendEvent(Object input) { } } + @Override + public void receiveEvent(Object result, Object caller, String className, String methodName) { + final EventInstance event = rebuildEvent(result, caller, className, methodName); + if (event != null) { + listeners.forEach(l -> l.eventReceived(event)); + } + } + + private List listeners = new ArrayList<>(); + + @Override + public void addListener(IEventManagerListener listener) { + listeners.add(listener); + } + + @Override + public void removeListener(IEventManagerListener listener) { + listeners.remove(listener); + } + + protected abstract EventInstance rebuildEvent(Object result, Object caller, String className, String methodName); + @Override public void manageEvents() { if (canManageEvents) { @@ -71,7 +95,7 @@ public void manageEvents() { } waitForEvents = false; } - Event event = eventQueue.poll(); + EventInstance event = eventQueue.poll(); while (event != null) { dispatchEvent(event); event = eventQueue.poll(); @@ -79,36 +103,42 @@ public void manageEvents() { canManageEvents = true; } } - + @Override public void waitForEvents() { waitForEvents = true; } - + @SuppressWarnings("rawtypes") private Scenario pendingScenario; - + @SuppressWarnings("rawtypes") @Override - public void loadScenario(String path, ResourceSet resourceSet) { + public void loadScenario(URI uri, ResourceSet resourceSet) { Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); - Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(path, true), true); + Resource resource = resourceSet.getResource(uri.trimFragment(), true); EcoreUtil.resolveAll(resource); - pendingScenario = (Scenario) resource.getContents().get(0); + if (uri.hasFragment()) { + pendingScenario = (Scenario) resource.getEObject(uri.fragment()); + } else { + pendingScenario = (Scenario) resource.getContents().get(0); + } } - - protected abstract void dispatchEvent(Event event); + + protected abstract void dispatchEvent(EventInstance event); @Override public void engineAboutToStart(IExecutionEngine engine) { executedModel = engine.getExecutionContext().getResourceModel(); - scenarioManager = new ScenarioManager(pendingScenario, executedModel); - pendingScenario = null; + if (pendingScenario != null) { + scenarioManager = new ScenarioManager(pendingScenario, executedModel, () -> engine.getCurrentStack()); + pendingScenario = null; + } } - + @Override public void engineInitialized(IExecutionEngine executionEngine) { - + } @Override @@ -118,9 +148,9 @@ public void engineStarted(IExecutionEngine executionEngine) { @Override public void engineAboutToStop(IExecutionEngine engine) { - + } - + @Override public void engineStopped(IExecutionEngine engine) { if (scenarioManager != null) { @@ -131,39 +161,39 @@ public void engineStopped(IExecutionEngine engine) { @Override public void engineAboutToDispose(IExecutionEngine engine) { - + } @SuppressWarnings("rawtypes") @Override public void aboutToSelectStep(IExecutionEngine engine, Collection steps) { - + } @SuppressWarnings("rawtypes") @Override public void proposedStepsChanged(IExecutionEngine engine, Collection steps) { - + } @Override public void stepSelected(IExecutionEngine engine, Step selectedStep) { - + } @Override public void aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute) { - + } @Override public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { - + } @Override public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { - + } @Override diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend index 0d2106281..4e952c1db 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend @@ -2,7 +2,6 @@ package fr.inria.diverse.event.commons.interpreter.property import fr.inria.diverse.event.commons.model.property.BinaryProperty import fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty -import fr.inria.diverse.event.commons.model.property.ClassProperty import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty import fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty import fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty @@ -13,14 +12,22 @@ import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty import fr.inria.diverse.event.commons.model.property.StringAttributeProperty import fr.inria.diverse.k3.al.annotationprocessor.Aspect import fr.inria.diverse.k3.al.annotationprocessor.OverrideAspectMethod +import java.util.Collections import java.util.List +import java.util.Set import org.eclipse.emf.ecore.EObject +import java.util.HashSet +import fr.inria.diverse.event.commons.model.property.StateProperty -@Aspect(className=ClassProperty) +@Aspect(className=StateProperty) class ClassPropertyAspect { public def boolean evaluate(EObject o) { false } + + public def Set extractDynamicTerms() { + return Collections.emptySet + } } @Aspect(className=SingleReferenceProperty) @@ -30,6 +37,11 @@ class SingleReferencePropertyAspect extends ClassPropertyAspect { val eObject = o.eGet(_self.feature) as EObject return _self.property.evaluate(eObject) } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return Collections.emptySet + } } @Aspect(className=ContainerReferenceProperty) @@ -39,6 +51,11 @@ class ContainerReferencePropertyAspect extends ClassPropertyAspect { val eObject = o.eContainer return _self.property.evaluate(eObject) } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return Collections.emptySet + } } @Aspect(className=BinaryProperty) @@ -59,6 +76,11 @@ class BinaryPropertyAspect extends ClassPropertyAspect { } return result } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return Collections.emptySet + } } @Aspect(className=ManyReferenceProperty) @@ -79,6 +101,11 @@ class ManyPropertyAspect extends ClassPropertyAspect { } } } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return Collections.emptySet + } } @Aspect(className=BooleanAttributeProperty) @@ -94,6 +121,15 @@ class BooleanAttributePropertyAspect extends ClassPropertyAspect { } return result } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return if (_self.feature.EAnnotations.exists[a|a.source == "aspect"]) { + new HashSet => [add(_self)] + } else { + Collections.emptySet + } + } } @Aspect(className=IntegerAttributeProperty) @@ -109,6 +145,15 @@ class IntegerAttributePropertyAspect extends ClassPropertyAspect { } return result } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return if (_self.feature.EAnnotations.exists[a|a.source == "aspect"]) { + new HashSet => [add(_self)] + } else { + Collections.emptySet + } + } } @Aspect(className=StringAttributeProperty) @@ -124,6 +169,15 @@ class StringAttributePropertyAspect extends ClassPropertyAspect { } return result } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return if (_self.feature.EAnnotations.exists[a|a.source == "aspect"]) { + new HashSet => [add(_self)] + } else { + Collections.emptySet + } + } } @Aspect(className=ManyBooleanAttributeProperty) @@ -146,6 +200,15 @@ class ManyBooleanAttributePropertyAspect extends ClassPropertyAspect { } return result } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return if (_self.feature.EAnnotations.exists[a|a.source == "aspect"]) { + new HashSet => [add(_self)] + } else { + Collections.emptySet + } + } } @Aspect(className=ManyIntegerAttributeProperty) @@ -168,6 +231,15 @@ class ManyIntegerAttributePropertyAspect extends ClassPropertyAspect { } return result } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return if (_self.feature.EAnnotations.exists[a|a.source == "aspect"]) { + new HashSet => [add(_self)] + } else { + Collections.emptySet + } + } } @Aspect(className=ManyStringAttributeProperty) @@ -190,5 +262,14 @@ class ManyStringAttributePropertyAspect extends ClassPropertyAspect { } return result } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return if (_self.feature.EAnnotations.exists[a|a.source == "aspect"]) { + new HashSet => [add(_self)] + } else { + Collections.emptySet + } + } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java index 54ad46f3a..430342665 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java @@ -2,11 +2,12 @@ import java.util.List; -import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.EventInstance; public interface IScenarioManager { - List> getEvents(); +// List> getEvents(); + List getEvents(); boolean isScenarioComplete(); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java index 0ec2b3adb..0e4d5044e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java @@ -3,20 +3,23 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; +import java.util.Deque; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Set; -import java.util.stream.Collectors; +import java.util.function.Supplier; import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EObject; 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.resource.impl.PlatformResourceURIHandlerImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.RollbackException; import org.eclipse.emf.transaction.TransactionalEditingDomain; @@ -24,83 +27,99 @@ import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; import fr.inria.diverse.event.commons.interpreter.property.ClassPropertyAspect; -import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.EventInstance; +import fr.inria.diverse.event.commons.model.property.StateProperty; +import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.Report; import fr.inria.diverse.event.commons.model.report.ReportFactory; import fr.inria.diverse.event.commons.model.report.StageReport; +import fr.inria.diverse.event.commons.model.scenario.Date; +import fr.inria.diverse.event.commons.model.scenario.ElementProvider; import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.Phase; import fr.inria.diverse.event.commons.model.scenario.Scenario; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import fr.inria.diverse.event.commons.model.scenario.Stage; +import fr.inria.diverse.trace.commons.model.trace.MSEOccurrence; public class ScenarioManager implements IScenarioManager { private final Scenario scenario; - private Stage currentStage; - private final Iterator> stageIterator; + private final Iterator> stageIterator; private final Resource executedModel; + private final Supplier> stackSupplier; private final Report report; - + private Phase currentPhase; + private EventInstance currentPendingEvent; + private long scheduledTime = -1; + private StageReport currentStageReport; + @SuppressWarnings({ "unchecked", "rawtypes" }) - public ScenarioManager(Scenario scenario, Resource executedModel) { + public ScenarioManager(Scenario scenario, Resource executedModel, Supplier> stackSupplier) { this.scenario = scenario; this.executedModel = executedModel; - this.stageIterator = ((List>) this.scenario.getStages()).iterator(); - this.currentStage = stageIterator.next(); + this.stackSupplier = stackSupplier; + this.stageIterator = ((List>) this.scenario.getPhases()).iterator(); + this.currentPhase = stageIterator.next(); this.report = ReportFactory.eINSTANCE.createReport(); } - + @Override - public List> getEvents() { - if (stageIterator == null) { + public List getEvents() { + if (stageIterator == null || System.nanoTime() < scheduledTime) { return Collections.emptyList(); } else { - List matches = new ArrayList<>(); - if (currentStage.getProperty() == null) { - matches.add(currentStage.getEvent()); - } else { - matches.addAll(evaluateClassProperty(currentStage.getProperty())); + final List events = new ArrayList<>(); + if (currentPendingEvent != null && System.nanoTime() >= scheduledTime) { + events.add(currentPendingEvent); + currentPendingEvent = null; + scheduledTime = -1; } - if (currentStage.getEvent() == null) { - if (!matches.isEmpty()) { - final StageReport stageReport = ReportFactory.eINSTANCE.createStageReport(); - report.getStages().add(stageReport); - stageReport.setStage(currentStage); - stageReport.getMatches().addAll(matches); - if (stageIterator.hasNext()) { - currentStage = stageIterator.next(); + final List matches = new ArrayList<>(); + boolean searchForEvents = true; + while (searchForEvents) { + if (currentPhase instanceof Stage) { + final Stage currentStage = (Stage) currentPhase; + if (currentStage.getProperty() == null) { + matches.add(currentStage.getEvent()); } else { - System.out.println("Scenario completed"); - currentStage = null; + matches.addAll(evaluateStateProperty(currentStage.getProperty())); } + } else if (currentPhase instanceof Date) { + final Date currentDate = (Date) currentPhase; + currentPendingEvent = createEvent(currentDate.getEvent()); + searchForEvents = false; + scheduledTime = currentDate.getTime() + System.nanoTime(); } - return Collections.emptyList(); - } else { - List> events = matches.stream().map(o -> { - return createEvent(currentStage.getEvent(), o); - }).collect(Collectors.toList()); - if (!events.isEmpty()) { - final StageReport stageReport = ReportFactory.eINSTANCE.createStageReport(); - report.getStages().add(stageReport); - stageReport.setStage(currentStage); - stageReport.getMatches().addAll(matches); + + if (!matches.isEmpty()) { +// currentStageReport = ReportFactory.eINSTANCE.createStageReport(); +// report.getStages().add(currentStageReport); +// currentStageReport.setStage(currentPhase); +// currentStageReport.getMatches().addAll(matches); + if (currentPhase.getEvent() != null) { + events.add(createEvent(currentPhase.getEvent())); + } if (stageIterator.hasNext()) { - currentStage = stageIterator.next(); + currentPhase = stageIterator.next(); } else { System.out.println("Scenario completed"); - currentStage = null; + currentPhase = null; + searchForEvents = false; } + } else { + searchForEvents = false; } - return events; } + return events; } } - + @Override public boolean isScenarioComplete() { - return stageIterator != null && currentStage == null; + return stageIterator != null && currentPhase == null; } - + @Override public void saveScenarioReport() { final ResourceSet resourceSet = scenario.eResource().getResourceSet(); @@ -115,7 +134,8 @@ public void doExecute() { resource.getContents().add(report); } }; - EMFCommandTransaction transaction = new EMFCommandTransaction(command, (InternalTransactionalEditingDomain) editingDomain, null); + EMFCommandTransaction transaction = new EMFCommandTransaction(command, + (InternalTransactionalEditingDomain) editingDomain, null); try { transaction.start(); command.execute(); @@ -124,30 +144,45 @@ public void doExecute() { e.printStackTrace(); } try { - resource.save((new PlatformResourceURIHandlerImpl()).createOutputStream(reportURI, Collections.emptyMap()) , Collections.emptyMap()); + resource.save((new PlatformResourceURIHandlerImpl()).createOutputStream(reportURI, Collections.emptyMap()), + Collections.emptyMap()); } catch (IOException e) { e.printStackTrace(); } } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - private Event createEvent(Event originalEvent, EObject eventTarget) { - //TODO handle the case where originalEvent target is already set and different than eventTarget - final Event event = (Event) EcoreUtil.create(originalEvent.eClass()); - if (originalEvent.getTarget() == null) { - event.setTarget(eventTarget); - } else { - event.setTarget(originalEvent.getTarget()); - } - for (EStructuralFeature f : originalEvent.eClass().getEAllStructuralFeatures()) { - if (f != ScenarioPackage.Literals.EVENT__TARGET) { - event.eSet(f, originalEvent.eGet(f)); + + private EventInstance createEvent(Event originalEvent) { + final ElementProvider targetProvider = originalEvent.getTargetProvider(); + final List eventParameterMatches = new ArrayList<>(); + if (targetProvider != null) { + final EObject target = ElementProviderAspect.resolve(targetProvider, executedModel); + if (target != null) { + eventParameterMatches.add(target); + final Map parameters = new HashMap<>(); + parameters.put(ScenarioPackage.Literals.EVENT__TARGET_PROVIDER, target); + for (EStructuralFeature f : originalEvent.eClass().getEStructuralFeatures()) { + if (f instanceof EAttribute) { + parameters.put(f, originalEvent.eGet(f)); + } else { + final ElementProvider paramProvider = (ElementProvider) originalEvent.eGet(f); + final EObject parameter = ElementProviderAspect.resolve(paramProvider, executedModel); + if (parameter != null) { + parameters.put(f, parameter); + eventParameterMatches.add(parameter); + } + } + } +// final EventReport eventReport = ReportFactory.eINSTANCE.createEventReport(); +// currentStageReport.getEvents().add(eventReport); +// eventReport.setEvent(originalEvent); + // TODO eventReport.getMatches().addAll(eventParameterMatches); + return new EventInstance(originalEvent, parameters); } } - return event; + return null; } - private List evaluateClassProperty(ClassProperty property) { + private List evaluateStateProperty(StateProperty property) { final List eventReceivers = new ArrayList<>(); final Object target = property.getTarget(); if (target == null) { diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/scenarioAspects.xtend b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/scenarioAspects.xtend new file mode 100644 index 000000000..dcbaccf73 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/scenarioAspects.xtend @@ -0,0 +1,36 @@ +package fr.inria.diverse.event.commons.interpreter.scenario + +import fr.inria.diverse.event.commons.interpreter.property.ClassPropertyAspect +import fr.inria.diverse.event.commons.model.scenario.ElementProvider +import fr.inria.diverse.event.commons.model.scenario.ElementQuery +import fr.inria.diverse.event.commons.model.scenario.ElementReference +import fr.inria.diverse.k3.al.annotationprocessor.Aspect +import org.eclipse.emf.ecore.resource.Resource +import org.eclipse.emf.ecore.EObject +import fr.inria.diverse.k3.al.annotationprocessor.OverrideAspectMethod + +@Aspect(className=ElementProvider) +class ElementProviderAspect { + public def EObject resolve(Resource r) { + return null + } +} + +@Aspect(className=ElementReference) +class ElementReferenceAspect extends ElementProviderAspect { + @OverrideAspectMethod + public def EObject resolve(Resource r) { + return _self.element as EObject + } +} + +@Aspect(className=ElementQuery) +class ElementQueryAspect extends ElementProviderAspect { + @OverrideAspectMethod + public def EObject resolve(Resource r) { + val queriedType = _self.eClass.EGenericSuperTypes.head.ETypeArguments.head.EClassifier + return r.allContents.filter[o|(o.eClass == queriedType || o.eClass.EAllSuperTypes.contains(queriedType)) + && ClassPropertyAspect.evaluate(_self.query, o) + ].head + } +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF index 733ba4c42..58cf93d95 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %pluginName Bundle-SymbolicName: fr.inria.diverse.event.commons.model.edit;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin$Implementation +Bundle-Activator: fr.inria.diverse.event.commons.model.scenario.provider.ScenarioEditPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..974a35b1e93b7a06f1f61e9a69216caaf49d6f16 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ zy|$+5SWobpV#~Hjon6z_fN1L^<#k>1OPi$TRf^3l5&rl0JrMo)AYJYW3#ZZps{ z2vGdV!U$sNfC!MC46HE<3VkV&c4`bW&mNv~Ve6#+=DtZKp2nX|dah+p(iBtgmrBlb z4%C>v`~+UQ=w@7OAsqx*8B|ous_3OMYpS)VxZunI*#i{=NsIzn{+o(Vypwf8T8e zng#)iKUo+-EFBO5vXg-|MnR!3CDKlfVdmMxQ!Z?s)Zg4Usl?Oxvq{gj>`9tp>its5 zna+V4vzMP>7wOZQbLym<6@!l2eQy^FfuM%jFA_d1I@!*&Fu_g!MoZ1@T&>eD)AJc} OYMN3To3d3E8LR;g&|(q* literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ManyIntegerAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..585fa351bc82a2bb30d8a49f74b920e0e32ed4ee GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6eEt3P=$oVS@6WHiRQdmZ{QP+P|M%@1 z8XB&xX*$*uyr$T)EmCLKbTuH_I!Sq5m;BNusd<%RGfRa3{e2Hae?OlGqCd|U|GwJ{ zGz|h2f3h%wSUMmAWG4e_jDkX6N~E0{!_2dXr(D=NslT~zQi-SWXOo_5*^@NI)cd89 zGo1r9W-mX%F4Ctp=hR6zD+V34``#`V0znP4UnG23bh4dkVS=0djh33*xmu@Rrsp%{ P)HJ0wHf5_SGFSrunJr?* literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateElementQuery_query_ManyStringAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..294bcb2d2929c9322368fd62c330dff8bf4195f6 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`Oxl@-h6V=*hyVZM=f~Uszi$uZ zUR%?2tS5L)v1MDN&aUZdK(uv|^13ehrA<=vD#d1&2><*09*F*aJ`Y5Ho-h7=w;5;} z1StMwVFa;sKm^E62G$q_g}#(XJ2i%xXAe)guys;@bKj&APvg%fJ=d})X^N@$OC@JI z2Wre-eu7=3PixMplWtZFI%@a5T`UBG8fL#p_^{|?JJZ4hH~AYaHMeuMPQOggXUM5( NN^NY)R#jxM1^|l_UJIv@gMCj)DYfrlb&nYlQhND`=ydI zodY#yFF(O9(x)}&)JZoh1|7Bg-YymbK@GECBz#zOvYlyRf}8w}mYUnSTBl#8=QHHg OG^I8+WvePOSOWm;KVz2w literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventParameter.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventParameter.gif new file mode 100644 index 0000000000000000000000000000000000000000..8a5c70cbd74c87cb3b1df383e0c242ede4660c3b GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgt|Nnbl?CH7LlXfP} z;ednUPZmZ722KVYkWP>p3@myECp}m1wRrvIn+pHKLf7r4thZ7UycR6{YNPjYn%Y&f W@}8BN{JP5-JKc^<6cT1+um%9u%P=zl literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventReport.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventReport.gif new file mode 100644 index 0000000000000000000000000000000000000000..d3dc5a9ad8159548d5ada4a1cd545ec1d4de029c GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgt|Nl+bt_2@EX1QjK zPFtJePZmZ722KVYkWP>p3@myECp}m1wRrvIn+pHKLf7r4thZ7UycR6{YNPjYn%Y&f W@}8BN{JP5-JKc^<6cT1+um%9ULNDL| literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/StepProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/StepProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..48e3cf2268736efbb8bc3c5bd29315702f2b38c4 GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgte-JzEOd3$i!NEcC zCkrD311EzHNGHe)1{OVolb);hTD<=9O@;qqq3d>2)>|nFUJDj}wbA=HP3@{#dCy8s Se% * @generated */ -public class BinaryPropertyItemProvider extends ClassPropertyItemProvider { +public class BinaryPropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BooleanAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BooleanAttributePropertyItemProvider.java index 873eefe10..581512138 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BooleanAttributePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/BooleanAttributePropertyItemProvider.java @@ -23,7 +23,7 @@ * * @generated */ -public class BooleanAttributePropertyItemProvider extends ClassPropertyItemProvider { +public class BooleanAttributePropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ContainerReferencePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ContainerReferencePropertyItemProvider.java index a763b4dd4..67ec8b381 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ContainerReferencePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ContainerReferencePropertyItemProvider.java @@ -24,7 +24,7 @@ * * @generated */ -public class ContainerReferencePropertyItemProvider extends ClassPropertyItemProvider { +public class ContainerReferencePropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java index f06441648..71f421d4e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java @@ -23,7 +23,7 @@ * * @generated */ -public class IntegerAttributePropertyItemProvider extends ClassPropertyItemProvider { +public class IntegerAttributePropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyBooleanAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyBooleanAttributePropertyItemProvider.java index 24ecbbaab..ab86dde75 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyBooleanAttributePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyBooleanAttributePropertyItemProvider.java @@ -24,7 +24,7 @@ * * @generated */ -public class ManyBooleanAttributePropertyItemProvider extends ClassPropertyItemProvider { +public class ManyBooleanAttributePropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyIntegerAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyIntegerAttributePropertyItemProvider.java index 429a3c80a..33eedf2d8 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyIntegerAttributePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyIntegerAttributePropertyItemProvider.java @@ -24,7 +24,7 @@ * * @generated */ -public class ManyIntegerAttributePropertyItemProvider extends ClassPropertyItemProvider { +public class ManyIntegerAttributePropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyReferencePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyReferencePropertyItemProvider.java index 9b52ec1f7..ac8435520 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyReferencePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyReferencePropertyItemProvider.java @@ -27,7 +27,7 @@ * * @generated */ -public class ManyReferencePropertyItemProvider extends ClassPropertyItemProvider { +public class ManyReferencePropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyStringAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyStringAttributePropertyItemProvider.java index 011a0a908..42cb3302e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyStringAttributePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ManyStringAttributePropertyItemProvider.java @@ -24,7 +24,7 @@ * * @generated */ -public class ManyStringAttributePropertyItemProvider extends ClassPropertyItemProvider { +public class ManyStringAttributePropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java index 3f234703d..4d5b2a079 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java @@ -163,6 +163,29 @@ public Adapter createManyStringAttributePropertyAdapter() { return manyStringAttributePropertyItemProvider; } + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.StepProperty} instances. + * + * + * @generated + */ + protected StepPropertyItemProvider stepPropertyItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.StepProperty}. + * + * + * @generated + */ + @Override + public Adapter createStepPropertyAdapter() { + if (stepPropertyItemProvider == null) { + stepPropertyItemProvider = new StepPropertyItemProvider(this); + } + + return stepPropertyItemProvider; + } + /** * This returns the root adapter factory that contains this factory. * @@ -266,6 +289,7 @@ public void dispose() { if (manyBooleanAttributePropertyItemProvider != null) manyBooleanAttributePropertyItemProvider.dispose(); if (manyIntegerAttributePropertyItemProvider != null) manyIntegerAttributePropertyItemProvider.dispose(); if (manyStringAttributePropertyItemProvider != null) manyStringAttributePropertyItemProvider.dispose(); + if (stepPropertyItemProvider != null) stepPropertyItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/SingleReferencePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/SingleReferencePropertyItemProvider.java index 1d873604e..5aa9179c6 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/SingleReferencePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/SingleReferencePropertyItemProvider.java @@ -24,7 +24,7 @@ * * @generated */ -public class SingleReferencePropertyItemProvider extends ClassPropertyItemProvider { +public class SingleReferencePropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ClassPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StatePropertyItemProvider.java similarity index 75% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ClassPropertyItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StatePropertyItemProvider.java index a77d5c646..08c5dd8a9 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ClassPropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StatePropertyItemProvider.java @@ -23,12 +23,12 @@ import org.eclipse.emf.edit.provider.ItemProviderAdapter; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.ClassProperty} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.StateProperty} object. * * * @generated */ -public class ClassPropertyItemProvider +public class StatePropertyItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, @@ -42,7 +42,7 @@ public class ClassPropertyItemProvider * * @generated */ - public ClassPropertyItemProvider(AdapterFactory adapterFactory) { + public StatePropertyItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -58,7 +58,6 @@ public List getPropertyDescriptors(Object object) { super.getPropertyDescriptors(object); addTargetPropertyDescriptor(object); - addFeaturePropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -74,9 +73,9 @@ protected void addTargetPropertyDescriptor(Object object) { (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_ClassProperty_target_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_ClassProperty_target_feature", "_UI_ClassProperty_type"), - PropertyPackage.Literals.CLASS_PROPERTY__TARGET, + getString("_UI_StateProperty_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_StateProperty_target_feature", "_UI_StateProperty_type"), + PropertyPackage.Literals.STATE_PROPERTY__TARGET, true, false, true, @@ -85,28 +84,6 @@ protected void addTargetPropertyDescriptor(Object object) { null)); } - /** - * This adds a property descriptor for the Feature feature. - * - * - * @generated - */ - protected void addFeaturePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_ClassProperty_feature_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_ClassProperty_feature_feature", "_UI_ClassProperty_type"), - PropertyPackage.Literals.CLASS_PROPERTY__FEATURE, - false, - false, - false, - null, - null, - null)); - } - /** * This returns the label text for the adapted class. * @@ -115,7 +92,7 @@ protected void addFeaturePropertyDescriptor(Object object) { */ @Override public String getText(Object object) { - return getString("_UI_ClassProperty_type"); + return getString("_UI_StateProperty_type"); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java new file mode 100644 index 000000000..63a1e1785 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java @@ -0,0 +1,120 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.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 fr.inria.diverse.event.commons.model.property.StepProperty} object. + * + * + * @generated + */ +public class StepPropertyItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public StepPropertyItemProvider(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 StepProperty.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/StepProperty")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_StepProperty_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 PropertyEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StringAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StringAttributePropertyItemProvider.java index dccda821d..db374162e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StringAttributePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StringAttributePropertyItemProvider.java @@ -23,7 +23,7 @@ * * @generated */ -public class StringAttributePropertyItemProvider extends ClassPropertyItemProvider { +public class StringAttributePropertyItemProvider extends StatePropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventParameterItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventParameterItemProvider.java new file mode 100644 index 000000000..4915153f6 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventParameterItemProvider.java @@ -0,0 +1,120 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.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 fr.inria.diverse.event.commons.model.report.EventParameter} object. + * + * + * @generated + */ +public class EventParameterItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public EventParameterItemProvider(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 EventParameter.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/EventParameter")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_EventParameter_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 ReportEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java new file mode 100644 index 000000000..add6bf369 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java @@ -0,0 +1,192 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.provider; + + +import fr.inria.diverse.event.commons.model.report.ReportPackage; + +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.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.EventReport} object. + * + * + * @generated + */ +public class EventReportItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public EventReportItemProvider(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); + + addEventPropertyDescriptor(object); + addMatchesPropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Event feature. + * + * + * @generated + */ + protected void addEventPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_EventReport_event_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventReport_event_feature", "_UI_EventReport_type"), + ReportPackage.Literals.EVENT_REPORT__EVENT, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Matches feature. + * + * + * @generated + */ + protected void addMatchesPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_EventReport_matches_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventReport_matches_feature", "_UI_EventReport_type"), + ReportPackage.Literals.EVENT_REPORT__MATCHES, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_EventReport_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventReport_target_feature", "_UI_EventReport_type"), + ReportPackage.Literals.EVENT_REPORT__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns EventReport.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/EventReport")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_EventReport_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 ReportEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java index 5f43a2e20..64b4c7108 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java @@ -117,6 +117,52 @@ public Adapter createStageReportAdapter() { return stageReportItemProvider; } + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.EventReport} instances. + * + * + * @generated + */ + protected EventReportItemProvider eventReportItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.EventReport}. + * + * + * @generated + */ + @Override + public Adapter createEventReportAdapter() { + if (eventReportItemProvider == null) { + eventReportItemProvider = new EventReportItemProvider(this); + } + + return eventReportItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.EventParameter} instances. + * + * + * @generated + */ + protected EventParameterItemProvider eventParameterItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.EventParameter}. + * + * + * @generated + */ + @Override + public Adapter createEventParameterAdapter() { + if (eventParameterItemProvider == null) { + eventParameterItemProvider = new EventParameterItemProvider(this); + } + + return eventParameterItemProvider; + } + /** * This returns the root adapter factory that contains this factory. * @@ -218,6 +264,8 @@ public void fireNotifyChanged(Notification notification) { public void dispose() { if (reportItemProvider != null) reportItemProvider.dispose(); if (stageReportItemProvider != null) stageReportItemProvider.dispose(); + if (eventReportItemProvider != null) eventReportItemProvider.dispose(); + if (eventParameterItemProvider != null) eventParameterItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java index 4a6334fb6..870729015 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java @@ -3,7 +3,9 @@ package fr.inria.diverse.event.commons.model.report.provider; +import fr.inria.diverse.event.commons.model.report.ReportFactory; import fr.inria.diverse.event.commons.model.report.ReportPackage; +import fr.inria.diverse.event.commons.model.report.StageReport; import java.util.Collection; import java.util.List; @@ -13,6 +15,8 @@ import org.eclipse.emf.common.util.ResourceLocator; +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; @@ -21,6 +25,7 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; /** * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.StageReport} object. @@ -107,6 +112,36 @@ protected void addMatchesPropertyDescriptor(Object object) { 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(ReportPackage.Literals.STAGE_REPORT__EVENTS); + } + 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 StageReport.gif. * @@ -140,6 +175,12 @@ public String getText(Object object) { @Override public void notifyChanged(Notification notification) { updateChildren(notification); + + switch (notification.getFeatureID(StageReport.class)) { + case ReportPackage.STAGE_REPORT__EVENTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } super.notifyChanged(notification); } @@ -153,6 +194,11 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (ReportPackage.Literals.STAGE_REPORT__EVENTS, + ReportFactory.eINSTANCE.createEventReport())); } /** diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/DateItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/DateItemProvider.java new file mode 100644 index 000000000..9a48d803a --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/DateItemProvider.java @@ -0,0 +1,119 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.scenario.Date; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Date} object. + * + * + * @generated + */ +public class DateItemProvider extends PhaseItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public DateItemProvider(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); + + addTimePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Time feature. + * + * + * @generated + */ + protected void addTimePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Date_time_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Date_time_feature", "_UI_Date_type"), + ScenarioPackage.Literals.DATE__TIME, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + Date date = (Date)object; + return getString("_UI_Date_type") + " " + date.getTime(); + } + + + /** + * 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(Date.class)) { + case ScenarioPackage.DATE__TIME: + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementProviderItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementProviderItemProvider.java new file mode 100644 index 000000000..adcf26e57 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementProviderItemProvider.java @@ -0,0 +1,109 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.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 fr.inria.diverse.event.commons.model.scenario.ElementProvider} object. + * + * + * @generated + */ +public class ElementProviderItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ElementProviderItemProvider(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_ElementProvider_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 ScenarioEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementQueryItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementQueryItemProvider.java new file mode 100644 index 000000000..671e2f9fb --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementQueryItemProvider.java @@ -0,0 +1,147 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyFactory; + +import fr.inria.diverse.event.commons.model.scenario.ElementQuery; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ElementQuery} object. + * + * + * @generated + */ +public class ElementQueryItemProvider extends ElementProviderItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ElementQueryItemProvider(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(ScenarioPackage.Literals.ELEMENT_QUERY__QUERY); + } + 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) { + return getString("_UI_ElementQuery_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); + + switch (notification.getFeatureID(ElementQuery.class)) { + case ScenarioPackage.ELEMENT_QUERY__QUERY: + 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 + (ScenarioPackage.Literals.ELEMENT_QUERY__QUERY, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ELEMENT_QUERY__QUERY, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ELEMENT_QUERY__QUERY, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ELEMENT_QUERY__QUERY, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementReferenceItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementReferenceItemProvider.java new file mode 100644 index 000000000..3b842f374 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ElementReferenceItemProvider.java @@ -0,0 +1,109 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.IItemPropertyDescriptor; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ElementReference} object. + * + * + * @generated + */ +public class ElementReferenceItemProvider extends ElementProviderItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ElementReferenceItemProvider(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); + + addElementPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Element feature. + * + * + * @generated + */ + protected void addElementPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ElementReference_element_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ElementReference_element_feature", "_UI_ElementReference_type"), + ScenarioPackage.Literals.ELEMENT_REFERENCE__ELEMENT, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_ElementReference_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); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventItemProvider.java index c9ba639e5..7ab71a3ac 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventItemProvider.java @@ -3,6 +3,7 @@ package fr.inria.diverse.event.commons.model.scenario.provider; +import fr.inria.diverse.event.commons.model.scenario.Event; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import java.util.Collection; @@ -13,7 +14,8 @@ import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +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; @@ -21,6 +23,7 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; /** * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Event} object. @@ -57,31 +60,38 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - addTargetPropertyDescriptor(object); } return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Target feature. + * 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(ScenarioPackage.Literals.EVENT__TARGET_PROVIDER); + } + return childrenFeatures; + } + + /** * * * @generated */ - protected void addTargetPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Event_target_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Event_target_feature", "_UI_Event_type"), - ScenarioPackage.Literals.EVENT__TARGET, - true, - false, - true, - null, - null, - null)); + @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); } /** @@ -117,6 +127,12 @@ public String getText(Object object) { @Override public void notifyChanged(Notification notification) { updateChildren(notification); + + switch (notification.getFeatureID(Event.class)) { + case ScenarioPackage.EVENT__TARGET_PROVIDER: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } super.notifyChanged(notification); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/PhaseItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/PhaseItemProvider.java new file mode 100644 index 000000000..52318b3f8 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/PhaseItemProvider.java @@ -0,0 +1,151 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.scenario.Phase; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Phase} object. + * + * + * @generated + */ +public class PhaseItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public PhaseItemProvider(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(ScenarioPackage.Literals.PHASE__EVENT); + } + 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) { + return getString("_UI_Phase_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); + + switch (notification.getFeatureID(Phase.class)) { + case ScenarioPackage.PHASE__EVENT: + 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); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ScenarioEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java index fd75560be..90712f9c6 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java @@ -76,7 +76,7 @@ public List getPropertyDescriptors(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ScenarioPackage.Literals.SCENARIO__STAGES); + childrenFeatures.add(ScenarioPackage.Literals.SCENARIO__PHASES); } return childrenFeatures; } @@ -129,7 +129,7 @@ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Scenario.class)) { - case ScenarioPackage.SCENARIO__STAGES: + case ScenarioPackage.SCENARIO__PHASES: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java index 71cdd5d05..cb1686703 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java @@ -14,17 +14,9 @@ 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.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.ItemProviderAdapter; import org.eclipse.emf.edit.provider.ViewerNotification; /** @@ -33,14 +25,7 @@ * * @generated */ -public class StageItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { +public class StageItemProvider extends PhaseItemProvider { /** * This constructs an instance from a factory and a notifier. * @@ -79,7 +64,6 @@ public Collection getChildrenFeatures(Object objec if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(ScenarioPackage.Literals.STAGE__PROPERTY); - childrenFeatures.add(ScenarioPackage.Literals.STAGE__EVENT); } return childrenFeatures; } @@ -122,7 +106,6 @@ public void notifyChanged(Notification notification) { switch (notification.getFeatureID(Stage.class)) { case ScenarioPackage.STAGE__PROPERTY: - case ScenarioPackage.STAGE__EVENT: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -140,6 +123,11 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.STAGE__PROPERTY, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + newChildDescriptors.add (createChildParameter (ScenarioPackage.Literals.STAGE__PROPERTY, @@ -156,15 +144,4 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); } - /** - * Return the resource locator for this item provider's resources. - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return ScenarioEditPlugin.INSTANCE; - } - } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/TestSuiteItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/TestSuiteItemProvider.java new file mode 100644 index 000000000..dc143b041 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/TestSuiteItemProvider.java @@ -0,0 +1,151 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.TestSuite; + +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.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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.TestSuite} object. + * + * + * @generated + */ +public class TestSuiteItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public TestSuiteItemProvider(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(ScenarioPackage.Literals.TEST_SUITE__TESTS); + } + 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) { + return getString("_UI_TestSuite_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); + + switch (notification.getFeatureID(TestSuite.class)) { + case ScenarioPackage.TEST_SUITE__TESTS: + 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); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ScenarioEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF index 3c89248c9..912ec20a4 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %pluginName Bundle-SymbolicName: fr.inria.diverse.event.commons.model.editor;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: fr.inria.diverse.event.commons.model.property.presentation.PropertyEditorPlugin$Implementation +Bundle-Activator: fr.inria.diverse.event.commons.model.scenario.presentation.ScenarioEditorPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java index 941bf3af3..7f2012397 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java @@ -395,7 +395,8 @@ public PropertyModelWizardInitialObjectCreationPage(String pageId) { * @generated */ public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); { + Composite composite = new Composite(parent, SWT.NONE); + { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java index 9147c66ed..9df62a07c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java @@ -395,7 +395,8 @@ public ReportModelWizardInitialObjectCreationPage(String pageId) { * @generated */ public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); { + Composite composite = new Composite(parent, SWT.NONE); + { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore index ffa54262e..05c0b8272 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore @@ -1,39 +1,16 @@ - - - - - - - - - - - - - - - - - - - - - - - + + - + - - + @@ -46,13 +23,13 @@ - + - + @@ -62,13 +39,13 @@ - + - + @@ -76,13 +53,13 @@ - + - + @@ -90,7 +67,7 @@ - + @@ -99,7 +76,7 @@ - + @@ -108,7 +85,7 @@ - + @@ -117,7 +94,7 @@ - + @@ -125,7 +102,7 @@ - + @@ -133,7 +110,7 @@ - + @@ -141,7 +118,7 @@ - + @@ -153,17 +130,9 @@ - - - - - - - - - + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore index 863c012ef..abd8d115e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore @@ -14,5 +14,18 @@ + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore index a0b673bcb..d69bc09a8 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore @@ -2,21 +2,23 @@ - - - + + - - + - - + + + + @@ -26,15 +28,73 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/EventInstance.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/EventInstance.java new file mode 100644 index 000000000..f3464a46b --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/EventInstance.java @@ -0,0 +1,27 @@ +package fr.inria.diverse.event.commons.model; + +import java.util.Map; + +import org.eclipse.emf.ecore.EStructuralFeature; + +import fr.inria.diverse.event.commons.model.scenario.Event; + +public class EventInstance { + + private final Event originalEvent; + + private final Map parameters; + + public EventInstance(Event originalEvent, Map parameters) { + this.originalEvent = originalEvent; + this.parameters = parameters; + } + + public Event getOriginalEvent() { + return originalEvent; + } + + public Map getParameters() { + return parameters; + } +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java index 72046ca8b..4a69b4073 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java @@ -2,6 +2,7 @@ import java.util.Set; +import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.resource.ResourceSet; import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; @@ -10,6 +11,8 @@ public interface IEventManager extends IEngineAddon { void sendEvent(Object event); + void receiveEvent(Object result, Object caller, String className, String methodName); + void manageEvents(); void waitForEvents(); @@ -18,5 +21,9 @@ public interface IEventManager extends IEngineAddon { boolean canSendEvent(Object event); - void loadScenario(String path, ResourceSet resourceSet); + void loadScenario(URI uri, ResourceSet resourceSet); + + void addListener(IEventManagerListener listener); + + void removeListener(IEventManagerListener listener); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManagerListener.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManagerListener.java new file mode 100644 index 000000000..cd25fdc57 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManagerListener.java @@ -0,0 +1,6 @@ +package fr.inria.diverse.event.commons.model; + +public interface IEventManagerListener { + + public void eventReceived(EventInstance event); +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BinaryProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BinaryProperty.java index d3e149df2..9eb014982 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BinaryProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BinaryProperty.java @@ -21,7 +21,7 @@ * @model abstract="true" * @generated */ -public interface BinaryProperty

, T> extends ClassProperty { +public interface BinaryProperty

, T> extends StateProperty { /** * Returns the value of the 'Operator' attribute. * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.BooleanOperator}. @@ -60,7 +60,7 @@ public interface BinaryProperty

, T> extends ClassProp *

* * @return the value of the 'Left' containment reference. - * @see #setLeft(ClassProperty) + * @see #setLeft(StateProperty) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBinaryProperty_Left() * @model containment="true" required="true" * @generated @@ -86,7 +86,7 @@ public interface BinaryProperty

, T> extends ClassProp *

* * @return the value of the 'Right' containment reference. - * @see #setRight(ClassProperty) + * @see #setRight(StateProperty) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBinaryProperty_Right() * @model containment="true" required="true" * @generated diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java index a87391b29..e62a4a8df 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java @@ -20,7 +20,7 @@ * @model abstract="true" * @generated */ -public interface BooleanAttributeProperty extends ClassProperty { +public interface BooleanAttributeProperty extends StateProperty { /** * Returns the value of the 'Value' attribute. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ContainerReferenceProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ContainerReferenceProperty.java index 27daebde8..60b877081 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ContainerReferenceProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ContainerReferenceProperty.java @@ -19,7 +19,7 @@ * @model * @generated */ -public interface ContainerReferenceProperty

, T> extends ClassProperty { +public interface ContainerReferenceProperty

, T> extends StateProperty { /** * Returns the value of the 'Property' containment reference. * @@ -29,7 +29,7 @@ public interface ContainerReferenceProperty

, T> exten *

* * @return the value of the 'Property' containment reference. - * @see #setProperty(ClassProperty) + * @see #setProperty(StateProperty) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getContainerReferenceProperty_Property() * @model containment="true" * @generated diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java index 30e01ca8f..fc40e0cb9 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java @@ -20,7 +20,7 @@ * @model abstract="true" * @generated */ -public interface IntegerAttributeProperty extends ClassProperty { +public interface IntegerAttributeProperty extends StateProperty { /** * Returns the value of the 'Value' attribute. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java index 5c9388e82..c976c2de6 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.property; + /** * * A representation of the model object 'Many Boolean Attribute Property'. @@ -20,7 +21,7 @@ * @model * @generated */ -public interface ManyBooleanAttributeProperty extends ClassProperty { +public interface ManyBooleanAttributeProperty extends StateProperty { /** * Returns the value of the 'Quantifier' attribute. * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Quantifier}. diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java index 9bd44f327..f17f2bb87 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.property; + /** * * A representation of the model object 'Many Integer Attribute Property'. @@ -20,7 +21,7 @@ * @model * @generated */ -public interface ManyIntegerAttributeProperty extends ClassProperty { +public interface ManyIntegerAttributeProperty extends StateProperty { /** * Returns the value of the 'Quantifier' attribute. * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Quantifier}. diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyReferenceProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyReferenceProperty.java index 493cafaf9..aa369c277 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyReferenceProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyReferenceProperty.java @@ -20,7 +20,7 @@ * @model abstract="true" * @generated */ -public interface ManyReferenceProperty

, T> extends ClassProperty { +public interface ManyReferenceProperty

, T> extends StateProperty { /** * Returns the value of the 'Property' containment reference. * @@ -30,7 +30,7 @@ public interface ManyReferenceProperty

, T> extends Cl *

* * @return the value of the 'Property' containment reference. - * @see #setProperty(ClassProperty) + * @see #setProperty(StateProperty) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyReferenceProperty_Property() * @model containment="true" required="true" * @generated diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java index ba9f58efe..19bff067d 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.property; + /** * * A representation of the model object 'Many String Attribute Property'. @@ -20,7 +21,7 @@ * @model * @generated */ -public interface ManyStringAttributeProperty extends ClassProperty { +public interface ManyStringAttributeProperty extends StateProperty { /** * Returns the value of the 'Quantifier' attribute. * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Quantifier}. diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java index ad2a1c7df..17ce2874a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java @@ -28,7 +28,7 @@ public interface PropertyFactory extends EFactory { * @return a new object of class 'Container Reference Property'. * @generated */ -

, T> ContainerReferenceProperty createContainerReferenceProperty(); +

, T> ContainerReferenceProperty createContainerReferenceProperty(); /** * Returns a new object of class 'Many Boolean Attribute Property'. @@ -57,6 +57,15 @@ public interface PropertyFactory extends EFactory { */ ManyStringAttributeProperty createManyStringAttributeProperty(); + /** + * Returns a new object of class 'Step Property'. + * + * + * @return a new object of class 'Step Property'. + * @generated + */ + StepProperty createStepProperty(); + /** * Returns the package supported by this factory. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java index 0e022bbdc..b1f8baf65 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java @@ -5,6 +5,7 @@ import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; @@ -58,14 +59,14 @@ public interface PropertyPackage extends EPackage { PropertyPackage eINSTANCE = fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl.init(); /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl Class Property}' class. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl State Property}' class. * * - * @see fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getClassProperty() + * @see fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStateProperty() * @generated */ - int CLASS_PROPERTY = 0; + int STATE_PROPERTY = 0; /** * The feature id for the 'Target' reference. @@ -74,34 +75,34 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int CLASS_PROPERTY__TARGET = 0; + int STATE_PROPERTY__TARGET = 0; /** - * The feature id for the 'Feature' reference. + * The number of structural features of the 'State Property' class. * * * @generated * @ordered */ - int CLASS_PROPERTY__FEATURE = 1; + int STATE_PROPERTY_FEATURE_COUNT = 1; /** - * The number of structural features of the 'Class Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int CLASS_PROPERTY_FEATURE_COUNT = 2; + int STATE_PROPERTY___GET_FEATURE = 0; /** - * The number of operations of the 'Class Property' class. + * The number of operations of the 'State Property' class. * * * @generated * @ordered */ - int CLASS_PROPERTY_OPERATION_COUNT = 0; + int STATE_PROPERTY_OPERATION_COUNT = 1; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl Binary Property}' class. @@ -120,52 +121,52 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int BINARY_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int BINARY_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Operator' attribute. * * * @generated * @ordered */ - int BINARY_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int BINARY_PROPERTY__OPERATOR = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Operator' attribute. + * The feature id for the 'Left' containment reference. * * * @generated * @ordered */ - int BINARY_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 0; + int BINARY_PROPERTY__LEFT = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The feature id for the 'Left' containment reference. + * The feature id for the 'Right' containment reference. * * * @generated * @ordered */ - int BINARY_PROPERTY__LEFT = CLASS_PROPERTY_FEATURE_COUNT + 1; + int BINARY_PROPERTY__RIGHT = STATE_PROPERTY_FEATURE_COUNT + 2; /** - * The feature id for the 'Right' containment reference. + * The number of structural features of the 'Binary Property' class. * * * @generated * @ordered */ - int BINARY_PROPERTY__RIGHT = CLASS_PROPERTY_FEATURE_COUNT + 2; + int BINARY_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 3; /** - * The number of structural features of the 'Binary Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int BINARY_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 3; + int BINARY_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'Binary Property' class. @@ -174,7 +175,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int BINARY_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int BINARY_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl Many Reference Property}' class. @@ -193,43 +194,43 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int MANY_REFERENCE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int MANY_REFERENCE_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Property' containment reference. * * * @generated * @ordered */ - int MANY_REFERENCE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int MANY_REFERENCE_PROPERTY__PROPERTY = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Property' containment reference. + * The feature id for the 'Quantifier' attribute. * * * @generated * @ordered */ - int MANY_REFERENCE_PROPERTY__PROPERTY = CLASS_PROPERTY_FEATURE_COUNT + 0; + int MANY_REFERENCE_PROPERTY__QUANTIFIER = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The feature id for the 'Quantifier' attribute. + * The number of structural features of the 'Many Reference Property' class. * * * @generated * @ordered */ - int MANY_REFERENCE_PROPERTY__QUANTIFIER = CLASS_PROPERTY_FEATURE_COUNT + 1; + int MANY_REFERENCE_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 2; /** - * The number of structural features of the 'Many Reference Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int MANY_REFERENCE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 2; + int MANY_REFERENCE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'Many Reference Property' class. @@ -238,7 +239,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int MANY_REFERENCE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int MANY_REFERENCE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl Single Reference Property}' class. @@ -257,34 +258,34 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int SINGLE_REFERENCE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int SINGLE_REFERENCE_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Property' containment reference. * * * @generated * @ordered */ - int SINGLE_REFERENCE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int SINGLE_REFERENCE_PROPERTY__PROPERTY = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Property' containment reference. + * The number of structural features of the 'Single Reference Property' class. * * * @generated * @ordered */ - int SINGLE_REFERENCE_PROPERTY__PROPERTY = CLASS_PROPERTY_FEATURE_COUNT + 0; + int SINGLE_REFERENCE_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The number of structural features of the 'Single Reference Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int SINGLE_REFERENCE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 1; + int SINGLE_REFERENCE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'Single Reference Property' class. @@ -293,7 +294,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int SINGLE_REFERENCE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int SINGLE_REFERENCE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl Container Reference Property}' class. @@ -312,34 +313,34 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int CONTAINER_REFERENCE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int CONTAINER_REFERENCE_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Property' containment reference. * * * @generated * @ordered */ - int CONTAINER_REFERENCE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int CONTAINER_REFERENCE_PROPERTY__PROPERTY = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Property' containment reference. + * The number of structural features of the 'Container Reference Property' class. * * * @generated * @ordered */ - int CONTAINER_REFERENCE_PROPERTY__PROPERTY = CLASS_PROPERTY_FEATURE_COUNT + 0; + int CONTAINER_REFERENCE_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The number of structural features of the 'Container Reference Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int CONTAINER_REFERENCE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 1; + int CONTAINER_REFERENCE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'Container Reference Property' class. @@ -348,7 +349,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int CONTAINER_REFERENCE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int CONTAINER_REFERENCE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl Many Boolean Attribute Property}' class. @@ -367,52 +368,52 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Quantifier' attribute. * * * @generated * @ordered */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Quantifier' attribute. + * The feature id for the 'Value' attribute. * * * @generated * @ordered */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__QUANTIFIER = CLASS_PROPERTY_FEATURE_COUNT + 0; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The feature id for the 'Value' attribute. + * The feature id for the 'Operator' attribute. * * * @generated * @ordered */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 1; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR = STATE_PROPERTY_FEATURE_COUNT + 2; /** - * The feature id for the 'Operator' attribute. + * The number of structural features of the 'Many Boolean Attribute Property' class. * * * @generated * @ordered */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 2; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 3; /** - * The number of structural features of the 'Many Boolean Attribute Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 3; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'Many Boolean Attribute Property' class. @@ -421,7 +422,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl Many Integer Attribute Property}' class. @@ -440,52 +441,52 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int MANY_INTEGER_ATTRIBUTE_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Quantifier' attribute. * * * @generated * @ordered */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Quantifier' attribute. + * The feature id for the 'Value' attribute. * * * @generated * @ordered */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY__QUANTIFIER = CLASS_PROPERTY_FEATURE_COUNT + 0; + int MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The feature id for the 'Value' attribute. + * The feature id for the 'Operator' attribute. * * * @generated * @ordered */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 1; + int MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR = STATE_PROPERTY_FEATURE_COUNT + 2; /** - * The feature id for the 'Operator' attribute. + * The number of structural features of the 'Many Integer Attribute Property' class. * * * @generated * @ordered */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 2; + int MANY_INTEGER_ATTRIBUTE_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 3; /** - * The number of structural features of the 'Many Integer Attribute Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 3; + int MANY_INTEGER_ATTRIBUTE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'Many Integer Attribute Property' class. @@ -494,7 +495,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int MANY_INTEGER_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl Many String Attribute Property}' class. @@ -513,52 +514,52 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int MANY_STRING_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int MANY_STRING_ATTRIBUTE_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Quantifier' attribute. * * * @generated * @ordered */ - int MANY_STRING_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Quantifier' attribute. + * The feature id for the 'Value' attribute. * * * @generated * @ordered */ - int MANY_STRING_ATTRIBUTE_PROPERTY__QUANTIFIER = CLASS_PROPERTY_FEATURE_COUNT + 0; + int MANY_STRING_ATTRIBUTE_PROPERTY__VALUE = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The feature id for the 'Value' attribute. + * The feature id for the 'Operator' attribute. * * * @generated * @ordered */ - int MANY_STRING_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 1; + int MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR = STATE_PROPERTY_FEATURE_COUNT + 2; /** - * The feature id for the 'Operator' attribute. + * The number of structural features of the 'Many String Attribute Property' class. * * * @generated * @ordered */ - int MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 2; + int MANY_STRING_ATTRIBUTE_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 3; /** - * The number of structural features of the 'Many String Attribute Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int MANY_STRING_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 3; + int MANY_STRING_ATTRIBUTE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'Many String Attribute Property' class. @@ -567,7 +568,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int MANY_STRING_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int MANY_STRING_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl Boolean Attribute Property}' class. @@ -586,43 +587,43 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int BOOLEAN_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int BOOLEAN_ATTRIBUTE_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Value' attribute. * * * @generated * @ordered */ - int BOOLEAN_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int BOOLEAN_ATTRIBUTE_PROPERTY__VALUE = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Value' attribute. + * The feature id for the 'Operator' attribute. * * * @generated * @ordered */ - int BOOLEAN_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 0; + int BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The feature id for the 'Operator' attribute. + * The number of structural features of the 'Boolean Attribute Property' class. * * * @generated * @ordered */ - int BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 1; + int BOOLEAN_ATTRIBUTE_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 2; /** - * The number of structural features of the 'Boolean Attribute Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int BOOLEAN_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 2; + int BOOLEAN_ATTRIBUTE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'Boolean Attribute Property' class. @@ -631,7 +632,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int BOOLEAN_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int BOOLEAN_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl Integer Attribute Property}' class. @@ -650,43 +651,43 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int INTEGER_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int INTEGER_ATTRIBUTE_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Value' attribute. * * * @generated * @ordered */ - int INTEGER_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int INTEGER_ATTRIBUTE_PROPERTY__VALUE = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Value' attribute. + * The feature id for the 'Operator' attribute. * * * @generated * @ordered */ - int INTEGER_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 0; + int INTEGER_ATTRIBUTE_PROPERTY__OPERATOR = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The feature id for the 'Operator' attribute. + * The number of structural features of the 'Integer Attribute Property' class. * * * @generated * @ordered */ - int INTEGER_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 1; + int INTEGER_ATTRIBUTE_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 2; /** - * The number of structural features of the 'Integer Attribute Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int INTEGER_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 2; + int INTEGER_ATTRIBUTE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'Integer Attribute Property' class. @@ -695,7 +696,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int INTEGER_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int INTEGER_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl String Attribute Property}' class. @@ -714,43 +715,43 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int STRING_ATTRIBUTE_PROPERTY__TARGET = CLASS_PROPERTY__TARGET; + int STRING_ATTRIBUTE_PROPERTY__TARGET = STATE_PROPERTY__TARGET; /** - * The feature id for the 'Feature' reference. + * The feature id for the 'Value' attribute. * * * @generated * @ordered */ - int STRING_ATTRIBUTE_PROPERTY__FEATURE = CLASS_PROPERTY__FEATURE; + int STRING_ATTRIBUTE_PROPERTY__VALUE = STATE_PROPERTY_FEATURE_COUNT + 0; /** - * The feature id for the 'Value' attribute. + * The feature id for the 'Operator' attribute. * * * @generated * @ordered */ - int STRING_ATTRIBUTE_PROPERTY__VALUE = CLASS_PROPERTY_FEATURE_COUNT + 0; + int STRING_ATTRIBUTE_PROPERTY__OPERATOR = STATE_PROPERTY_FEATURE_COUNT + 1; /** - * The feature id for the 'Operator' attribute. + * The number of structural features of the 'String Attribute Property' class. * * * @generated * @ordered */ - int STRING_ATTRIBUTE_PROPERTY__OPERATOR = CLASS_PROPERTY_FEATURE_COUNT + 1; + int STRING_ATTRIBUTE_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 2; /** - * The number of structural features of the 'String Attribute Property' class. + * The operation id for the 'Get Feature' operation. * * * @generated * @ordered */ - int STRING_ATTRIBUTE_PROPERTY_FEATURE_COUNT = CLASS_PROPERTY_FEATURE_COUNT + 2; + int STRING_ATTRIBUTE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** * The number of operations of the 'String Attribute Property' class. @@ -759,7 +760,35 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int STRING_ATTRIBUTE_PROPERTY_OPERATION_COUNT = CLASS_PROPERTY_OPERATION_COUNT + 0; + int STRING_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl Step Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepProperty() + * @generated + */ + int STEP_PROPERTY = 11; + + /** + * The number of structural features of the 'Step Property' class. + * + * + * @generated + * @ordered + */ + int STEP_PROPERTY_FEATURE_COUNT = 0; + + /** + * The number of operations of the 'Step Property' class. + * + * + * @generated + * @ordered + */ + int STEP_PROPERTY_OPERATION_COUNT = 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. @@ -769,7 +798,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getOperator() * @generated */ - int OPERATOR = 11; + int OPERATOR = 12; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}' enum. @@ -779,7 +808,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanOperator() * @generated */ - int BOOLEAN_OPERATOR = 12; + int BOOLEAN_OPERATOR = 13; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Quantifier Quantifier}' enum. @@ -789,40 +818,39 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getQuantifier() * @generated */ - int QUANTIFIER = 13; + int QUANTIFIER = 14; /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.ClassProperty Class Property}'. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.StateProperty State Property}'. * * - * @return the meta object for class 'Class Property'. - * @see fr.inria.diverse.event.commons.model.property.ClassProperty + * @return the meta object for class 'State Property'. + * @see fr.inria.diverse.event.commons.model.property.StateProperty * @generated */ - EClass getClassProperty(); + EClass getStateProperty(); /** - * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.property.ClassProperty#getTarget Target}'. + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.property.StateProperty#getTarget Target}'. * * * @return the meta object for the reference 'Target'. - * @see fr.inria.diverse.event.commons.model.property.ClassProperty#getTarget() - * @see #getClassProperty() + * @see fr.inria.diverse.event.commons.model.property.StateProperty#getTarget() + * @see #getStateProperty() * @generated */ - EReference getClassProperty_Target(); + EReference getStateProperty_Target(); /** - * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.property.ClassProperty#getFeature Feature}'. + * Returns the meta object for the '{@link fr.inria.diverse.event.commons.model.property.StateProperty#getFeature() Get Feature}' operation. * * - * @return the meta object for the reference 'Feature'. - * @see fr.inria.diverse.event.commons.model.property.ClassProperty#getFeature() - * @see #getClassProperty() + * @return the meta object for the 'Get Feature' operation. + * @see fr.inria.diverse.event.commons.model.property.StateProperty#getFeature() * @generated */ - EReference getClassProperty_Feature(); + EOperation getStateProperty__GetFeature(); /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty Binary Property}'. @@ -1166,6 +1194,16 @@ public interface PropertyPackage extends EPackage { */ EAttribute getStringAttributeProperty_Operator(); + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.StepProperty Step Property}'. + * + * + * @return the meta object for class 'Step Property'. + * @see fr.inria.diverse.event.commons.model.property.StepProperty + * @generated + */ + EClass getStepProperty(); + /** * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}'. * @@ -1220,14 +1258,14 @@ public interface PropertyPackage extends EPackage { */ interface Literals { /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl Class Property}' class. + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl State Property}' class. * * - * @see fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getClassProperty() + * @see fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStateProperty() * @generated */ - EClass CLASS_PROPERTY = eINSTANCE.getClassProperty(); + EClass STATE_PROPERTY = eINSTANCE.getStateProperty(); /** * The meta object literal for the 'Target' reference feature. @@ -1235,15 +1273,15 @@ interface Literals { * * @generated */ - EReference CLASS_PROPERTY__TARGET = eINSTANCE.getClassProperty_Target(); + EReference STATE_PROPERTY__TARGET = eINSTANCE.getStateProperty_Target(); /** - * The meta object literal for the 'Feature' reference feature. + * The meta object literal for the 'Get Feature' operation. * * * @generated */ - EReference CLASS_PROPERTY__FEATURE = eINSTANCE.getClassProperty_Feature(); + EOperation STATE_PROPERTY___GET_FEATURE = eINSTANCE.getStateProperty__GetFeature(); /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl Binary Property}' class. @@ -1521,6 +1559,16 @@ interface Literals { */ EAttribute STRING_ATTRIBUTE_PROPERTY__OPERATOR = eINSTANCE.getStringAttributeProperty_Operator(); + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl Step Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepProperty() + * @generated + */ + EClass STEP_PROPERTY = eINSTANCE.getStepProperty(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/SingleReferenceProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/SingleReferenceProperty.java index 0a1de206a..4980647fb 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/SingleReferenceProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/SingleReferenceProperty.java @@ -19,7 +19,7 @@ * @model abstract="true" * @generated */ -public interface SingleReferenceProperty

, T> extends ClassProperty { +public interface SingleReferenceProperty

, T> extends StateProperty { /** * Returns the value of the 'Property' containment reference. * @@ -29,7 +29,7 @@ public interface SingleReferenceProperty

, T> extends *

* * @return the value of the 'Property' containment reference. - * @see #setProperty(ClassProperty) + * @see #setProperty(StateProperty) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getSingleReferenceProperty_Property() * @model containment="true" * @generated diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ClassProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StateProperty.java similarity index 58% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ClassProperty.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StateProperty.java index 948dca65e..8ea157223 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ClassProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StateProperty.java @@ -7,22 +7,21 @@ /** * - * A representation of the model object 'Class Property'. + * A representation of the model object 'State Property'. * * *

* The following features are supported: *

*
    - *
  • {@link fr.inria.diverse.event.commons.model.property.ClassProperty#getTarget Target}
  • - *
  • {@link fr.inria.diverse.event.commons.model.property.ClassProperty#getFeature Feature}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.StateProperty#getTarget Target}
  • *
* - * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getClassProperty() + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStateProperty() * @model abstract="true" * @generated */ -public interface ClassProperty extends EObject { +public interface StateProperty extends EObject { /** * Returns the value of the 'Target' reference. * @@ -33,14 +32,14 @@ public interface ClassProperty extends EObject { * * @return the value of the 'Target' reference. * @see #setTarget(Object) - * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getClassProperty_Target() + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStateProperty_Target() * @model kind="reference" * @generated */ T getTarget(); /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ClassProperty#getTarget Target}' reference. + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.StateProperty#getTarget Target}' reference. * * * @param value the new value of the 'Target' reference. @@ -50,18 +49,11 @@ public interface ClassProperty extends EObject { void setTarget(T value); /** - * Returns the value of the 'Feature' reference. * - *

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

* - * @return the value of the 'Feature' reference. - * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getClassProperty_Feature() - * @model transient="true" changeable="false" derived="true" + * @model kind="operation" * @generated */ EStructuralFeature getFeature(); -} // ClassProperty +} // StateProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java new file mode 100644 index 000000000..b2ff2a6bb --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java @@ -0,0 +1,18 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Step Property'. + * + * + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStepProperty() + * @model + * @generated + */ +public interface StepProperty extends EObject { +} // StepProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java index 06e039406..83e04e95e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java @@ -20,7 +20,7 @@ * @model abstract="true" * @generated */ -public interface StringAttributeProperty extends ClassProperty { +public interface StringAttributeProperty extends StateProperty { /** * Returns the value of the 'Value' attribute. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BinaryPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BinaryPropertyImpl.java index a000d57f9..3104f4d09 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BinaryPropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BinaryPropertyImpl.java @@ -4,8 +4,8 @@ import fr.inria.diverse.event.commons.model.property.BinaryProperty; import fr.inria.diverse.event.commons.model.property.BooleanOperator; -import fr.inria.diverse.event.commons.model.property.ClassProperty; import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.StateProperty; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; @@ -30,7 +30,7 @@ * * @generated */ -public abstract class BinaryPropertyImpl

, T> extends ClassPropertyImpl implements BinaryProperty { +public abstract class BinaryPropertyImpl

, T> extends StatePropertyImpl implements BinaryProperty { /** * The default value of the '{@link #getOperator() Operator}' attribute. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java index b824e984e..70a4fc829 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java @@ -26,7 +26,7 @@ * * @generated */ -public abstract class BooleanAttributePropertyImpl extends ClassPropertyImpl implements BooleanAttributeProperty { +public abstract class BooleanAttributePropertyImpl extends StatePropertyImpl implements BooleanAttributeProperty { /** * The default value of the '{@link #isValue() Value}' attribute. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ContainerReferencePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ContainerReferencePropertyImpl.java index ee26d6bb4..a22c601a1 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ContainerReferencePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ContainerReferencePropertyImpl.java @@ -2,9 +2,9 @@ */ package fr.inria.diverse.event.commons.model.property.impl; -import fr.inria.diverse.event.commons.model.property.ClassProperty; import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty; import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.StateProperty; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; @@ -27,7 +27,7 @@ * * @generated */ -public class ContainerReferencePropertyImpl

, T> extends ClassPropertyImpl implements ContainerReferenceProperty { +public class ContainerReferencePropertyImpl

, T> extends StatePropertyImpl implements ContainerReferenceProperty { /** * The cached value of the '{@link #getProperty() Property}' containment reference. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java index 4e006ab67..2b572243b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java @@ -26,7 +26,7 @@ * * @generated */ -public abstract class IntegerAttributePropertyImpl extends ClassPropertyImpl implements IntegerAttributeProperty { +public abstract class IntegerAttributePropertyImpl extends StatePropertyImpl implements IntegerAttributeProperty { /** * The default value of the '{@link #getValue() Value}' attribute. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java index e2dd54e41..521d7661a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java @@ -6,7 +6,9 @@ import fr.inria.diverse.event.commons.model.property.Operator; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.Quantifier; + import org.eclipse.emf.common.notify.Notification; + import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -26,7 +28,7 @@ * * @generated */ -public class ManyBooleanAttributePropertyImpl extends ClassPropertyImpl implements ManyBooleanAttributeProperty { +public class ManyBooleanAttributePropertyImpl extends StatePropertyImpl implements ManyBooleanAttributeProperty { /** * The default value of the '{@link #getQuantifier() Quantifier}' attribute. * @@ -203,7 +205,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { * * @generated */ - @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java index 43073b134..aba92556b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java @@ -6,7 +6,9 @@ import fr.inria.diverse.event.commons.model.property.Operator; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.Quantifier; + import org.eclipse.emf.common.notify.Notification; + import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -26,7 +28,7 @@ * * @generated */ -public class ManyIntegerAttributePropertyImpl extends ClassPropertyImpl implements ManyIntegerAttributeProperty { +public class ManyIntegerAttributePropertyImpl extends StatePropertyImpl implements ManyIntegerAttributeProperty { /** * The default value of the '{@link #getQuantifier() Quantifier}' attribute. * @@ -203,7 +205,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { * * @generated */ - @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyReferencePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyReferencePropertyImpl.java index 805348f34..7d2eb1989 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyReferencePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyReferencePropertyImpl.java @@ -2,10 +2,10 @@ */ package fr.inria.diverse.event.commons.model.property.impl; -import fr.inria.diverse.event.commons.model.property.ClassProperty; import fr.inria.diverse.event.commons.model.property.ManyReferenceProperty; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.Quantifier; +import fr.inria.diverse.event.commons.model.property.StateProperty; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; @@ -29,7 +29,7 @@ * * @generated */ -public abstract class ManyReferencePropertyImpl

, T> extends ClassPropertyImpl implements ManyReferenceProperty { +public abstract class ManyReferencePropertyImpl

, T> extends StatePropertyImpl implements ManyReferenceProperty { /** * The cached value of the '{@link #getProperty() Property}' containment reference. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java index 323447880..434857f35 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java @@ -6,7 +6,9 @@ import fr.inria.diverse.event.commons.model.property.Operator; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.Quantifier; + import org.eclipse.emf.common.notify.Notification; + import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -26,7 +28,7 @@ * * @generated */ -public class ManyStringAttributePropertyImpl extends ClassPropertyImpl implements ManyStringAttributeProperty { +public class ManyStringAttributePropertyImpl extends StatePropertyImpl implements ManyStringAttributeProperty { /** * The default value of the '{@link #getQuantifier() Quantifier}' attribute. * @@ -203,7 +205,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { * * @generated */ - @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java index 41ebc4042..c62daadc1 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java @@ -61,6 +61,7 @@ public EObject create(EClass eClass) { case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY: return createManyBooleanAttributeProperty(); case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY: return createManyIntegerAttributeProperty(); case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY: return createManyStringAttributeProperty(); + case PropertyPackage.STEP_PROPERTY: return createStepProperty(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -109,7 +110,7 @@ public String convertToString(EDataType eDataType, Object instanceValue) { * * @generated */ - public

, T> ContainerReferenceProperty createContainerReferenceProperty() { + public

, T> ContainerReferenceProperty createContainerReferenceProperty() { ContainerReferencePropertyImpl containerReferenceProperty = new ContainerReferencePropertyImpl(); return containerReferenceProperty; } @@ -144,6 +145,16 @@ public ManyStringAttributeProperty createManyStringAttributeProperty() { return manyStringAttributeProperty; } + /** + * + * + * @generated + */ + public StepProperty createStepProperty() { + StepPropertyImpl stepProperty = new StepPropertyImpl(); + return stepProperty; + } + /** * * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java index 97a7f78aa..f04128c3d 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java @@ -5,7 +5,6 @@ import fr.inria.diverse.event.commons.model.property.BinaryProperty; import fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty; import fr.inria.diverse.event.commons.model.property.BooleanOperator; -import fr.inria.diverse.event.commons.model.property.ClassProperty; import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty; import fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty; import fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty; @@ -17,12 +16,15 @@ import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.Quantifier; import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty; +import fr.inria.diverse.event.commons.model.property.StateProperty; +import fr.inria.diverse.event.commons.model.property.StepProperty; import fr.inria.diverse.event.commons.model.property.StringAttributeProperty; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EEnum; import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.ETypeParameter; @@ -42,7 +44,7 @@ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage * * @generated */ - private EClass classPropertyEClass = null; + private EClass statePropertyEClass = null; /** * @@ -114,6 +116,13 @@ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage */ private EClass stringAttributePropertyEClass = null; + /** + * + * + * @generated + */ + private EClass stepPropertyEClass = null; + /** * * @@ -204,8 +213,8 @@ public static PropertyPackage init() { * * @generated */ - public EClass getClassProperty() { - return classPropertyEClass; + public EClass getStateProperty() { + return statePropertyEClass; } /** @@ -213,8 +222,8 @@ public EClass getClassProperty() { * * @generated */ - public EReference getClassProperty_Target() { - return (EReference)classPropertyEClass.getEStructuralFeatures().get(0); + public EReference getStateProperty_Target() { + return (EReference)statePropertyEClass.getEStructuralFeatures().get(0); } /** @@ -222,8 +231,8 @@ public EReference getClassProperty_Target() { * * @generated */ - public EReference getClassProperty_Feature() { - return (EReference)classPropertyEClass.getEStructuralFeatures().get(1); + public EOperation getStateProperty__GetFeature() { + return statePropertyEClass.getEOperations().get(0); } /** @@ -514,6 +523,15 @@ public EAttribute getStringAttributeProperty_Operator() { return (EAttribute)stringAttributePropertyEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + public EClass getStepProperty() { + return stepPropertyEClass; + } + /** * * @@ -569,9 +587,9 @@ public void createPackageContents() { isCreated = true; // Create classes and their features - classPropertyEClass = createEClass(CLASS_PROPERTY); - createEReference(classPropertyEClass, CLASS_PROPERTY__TARGET); - createEReference(classPropertyEClass, CLASS_PROPERTY__FEATURE); + statePropertyEClass = createEClass(STATE_PROPERTY); + createEReference(statePropertyEClass, STATE_PROPERTY__TARGET); + createEOperation(statePropertyEClass, STATE_PROPERTY___GET_FEATURE); binaryPropertyEClass = createEClass(BINARY_PROPERTY); createEAttribute(binaryPropertyEClass, BINARY_PROPERTY__OPERATOR); @@ -615,6 +633,8 @@ public void createPackageContents() { createEAttribute(stringAttributePropertyEClass, STRING_ATTRIBUTE_PROPERTY__VALUE); createEAttribute(stringAttributePropertyEClass, STRING_ATTRIBUTE_PROPERTY__OPERATOR); + stepPropertyEClass = createEClass(STEP_PROPERTY); + // Create enums operatorEEnum = createEEnum(OPERATOR); booleanOperatorEEnum = createEEnum(BOOLEAN_OPERATOR); @@ -648,7 +668,7 @@ public void initializePackageContents() { EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); // Create type parameters - ETypeParameter classPropertyEClass_T = addETypeParameter(classPropertyEClass, "T"); + ETypeParameter statePropertyEClass_T = addETypeParameter(statePropertyEClass, "T"); ETypeParameter binaryPropertyEClass_P = addETypeParameter(binaryPropertyEClass, "P"); ETypeParameter binaryPropertyEClass_T = addETypeParameter(binaryPropertyEClass, "T"); ETypeParameter manyReferencePropertyEClass_P = addETypeParameter(manyReferencePropertyEClass, "P"); @@ -665,70 +685,71 @@ public void initializePackageContents() { ETypeParameter stringAttributePropertyEClass_T = addETypeParameter(stringAttributePropertyEClass, "T"); // Set bounds for type parameters - EGenericType g1 = createEGenericType(this.getClassProperty()); + EGenericType g1 = createEGenericType(this.getStateProperty()); EGenericType g2 = createEGenericType(); g1.getETypeArguments().add(g2); binaryPropertyEClass_P.getEBounds().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); manyReferencePropertyEClass_P.getEBounds().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); singleReferencePropertyEClass_P.getEBounds().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); containerReferencePropertyEClass_P.getEBounds().add(g1); // Add supertypes to classes - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(binaryPropertyEClass_T); g1.getETypeArguments().add(g2); binaryPropertyEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(manyReferencePropertyEClass_T); g1.getETypeArguments().add(g2); manyReferencePropertyEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(singleReferencePropertyEClass_T); g1.getETypeArguments().add(g2); singleReferencePropertyEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(containerReferencePropertyEClass_T); g1.getETypeArguments().add(g2); containerReferencePropertyEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(manyBooleanAttributePropertyEClass_T); g1.getETypeArguments().add(g2); manyBooleanAttributePropertyEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(manyIntegerAttributePropertyEClass_T); g1.getETypeArguments().add(g2); manyIntegerAttributePropertyEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(manyStringAttributePropertyEClass_T); g1.getETypeArguments().add(g2); manyStringAttributePropertyEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(booleanAttributePropertyEClass_T); g1.getETypeArguments().add(g2); booleanAttributePropertyEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(integerAttributePropertyEClass_T); g1.getETypeArguments().add(g2); integerAttributePropertyEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getClassProperty()); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(stringAttributePropertyEClass_T); g1.getETypeArguments().add(g2); stringAttributePropertyEClass.getEGenericSuperTypes().add(g1); // Initialize classes, features, and operations; add parameters - initEClass(classPropertyEClass, ClassProperty.class, "ClassProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(classPropertyEClass_T); - initEReference(getClassProperty_Target(), g1, null, "target", null, 0, 1, ClassProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getClassProperty_Feature(), theEcorePackage.getEStructuralFeature(), null, "feature", null, 0, 1, ClassProperty.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEClass(statePropertyEClass, StateProperty.class, "StateProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(statePropertyEClass_T); + initEReference(getStateProperty_Target(), g1, null, "target", null, 0, 1, StateProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEOperation(getStateProperty__GetFeature(), theEcorePackage.getEStructuralFeature(), "getFeature", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass(binaryPropertyEClass, BinaryProperty.class, "BinaryProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getBinaryProperty_Operator(), this.getBooleanOperator(), "operator", null, 1, 1, BinaryProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -777,6 +798,8 @@ public void initializePackageContents() { initEAttribute(getStringAttributeProperty_Value(), theEcorePackage.getEString(), "value", null, 0, 1, StringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getStringAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, StringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(stepPropertyEClass, StepProperty.class, "StepProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + // Initialize enums and add enum literals initEEnum(operatorEEnum, Operator.class, "Operator"); addEEnumLiteral(operatorEEnum, Operator.EQUAL); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/SingleReferencePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/SingleReferencePropertyImpl.java index a1c80211b..6959faf20 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/SingleReferencePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/SingleReferencePropertyImpl.java @@ -2,9 +2,9 @@ */ package fr.inria.diverse.event.commons.model.property.impl; -import fr.inria.diverse.event.commons.model.property.ClassProperty; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty; +import fr.inria.diverse.event.commons.model.property.StateProperty; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; @@ -27,7 +27,7 @@ * * @generated */ -public abstract class SingleReferencePropertyImpl

, T> extends ClassPropertyImpl implements SingleReferenceProperty { +public abstract class SingleReferencePropertyImpl

, T> extends StatePropertyImpl implements SingleReferenceProperty { /** * The cached value of the '{@link #getProperty() Property}' containment reference. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ClassPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StatePropertyImpl.java similarity index 65% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ClassPropertyImpl.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StatePropertyImpl.java index 5a7507716..b3140e92f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ClassPropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StatePropertyImpl.java @@ -2,11 +2,15 @@ */ package fr.inria.diverse.event.commons.model.property.impl; -import fr.inria.diverse.event.commons.model.property.ClassProperty; import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.StateProperty; + +import java.lang.reflect.InvocationTargetException; 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.EObject; import org.eclipse.emf.ecore.EStructuralFeature; @@ -17,19 +21,18 @@ /** * - * An implementation of the model object 'Class Property'. + * An implementation of the model object 'State Property'. * *

* The following features are implemented: *

*
    - *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl#getTarget Target}
  • - *
  • {@link fr.inria.diverse.event.commons.model.property.impl.ClassPropertyImpl#getFeature Feature}
  • + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl#getTarget Target}
  • *
* * @generated */ -public abstract class ClassPropertyImpl extends MinimalEObjectImpl.Container implements ClassProperty { +public abstract class StatePropertyImpl extends MinimalEObjectImpl.Container implements StateProperty { /** * The cached value of the '{@link #getTarget() Target}' reference. * @@ -40,22 +43,12 @@ public abstract class ClassPropertyImpl extends MinimalEObjectImpl.Container */ protected T target; - /** - * The cached value of the '{@link #getFeature() Feature}' reference. - * - * - * @see #getFeature() - * @generated - * @ordered - */ - protected EStructuralFeature feature; - /** * * * @generated */ - protected ClassPropertyImpl() { + protected StatePropertyImpl() { super(); } @@ -66,7 +59,7 @@ protected ClassPropertyImpl() { */ @Override protected EClass eStaticClass() { - return PropertyPackage.Literals.CLASS_PROPERTY; + return PropertyPackage.Literals.STATE_PROPERTY; } /** @@ -81,7 +74,7 @@ public T getTarget() { target = (T)eResolveProxy(oldTarget); if (target != oldTarget) { if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertyPackage.CLASS_PROPERTY__TARGET, oldTarget, target)); + eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertyPackage.STATE_PROPERTY__TARGET, oldTarget, target)); } } return target; @@ -105,7 +98,7 @@ public void setTarget(T newTarget) { T oldTarget = target; target = newTarget; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.CLASS_PROPERTY__TARGET, oldTarget, target)); + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.STATE_PROPERTY__TARGET, oldTarget, target)); } /** @@ -114,24 +107,9 @@ public void setTarget(T newTarget) { * @generated */ public EStructuralFeature getFeature() { - if (feature != null && feature.eIsProxy()) { - InternalEObject oldFeature = (InternalEObject)feature; - feature = (EStructuralFeature)eResolveProxy(oldFeature); - if (feature != oldFeature) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertyPackage.CLASS_PROPERTY__FEATURE, oldFeature, feature)); - } - } - return feature; - } - - /** - * - * - * @generated - */ - public EStructuralFeature basicGetFeature() { - return feature; + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); } /** @@ -142,12 +120,9 @@ public EStructuralFeature basicGetFeature() { @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case PropertyPackage.CLASS_PROPERTY__TARGET: + case PropertyPackage.STATE_PROPERTY__TARGET: if (resolve) return getTarget(); return basicGetTarget(); - case PropertyPackage.CLASS_PROPERTY__FEATURE: - if (resolve) return getFeature(); - return basicGetFeature(); } return super.eGet(featureID, resolve, coreType); } @@ -161,7 +136,7 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case PropertyPackage.CLASS_PROPERTY__TARGET: + case PropertyPackage.STATE_PROPERTY__TARGET: setTarget((T)newValue); return; } @@ -176,7 +151,7 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case PropertyPackage.CLASS_PROPERTY__TARGET: + case PropertyPackage.STATE_PROPERTY__TARGET: setTarget((T)null); return; } @@ -191,12 +166,24 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case PropertyPackage.CLASS_PROPERTY__TARGET: + case PropertyPackage.STATE_PROPERTY__TARGET: return target != null; - case PropertyPackage.CLASS_PROPERTY__FEATURE: - return feature != null; } return super.eIsSet(featureID); } -} //ClassPropertyImpl + /** + * + * + * @generated + */ + @Override + public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { + switch (operationID) { + case PropertyPackage.STATE_PROPERTY___GET_FEATURE: + return getFeature(); + } + return super.eInvoke(operationID, arguments); + } + +} //StatePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java new file mode 100644 index 000000000..143a1695b --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java @@ -0,0 +1,39 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.StepProperty; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Step Property'. + * + * + * @generated + */ +public class StepPropertyImpl extends MinimalEObjectImpl.Container implements StepProperty { + /** + * + * + * @generated + */ + protected StepPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.STEP_PROPERTY; + } + +} //StepPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java index 8a4de2749..502a1b238 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java @@ -26,7 +26,7 @@ * * @generated */ -public abstract class StringAttributePropertyImpl extends ClassPropertyImpl implements StringAttributeProperty { +public abstract class StringAttributePropertyImpl extends StatePropertyImpl implements StringAttributeProperty { /** * The default value of the '{@link #getValue() Value}' attribute. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java index 8f34511f6..738b7e7d4 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java @@ -68,23 +68,23 @@ public boolean isFactoryForType(Object object) { protected PropertySwitch modelSwitch = new PropertySwitch() { @Override - public Adapter caseClassProperty(ClassProperty object) { - return createClassPropertyAdapter(); + public Adapter caseStateProperty(StateProperty object) { + return createStatePropertyAdapter(); } @Override - public

, T> Adapter caseBinaryProperty(BinaryProperty object) { + public

, T> Adapter caseBinaryProperty(BinaryProperty object) { return createBinaryPropertyAdapter(); } @Override - public

, T> Adapter caseManyReferenceProperty(ManyReferenceProperty object) { + public

, T> Adapter caseManyReferenceProperty(ManyReferenceProperty object) { return createManyReferencePropertyAdapter(); } @Override - public

, T> Adapter caseSingleReferenceProperty(SingleReferenceProperty object) { + public

, T> Adapter caseSingleReferenceProperty(SingleReferenceProperty object) { return createSingleReferencePropertyAdapter(); } @Override - public

, T> Adapter caseContainerReferenceProperty(ContainerReferenceProperty object) { + public

, T> Adapter caseContainerReferenceProperty(ContainerReferenceProperty object) { return createContainerReferencePropertyAdapter(); } @Override @@ -112,6 +112,10 @@ public Adapter caseStringAttributeProperty(StringAttributeProperty object return createStringAttributePropertyAdapter(); } @Override + public Adapter caseStepProperty(StepProperty object) { + return createStepPropertyAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -132,16 +136,16 @@ public Adapter createAdapter(Notifier target) { /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.ClassProperty Class Property}'. + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.StateProperty State 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 fr.inria.diverse.event.commons.model.property.ClassProperty + * @see fr.inria.diverse.event.commons.model.property.StateProperty * @generated */ - public Adapter createClassPropertyAdapter() { + public Adapter createStatePropertyAdapter() { return null; } @@ -285,6 +289,20 @@ public Adapter createStringAttributePropertyAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.StepProperty Step 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 fr.inria.diverse.event.commons.model.property.StepProperty + * @generated + */ + public Adapter createStepPropertyAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java index aeda1bbd1..d820c14fb 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java @@ -66,79 +66,85 @@ protected boolean isSwitchFor(EPackage ePackage) { @Override protected T1 doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { - case PropertyPackage.CLASS_PROPERTY: { - ClassProperty classProperty = (ClassProperty)theEObject; - T1 result = caseClassProperty(classProperty); + case PropertyPackage.STATE_PROPERTY: { + StateProperty stateProperty = (StateProperty)theEObject; + T1 result = caseStateProperty(stateProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.BINARY_PROPERTY: { BinaryProperty binaryProperty = (BinaryProperty)theEObject; T1 result = caseBinaryProperty(binaryProperty); - if (result == null) result = caseClassProperty(binaryProperty); + if (result == null) result = caseStateProperty(binaryProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.MANY_REFERENCE_PROPERTY: { ManyReferenceProperty manyReferenceProperty = (ManyReferenceProperty)theEObject; T1 result = caseManyReferenceProperty(manyReferenceProperty); - if (result == null) result = caseClassProperty(manyReferenceProperty); + if (result == null) result = caseStateProperty(manyReferenceProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.SINGLE_REFERENCE_PROPERTY: { SingleReferenceProperty singleReferenceProperty = (SingleReferenceProperty)theEObject; T1 result = caseSingleReferenceProperty(singleReferenceProperty); - if (result == null) result = caseClassProperty(singleReferenceProperty); + if (result == null) result = caseStateProperty(singleReferenceProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.CONTAINER_REFERENCE_PROPERTY: { ContainerReferenceProperty containerReferenceProperty = (ContainerReferenceProperty)theEObject; T1 result = caseContainerReferenceProperty(containerReferenceProperty); - if (result == null) result = caseClassProperty(containerReferenceProperty); + if (result == null) result = caseStateProperty(containerReferenceProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY: { ManyBooleanAttributeProperty manyBooleanAttributeProperty = (ManyBooleanAttributeProperty)theEObject; T1 result = caseManyBooleanAttributeProperty(manyBooleanAttributeProperty); - if (result == null) result = caseClassProperty(manyBooleanAttributeProperty); + if (result == null) result = caseStateProperty(manyBooleanAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY: { ManyIntegerAttributeProperty manyIntegerAttributeProperty = (ManyIntegerAttributeProperty)theEObject; T1 result = caseManyIntegerAttributeProperty(manyIntegerAttributeProperty); - if (result == null) result = caseClassProperty(manyIntegerAttributeProperty); + if (result == null) result = caseStateProperty(manyIntegerAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY: { ManyStringAttributeProperty manyStringAttributeProperty = (ManyStringAttributeProperty)theEObject; T1 result = caseManyStringAttributeProperty(manyStringAttributeProperty); - if (result == null) result = caseClassProperty(manyStringAttributeProperty); + if (result == null) result = caseStateProperty(manyStringAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY: { BooleanAttributeProperty booleanAttributeProperty = (BooleanAttributeProperty)theEObject; T1 result = caseBooleanAttributeProperty(booleanAttributeProperty); - if (result == null) result = caseClassProperty(booleanAttributeProperty); + if (result == null) result = caseStateProperty(booleanAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY: { IntegerAttributeProperty integerAttributeProperty = (IntegerAttributeProperty)theEObject; T1 result = caseIntegerAttributeProperty(integerAttributeProperty); - if (result == null) result = caseClassProperty(integerAttributeProperty); + if (result == null) result = caseStateProperty(integerAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.STRING_ATTRIBUTE_PROPERTY: { StringAttributeProperty stringAttributeProperty = (StringAttributeProperty)theEObject; T1 result = caseStringAttributeProperty(stringAttributeProperty); - if (result == null) result = caseClassProperty(stringAttributeProperty); + if (result == null) result = caseStateProperty(stringAttributeProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.STEP_PROPERTY: { + StepProperty stepProperty = (StepProperty)theEObject; + T1 result = caseStepProperty(stepProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -147,17 +153,17 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { } /** - * Returns the result of interpreting the object as an instance of 'Class Property'. + * Returns the result of interpreting the object as an instance of 'State 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 'Class Property'. + * @return the result of interpreting the object as an instance of 'State Property'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public T1 caseClassProperty(ClassProperty object) { + public T1 caseStateProperty(StateProperty object) { return null; } @@ -172,7 +178,7 @@ public T1 caseClassProperty(ClassProperty object) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public

, T> T1 caseBinaryProperty(BinaryProperty object) { + public

, T> T1 caseBinaryProperty(BinaryProperty object) { return null; } @@ -187,7 +193,7 @@ public

, T> T1 caseBinaryProperty(BinaryProperty, T> T1 caseManyReferenceProperty(ManyReferenceProperty object) { + public

, T> T1 caseManyReferenceProperty(ManyReferenceProperty object) { return null; } @@ -202,7 +208,7 @@ public

, T> T1 caseManyReferenceProperty(ManyReferenc * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public

, T> T1 caseSingleReferenceProperty(SingleReferenceProperty object) { + public

, T> T1 caseSingleReferenceProperty(SingleReferenceProperty object) { return null; } @@ -217,7 +223,7 @@ public

, T> T1 caseSingleReferenceProperty(SingleRefe * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public

, T> T1 caseContainerReferenceProperty(ContainerReferenceProperty object) { + public

, T> T1 caseContainerReferenceProperty(ContainerReferenceProperty object) { return null; } @@ -311,6 +317,21 @@ public T1 caseStringAttributeProperty(StringAttributeProperty object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Step 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 'Step Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseStepProperty(StepProperty object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventParameter.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventParameter.java new file mode 100644 index 000000000..4275a09cf --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventParameter.java @@ -0,0 +1,18 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Event Parameter'. + * + * + * + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getEventParameter() + * @model + * @generated + */ +public interface EventParameter extends EObject { +} // EventParameter diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventReport.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventReport.java new file mode 100644 index 000000000..a84f2f0aa --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventReport.java @@ -0,0 +1,98 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report; + +import fr.inria.diverse.event.commons.model.scenario.Event; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Event Report'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.report.EventReport#getEvent Event}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.EventReport#getMatches Matches}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.EventReport#getTarget Target}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getEventReport() + * @model + * @generated + */ +public interface EventReport extends EObject { + /** + * Returns the value of the 'Event' reference. + * + *

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

+ * + * @return the value of the 'Event' reference. + * @see #setEvent(Event) + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getEventReport_Event() + * @model + * @generated + */ + Event getEvent(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.report.EventReport#getEvent Event}' reference. + * + * + * @param value the new value of the 'Event' reference. + * @see #getEvent() + * @generated + */ + void setEvent(Event value); + + /** + * Returns the value of the 'Matches' reference list. + * The list contents are of type {@link fr.inria.diverse.event.commons.model.report.EventParameter}. + * + *

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

+ * + * @return the value of the 'Matches' reference list. + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getEventReport_Matches() + * @model + * @generated + */ + EList getMatches(); + + /** + * Returns the value of the 'Target' reference. + * + *

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

+ * + * @return the value of the 'Target' reference. + * @see #setTarget(EObject) + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getEventReport_Target() + * @model + * @generated + */ + EObject getTarget(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.report.EventReport#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(EObject value); + +} // EventReport diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java index 3b2ea97c0..9926c4bb9 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java @@ -3,6 +3,7 @@ package fr.inria.diverse.event.commons.model.report; import org.eclipse.emf.common.util.EList; + import org.eclipse.emf.ecore.EObject; /** @@ -27,7 +28,7 @@ public interface Report extends EObject { * The list contents are of type {@link fr.inria.diverse.event.commons.model.report.StageReport}. * *

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

* diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java index f06bdee2d..5e4be268c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java @@ -39,6 +39,24 @@ public interface ReportFactory extends EFactory { */ StageReport createStageReport(); + /** + * Returns a new object of class 'Event Report'. + * + * + * @return a new object of class 'Event Report'. + * @generated + */ + EventReport createEventReport(); + + /** + * Returns a new object of class 'Event Parameter'. + * + * + * @return a new object of class 'Event Parameter'. + * @generated + */ + EventParameter createEventParameter(); + /** * Returns the package supported by this factory. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java index 4638e65d1..d07b6c781 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java @@ -120,6 +120,15 @@ public interface ReportPackage extends EPackage { */ int STAGE_REPORT__MATCHES = 1; + /** + * The feature id for the 'Events' containment reference list. + * + * + * @generated + * @ordered + */ + int STAGE_REPORT__EVENTS = 2; + /** * The number of structural features of the 'Stage Report' class. * @@ -127,7 +136,7 @@ public interface ReportPackage extends EPackage { * @generated * @ordered */ - int STAGE_REPORT_FEATURE_COUNT = 2; + int STAGE_REPORT_FEATURE_COUNT = 3; /** * The number of operations of the 'Stage Report' class. @@ -138,6 +147,89 @@ public interface ReportPackage extends EPackage { */ int STAGE_REPORT_OPERATION_COUNT = 0; + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl Event Report}' class. + * + * + * @see fr.inria.diverse.event.commons.model.report.impl.EventReportImpl + * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getEventReport() + * @generated + */ + int EVENT_REPORT = 2; + + /** + * The feature id for the 'Event' reference. + * + * + * @generated + * @ordered + */ + int EVENT_REPORT__EVENT = 0; + + /** + * The feature id for the 'Matches' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_REPORT__MATCHES = 1; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int EVENT_REPORT__TARGET = 2; + + /** + * The number of structural features of the 'Event Report' class. + * + * + * @generated + * @ordered + */ + int EVENT_REPORT_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Event Report' class. + * + * + * @generated + * @ordered + */ + int EVENT_REPORT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.report.impl.EventParameterImpl Event Parameter}' class. + * + * + * @see fr.inria.diverse.event.commons.model.report.impl.EventParameterImpl + * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getEventParameter() + * @generated + */ + int EVENT_PARAMETER = 3; + + /** + * The number of structural features of the 'Event Parameter' class. + * + * + * @generated + * @ordered + */ + int EVENT_PARAMETER_FEATURE_COUNT = 0; + + /** + * The number of operations of the 'Event Parameter' class. + * + * + * @generated + * @ordered + */ + int EVENT_PARAMETER_OPERATION_COUNT = 0; + /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.report.Report Report}'. @@ -192,6 +284,70 @@ public interface ReportPackage extends EPackage { */ EReference getStageReport_Matches(); + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.report.StageReport#getEvents Events}'. + * + * + * @return the meta object for the containment reference list 'Events'. + * @see fr.inria.diverse.event.commons.model.report.StageReport#getEvents() + * @see #getStageReport() + * @generated + */ + EReference getStageReport_Events(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.report.EventReport Event Report}'. + * + * + * @return the meta object for class 'Event Report'. + * @see fr.inria.diverse.event.commons.model.report.EventReport + * @generated + */ + EClass getEventReport(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.report.EventReport#getEvent Event}'. + * + * + * @return the meta object for the reference 'Event'. + * @see fr.inria.diverse.event.commons.model.report.EventReport#getEvent() + * @see #getEventReport() + * @generated + */ + EReference getEventReport_Event(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.report.EventReport#getMatches Matches}'. + * + * + * @return the meta object for the reference list 'Matches'. + * @see fr.inria.diverse.event.commons.model.report.EventReport#getMatches() + * @see #getEventReport() + * @generated + */ + EReference getEventReport_Matches(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.report.EventReport#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see fr.inria.diverse.event.commons.model.report.EventReport#getTarget() + * @see #getEventReport() + * @generated + */ + EReference getEventReport_Target(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.report.EventParameter Event Parameter}'. + * + * + * @return the meta object for class 'Event Parameter'. + * @see fr.inria.diverse.event.commons.model.report.EventParameter + * @generated + */ + EClass getEventParameter(); + /** * Returns the factory that creates the instances of the model. * @@ -259,6 +415,58 @@ interface Literals { */ EReference STAGE_REPORT__MATCHES = eINSTANCE.getStageReport_Matches(); + /** + * The meta object literal for the 'Events' containment reference list feature. + * + * + * @generated + */ + EReference STAGE_REPORT__EVENTS = eINSTANCE.getStageReport_Events(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl Event Report}' class. + * + * + * @see fr.inria.diverse.event.commons.model.report.impl.EventReportImpl + * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getEventReport() + * @generated + */ + EClass EVENT_REPORT = eINSTANCE.getEventReport(); + + /** + * The meta object literal for the 'Event' reference feature. + * + * + * @generated + */ + EReference EVENT_REPORT__EVENT = eINSTANCE.getEventReport_Event(); + + /** + * The meta object literal for the 'Matches' reference list feature. + * + * + * @generated + */ + EReference EVENT_REPORT__MATCHES = eINSTANCE.getEventReport_Matches(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference EVENT_REPORT__TARGET = eINSTANCE.getEventReport_Target(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.report.impl.EventParameterImpl Event Parameter}' class. + * + * + * @see fr.inria.diverse.event.commons.model.report.impl.EventParameterImpl + * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getEventParameter() + * @generated + */ + EClass EVENT_PARAMETER = eINSTANCE.getEventParameter(); + } } //ReportPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java index aa0196ec0..6f7fb9d20 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java @@ -19,6 +19,7 @@ *
    *
  • {@link fr.inria.diverse.event.commons.model.report.StageReport#getStage Stage}
  • *
  • {@link fr.inria.diverse.event.commons.model.report.StageReport#getMatches Matches}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.StageReport#getEvents Events}
  • *
* * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getStageReport() @@ -68,4 +69,20 @@ public interface StageReport extends EObject { */ EList getMatches(); + /** + * Returns the value of the 'Events' containment reference list. + * The list contents are of type {@link fr.inria.diverse.event.commons.model.report.EventReport}. + * + *

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

+ * + * @return the value of the 'Events' containment reference list. + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getStageReport_Events() + * @model containment="true" + * @generated + */ + EList getEvents(); + } // StageReport diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventParameterImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventParameterImpl.java new file mode 100644 index 000000000..0918e26ca --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventParameterImpl.java @@ -0,0 +1,39 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.impl; + +import fr.inria.diverse.event.commons.model.report.EventParameter; +import fr.inria.diverse.event.commons.model.report.ReportPackage; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Event Parameter'. + * + * + * @generated + */ +public class EventParameterImpl extends MinimalEObjectImpl.Container implements EventParameter { + /** + * + * + * @generated + */ + protected EventParameterImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ReportPackage.Literals.EVENT_PARAMETER; + } + +} //EventParameterImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventReportImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventReportImpl.java new file mode 100644 index 000000000..2ced8e846 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventReportImpl.java @@ -0,0 +1,261 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.impl; + +import fr.inria.diverse.event.commons.model.report.EventParameter; +import fr.inria.diverse.event.commons.model.report.EventReport; +import fr.inria.diverse.event.commons.model.report.ReportPackage; + +import fr.inria.diverse.event.commons.model.scenario.Event; + +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.EObject; +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.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Event Report'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl#getEvent Event}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl#getMatches Matches}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl#getTarget Target}
  • + *
+ * + * @generated + */ +public class EventReportImpl extends MinimalEObjectImpl.Container implements EventReport { + /** + * The cached value of the '{@link #getEvent() Event}' reference. + * + * + * @see #getEvent() + * @generated + * @ordered + */ + protected Event event; + + /** + * The cached value of the '{@link #getMatches() Matches}' reference list. + * + * + * @see #getMatches() + * @generated + * @ordered + */ + protected EList matches; + + /** + * The cached value of the '{@link #getTarget() Target}' reference. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected EObject target; + + /** + * + * + * @generated + */ + protected EventReportImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ReportPackage.Literals.EVENT_REPORT; + } + + /** + * + * + * @generated + */ + public Event getEvent() { + if (event != null && event.eIsProxy()) { + InternalEObject oldEvent = (InternalEObject)event; + event = (Event)eResolveProxy(oldEvent); + if (event != oldEvent) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReportPackage.EVENT_REPORT__EVENT, oldEvent, event)); + } + } + return event; + } + + /** + * + * + * @generated + */ + public Event basicGetEvent() { + return event; + } + + /** + * + * + * @generated + */ + public void setEvent(Event newEvent) { + Event oldEvent = event; + event = newEvent; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ReportPackage.EVENT_REPORT__EVENT, oldEvent, event)); + } + + /** + * + * + * @generated + */ + public EList getMatches() { + if (matches == null) { + matches = new EObjectResolvingEList(EventParameter.class, this, ReportPackage.EVENT_REPORT__MATCHES); + } + return matches; + } + + /** + * + * + * @generated + */ + public EObject getTarget() { + if (target != null && target.eIsProxy()) { + InternalEObject oldTarget = (InternalEObject)target; + target = eResolveProxy(oldTarget); + if (target != oldTarget) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReportPackage.EVENT_REPORT__TARGET, oldTarget, target)); + } + } + return target; + } + + /** + * + * + * @generated + */ + public EObject basicGetTarget() { + return target; + } + + /** + * + * + * @generated + */ + public void setTarget(EObject newTarget) { + EObject oldTarget = target; + target = newTarget; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ReportPackage.EVENT_REPORT__TARGET, oldTarget, target)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ReportPackage.EVENT_REPORT__EVENT: + if (resolve) return getEvent(); + return basicGetEvent(); + case ReportPackage.EVENT_REPORT__MATCHES: + return getMatches(); + case ReportPackage.EVENT_REPORT__TARGET: + if (resolve) return getTarget(); + return basicGetTarget(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ReportPackage.EVENT_REPORT__EVENT: + setEvent((Event)newValue); + return; + case ReportPackage.EVENT_REPORT__MATCHES: + getMatches().clear(); + getMatches().addAll((Collection)newValue); + return; + case ReportPackage.EVENT_REPORT__TARGET: + setTarget((EObject)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ReportPackage.EVENT_REPORT__EVENT: + setEvent((Event)null); + return; + case ReportPackage.EVENT_REPORT__MATCHES: + getMatches().clear(); + return; + case ReportPackage.EVENT_REPORT__TARGET: + setTarget((EObject)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ReportPackage.EVENT_REPORT__EVENT: + return event != null; + case ReportPackage.EVENT_REPORT__MATCHES: + return matches != null && !matches.isEmpty(); + case ReportPackage.EVENT_REPORT__TARGET: + return target != null; + } + return super.eIsSet(featureID); + } + +} //EventReportImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java index 5a90500fc..0b69cb6a0 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java @@ -58,6 +58,8 @@ public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case ReportPackage.REPORT: return createReport(); case ReportPackage.STAGE_REPORT: return createStageReport(); + case ReportPackage.EVENT_REPORT: return createEventReport(); + case ReportPackage.EVENT_PARAMETER: return createEventParameter(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -83,6 +85,26 @@ public StageReport createStageReport() { return stageReport; } + /** + * + * + * @generated + */ + public EventReport createEventReport() { + EventReportImpl eventReport = new EventReportImpl(); + return eventReport; + } + + /** + * + * + * @generated + */ + public EventParameter createEventParameter() { + EventParameterImpl eventParameter = new EventParameterImpl(); + return eventParameter; + } + /** * * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java index 3c8b61d18..44d7e8acc 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java @@ -7,12 +7,16 @@ import fr.inria.diverse.event.commons.model.report.StageReport; 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.impl.MinimalEObjectImpl; + import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java index e51e60b3a..1c2196a1f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java @@ -2,6 +2,8 @@ */ package fr.inria.diverse.event.commons.model.report.impl; +import fr.inria.diverse.event.commons.model.report.EventParameter; +import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.Report; import fr.inria.diverse.event.commons.model.report.ReportFactory; import fr.inria.diverse.event.commons.model.report.ReportPackage; @@ -13,6 +15,7 @@ import org.eclipse.emf.ecore.EGenericType; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; + import org.eclipse.emf.ecore.impl.EPackageImpl; /** @@ -36,6 +39,20 @@ public class ReportPackageImpl extends EPackageImpl implements ReportPackage { */ private EClass stageReportEClass = null; + /** + * + * + * @generated + */ + private EClass eventReportEClass = null; + + /** + * + * + * @generated + */ + private EClass eventParameterEClass = null; + /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package @@ -145,6 +162,60 @@ public EReference getStageReport_Matches() { return (EReference)stageReportEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + public EReference getStageReport_Events() { + return (EReference)stageReportEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getEventReport() { + return eventReportEClass; + } + + /** + * + * + * @generated + */ + public EReference getEventReport_Event() { + return (EReference)eventReportEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getEventReport_Matches() { + return (EReference)eventReportEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getEventReport_Target() { + return (EReference)eventReportEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getEventParameter() { + return eventParameterEClass; + } + /** * * @@ -179,6 +250,14 @@ public void createPackageContents() { stageReportEClass = createEClass(STAGE_REPORT); createEReference(stageReportEClass, STAGE_REPORT__STAGE); createEReference(stageReportEClass, STAGE_REPORT__MATCHES); + createEReference(stageReportEClass, STAGE_REPORT__EVENTS); + + eventReportEClass = createEClass(EVENT_REPORT); + createEReference(eventReportEClass, EVENT_REPORT__EVENT); + createEReference(eventReportEClass, EVENT_REPORT__MATCHES); + createEReference(eventReportEClass, EVENT_REPORT__TARGET); + + eventParameterEClass = createEClass(EVENT_PARAMETER); } /** @@ -225,6 +304,17 @@ public void initializePackageContents() { g1.getETypeArguments().add(g2); initEReference(getStageReport_Stage(), g1, null, "stage", null, 0, 1, StageReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getStageReport_Matches(), ecorePackage.getEObject(), null, "matches", null, 0, -1, StageReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getStageReport_Events(), this.getEventReport(), null, "events", null, 0, -1, StageReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(eventReportEClass, EventReport.class, "EventReport", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(theScenarioPackage.getEvent()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + initEReference(getEventReport_Event(), g1, null, "event", null, 0, 1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getEventReport_Matches(), this.getEventParameter(), null, "matches", null, 0, -1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getEventReport_Target(), ecorePackage.getEObject(), null, "target", null, 0, 1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(eventParameterEClass, EventParameter.class, "EventParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java index 086853dfb..904ca6207 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.report.impl; +import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.ReportPackage; import fr.inria.diverse.event.commons.model.report.StageReport; @@ -10,6 +11,7 @@ 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; @@ -20,7 +22,9 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; /** * @@ -32,6 +36,7 @@ *
    *
  • {@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl#getStage Stage}
  • *
  • {@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl#getMatches Matches}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl#getEvents Events}
  • *
* * @generated @@ -57,6 +62,16 @@ public class StageReportImpl extends MinimalEObjectImpl.Container implements Sta */ protected EList matches; + /** + * The cached value of the '{@link #getEvents() Events}' containment reference list. + * + * + * @see #getEvents() + * @generated + * @ordered + */ + protected EList events; + /** * * @@ -126,6 +141,32 @@ public EList getMatches() { return matches; } + /** + * + * + * @generated + */ + public EList getEvents() { + if (events == null) { + events = new EObjectContainmentEList(EventReport.class, this, ReportPackage.STAGE_REPORT__EVENTS); + } + return events; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ReportPackage.STAGE_REPORT__EVENTS: + return ((InternalEList)getEvents()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + /** * * @@ -139,6 +180,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return basicGetStage(); case ReportPackage.STAGE_REPORT__MATCHES: return getMatches(); + case ReportPackage.STAGE_REPORT__EVENTS: + return getEvents(); } return super.eGet(featureID, resolve, coreType); } @@ -159,6 +202,10 @@ public void eSet(int featureID, Object newValue) { getMatches().clear(); getMatches().addAll((Collection)newValue); return; + case ReportPackage.STAGE_REPORT__EVENTS: + getEvents().clear(); + getEvents().addAll((Collection)newValue); + return; } super.eSet(featureID, newValue); } @@ -177,6 +224,9 @@ public void eUnset(int featureID) { case ReportPackage.STAGE_REPORT__MATCHES: getMatches().clear(); return; + case ReportPackage.STAGE_REPORT__EVENTS: + getEvents().clear(); + return; } super.eUnset(featureID); } @@ -193,6 +243,8 @@ public boolean eIsSet(int featureID) { return stage != null; case ReportPackage.STAGE_REPORT__MATCHES: return matches != null && !matches.isEmpty(); + case ReportPackage.STAGE_REPORT__EVENTS: + return events != null && !events.isEmpty(); } return super.eIsSet(featureID); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java index 06ef7520a..023b014ce 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java @@ -76,6 +76,14 @@ public Adapter caseStageReport(StageReport object) { return createStageReportAdapter(); } @Override + public Adapter caseEventReport(EventReport object) { + return createEventReportAdapter(); + } + @Override + public Adapter caseEventParameter(EventParameter object) { + return createEventParameterAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -123,6 +131,34 @@ public Adapter createStageReportAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.report.EventReport Event Report}'. + * + * 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 fr.inria.diverse.event.commons.model.report.EventReport + * @generated + */ + public Adapter createEventReportAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.report.EventParameter Event 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 fr.inria.diverse.event.commons.model.report.EventParameter + * @generated + */ + public Adapter createEventParameterAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java index 952b6443d..0d7fddd6b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java @@ -78,6 +78,18 @@ protected T doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } + case ReportPackage.EVENT_REPORT: { + EventReport eventReport = (EventReport)theEObject; + T result = caseEventReport(eventReport); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ReportPackage.EVENT_PARAMETER: { + EventParameter eventParameter = (EventParameter)theEObject; + T result = caseEventParameter(eventParameter); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -112,6 +124,36 @@ public T caseStageReport(StageReport object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Event Report'. + * + * 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 'Event Report'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEventReport(EventReport object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Event 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 'Event Parameter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEventParameter(EventParameter object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Date.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Date.java new file mode 100644 index 000000000..bb30a35b3 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Date.java @@ -0,0 +1,49 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + + +/** + * + * A representation of the model object 'Date'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.Date#getTime Time}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getDate() + * @model abstract="true" + * @generated + */ +public interface Date> extends Phase { + /** + * Returns the value of the 'Time' attribute. + * + *

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

+ * + * @return the value of the 'Time' attribute. + * @see #setTime(int) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getDate_Time() + * @model + * @generated + */ + int getTime(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Date#getTime Time}' attribute. + * + * + * @param value the new value of the 'Time' attribute. + * @see #getTime() + * @generated + */ + void setTime(int value); + +} // Date diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementProvider.java new file mode 100644 index 000000000..5ede4fcf7 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementProvider.java @@ -0,0 +1,18 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Element Provider'. + * + * + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getElementProvider() + * @model abstract="true" + * @generated + */ +public interface ElementProvider extends EObject { +} // ElementProvider diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementQuery.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementQuery.java new file mode 100644 index 000000000..c3082d8b8 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementQuery.java @@ -0,0 +1,50 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import fr.inria.diverse.event.commons.model.property.StateProperty; + +/** + * + * A representation of the model object 'Element Query'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.ElementQuery#getQuery Query}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getElementQuery() + * @model abstract="true" + * @generated + */ +public interface ElementQuery> extends ElementProvider { + /** + * Returns the value of the 'Query' containment reference. + * + *

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

+ * + * @return the value of the 'Query' containment reference. + * @see #setQuery(StateProperty) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getElementQuery_Query() + * @model containment="true" + * @generated + */ + P getQuery(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ElementQuery#getQuery Query}' containment reference. + * + * + * @param value the new value of the 'Query' containment reference. + * @see #getQuery() + * @generated + */ + void setQuery(P value); + +} // ElementQuery diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementReference.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementReference.java new file mode 100644 index 000000000..1b39d9f79 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ElementReference.java @@ -0,0 +1,49 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + + +/** + * + * A representation of the model object 'Element Reference'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.ElementReference#getElement Element}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getElementReference() + * @model abstract="true" + * @generated + */ +public interface ElementReference extends ElementProvider { + /** + * Returns the value of the 'Element' reference. + * + *

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

+ * + * @return the value of the 'Element' reference. + * @see #setElement(Object) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getElementReference_Element() + * @model kind="reference" + * @generated + */ + T getElement(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ElementReference#getElement Element}' reference. + * + * + * @param value the new value of the 'Element' reference. + * @see #getElement() + * @generated + */ + void setElement(T value); + +} // ElementReference diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Event.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Event.java index b050b65d7..afe411665 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Event.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Event.java @@ -13,7 +13,7 @@ * The following features are supported: *

*
    - *
  • {@link fr.inria.diverse.event.commons.model.scenario.Event#getTarget Target}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.Event#getTargetProvider Target Provider}
  • *
* * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getEvent() @@ -22,29 +22,29 @@ */ public interface Event extends EObject { /** - * Returns the value of the 'Target' reference. + * Returns the value of the 'Target Provider' containment reference. * *

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

* - * @return the value of the 'Target' reference. - * @see #setTarget(Object) - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getEvent_Target() - * @model kind="reference" + * @return the value of the 'Target Provider' containment reference. + * @see #setTargetProvider(ElementProvider) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getEvent_TargetProvider() + * @model containment="true" required="true" * @generated */ - T getTarget(); + ElementProvider getTargetProvider(); /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Event#getTarget Target}' reference. + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Event#getTargetProvider Target Provider}' containment reference. * * - * @param value the new value of the 'Target' reference. - * @see #getTarget() + * @param value the new value of the 'Target Provider' containment reference. + * @see #getTargetProvider() * @generated */ - void setTarget(T value); + void setTargetProvider(ElementProvider value); } // Event diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Phase.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Phase.java new file mode 100644 index 000000000..b5c5de157 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Phase.java @@ -0,0 +1,50 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Phase'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.Phase#getEvent Event}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getPhase() + * @model abstract="true" + * @generated + */ +public interface Phase> extends EObject { + /** + * Returns the value of the 'Event' containment reference. + * + *

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

+ * + * @return the value of the 'Event' containment reference. + * @see #setEvent(Event) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getPhase_Event() + * @model containment="true" + * @generated + */ + E getEvent(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Phase#getEvent Event}' containment reference. + * + * + * @param value the new value of the 'Event' containment reference. + * @see #getEvent() + * @generated + */ + void setEvent(E value); + +} // Phase diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java index 70b6c16fd..cf9baedb2 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java @@ -15,27 +15,27 @@ * The following features are supported: *

*
    - *
  • {@link fr.inria.diverse.event.commons.model.scenario.Scenario#getStages Stages}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.Scenario#getPhases Phases}
  • *
* * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenario() * @model abstract="true" * @generated */ -public interface Scenario> extends EObject { +public interface Scenario

> extends EObject { /** - * Returns the value of the 'Stages' containment reference list. + * Returns the value of the 'Phases' containment reference list. * *

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

* - * @return the value of the 'Stages' containment reference list. - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenario_Stages() + * @return the value of the 'Phases' containment reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenario_Phases() * @model containment="true" * @generated */ - EList getStages(); + EList

getPhases(); } // Scenario diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java index ed9f04da0..9d87fc084 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; @@ -66,13 +67,13 @@ public interface ScenarioPackage extends EPackage { int SCENARIO = 0; /** - * The feature id for the 'Stages' containment reference list. + * The feature id for the 'Phases' containment reference list. * * * @generated * @ordered */ - int SCENARIO__STAGES = 0; + int SCENARIO__PHASES = 0; /** * The number of structural features of the 'Scenario' class. @@ -103,13 +104,13 @@ public interface ScenarioPackage extends EPackage { int EVENT = 1; /** - * The feature id for the 'Target' reference. + * The feature id for the 'Target Provider' containment reference. * * * @generated * @ordered */ - int EVENT__TARGET = 0; + int EVENT__TARGET_PROVIDER = 0; /** * The number of structural features of the 'Event' class. @@ -129,6 +130,43 @@ public interface ScenarioPackage extends EPackage { */ int EVENT_OPERATION_COUNT = 0; + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl Phase}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getPhase() + * @generated + */ + int PHASE = 8; + + /** + * The feature id for the 'Event' containment reference. + * + * + * @generated + * @ordered + */ + int PHASE__EVENT = 0; + + /** + * The number of structural features of the 'Phase' class. + * + * + * @generated + * @ordered + */ + int PHASE_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Phase' class. + * + * + * @generated + * @ordered + */ + int PHASE_OPERATION_COUNT = 0; + /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl Stage}' class. * @@ -140,22 +178,22 @@ public interface ScenarioPackage extends EPackage { int STAGE = 2; /** - * The feature id for the 'Property' containment reference. + * The feature id for the 'Event' containment reference. * * * @generated * @ordered */ - int STAGE__PROPERTY = 0; + int STAGE__EVENT = PHASE__EVENT; /** - * The feature id for the 'Event' containment reference. + * The feature id for the 'Property' containment reference. * * * @generated * @ordered */ - int STAGE__EVENT = 1; + int STAGE__PROPERTY = PHASE_FEATURE_COUNT + 0; /** * The number of structural features of the 'Stage' class. @@ -164,7 +202,7 @@ public interface ScenarioPackage extends EPackage { * @generated * @ordered */ - int STAGE_FEATURE_COUNT = 2; + int STAGE_FEATURE_COUNT = PHASE_FEATURE_COUNT + 1; /** * The number of operations of the 'Stage' class. @@ -173,7 +211,192 @@ public interface ScenarioPackage extends EPackage { * @generated * @ordered */ - int STAGE_OPERATION_COUNT = 0; + int STAGE_OPERATION_COUNT = PHASE_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementProviderImpl Element Provider}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementProviderImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementProvider() + * @generated + */ + int ELEMENT_PROVIDER = 3; + + /** + * The number of structural features of the 'Element Provider' class. + * + * + * @generated + * @ordered + */ + int ELEMENT_PROVIDER_FEATURE_COUNT = 0; + + /** + * The number of operations of the 'Element Provider' class. + * + * + * @generated + * @ordered + */ + int ELEMENT_PROVIDER_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementReferenceImpl Element Reference}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementReferenceImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementReference() + * @generated + */ + int ELEMENT_REFERENCE = 4; + + /** + * The feature id for the 'Element' reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_REFERENCE__ELEMENT = ELEMENT_PROVIDER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Element Reference' class. + * + * + * @generated + * @ordered + */ + int ELEMENT_REFERENCE_FEATURE_COUNT = ELEMENT_PROVIDER_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Element Reference' class. + * + * + * @generated + * @ordered + */ + int ELEMENT_REFERENCE_OPERATION_COUNT = ELEMENT_PROVIDER_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl Element Query}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementQuery() + * @generated + */ + int ELEMENT_QUERY = 5; + + /** + * The feature id for the 'Query' containment reference. + * + * + * @generated + * @ordered + */ + int ELEMENT_QUERY__QUERY = ELEMENT_PROVIDER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Element Query' class. + * + * + * @generated + * @ordered + */ + int ELEMENT_QUERY_FEATURE_COUNT = ELEMENT_PROVIDER_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Element Query' class. + * + * + * @generated + * @ordered + */ + int ELEMENT_QUERY_OPERATION_COUNT = ELEMENT_PROVIDER_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl Test Suite}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getTestSuite() + * @generated + */ + int TEST_SUITE = 6; + + /** + * The feature id for the 'Tests' containment reference list. + * + * + * @generated + * @ordered + */ + int TEST_SUITE__TESTS = 0; + + /** + * The number of structural features of the 'Test Suite' class. + * + * + * @generated + * @ordered + */ + int TEST_SUITE_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Test Suite' class. + * + * + * @generated + * @ordered + */ + int TEST_SUITE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.DateImpl Date}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.DateImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getDate() + * @generated + */ + int DATE = 7; + + /** + * The feature id for the 'Event' containment reference. + * + * + * @generated + * @ordered + */ + int DATE__EVENT = PHASE__EVENT; + + /** + * The feature id for the 'Time' attribute. + * + * + * @generated + * @ordered + */ + int DATE__TIME = PHASE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Date' class. + * + * + * @generated + * @ordered + */ + int DATE_FEATURE_COUNT = PHASE_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Date' class. + * + * + * @generated + * @ordered + */ + int DATE_OPERATION_COUNT = PHASE_OPERATION_COUNT + 0; /** @@ -187,15 +410,15 @@ public interface ScenarioPackage extends EPackage { EClass getScenario(); /** - * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.Scenario#getStages Stages}'. + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.Scenario#getPhases Phases}'. * * - * @return the meta object for the containment reference list 'Stages'. - * @see fr.inria.diverse.event.commons.model.scenario.Scenario#getStages() + * @return the meta object for the containment reference list 'Phases'. + * @see fr.inria.diverse.event.commons.model.scenario.Scenario#getPhases() * @see #getScenario() * @generated */ - EReference getScenario_Stages(); + EReference getScenario_Phases(); /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Event Event}'. @@ -208,15 +431,15 @@ public interface ScenarioPackage extends EPackage { EClass getEvent(); /** - * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.scenario.Event#getTarget Target}'. + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.Event#getTargetProvider Target Provider}'. * * - * @return the meta object for the reference 'Target'. - * @see fr.inria.diverse.event.commons.model.scenario.Event#getTarget() + * @return the meta object for the containment reference 'Target Provider'. + * @see fr.inria.diverse.event.commons.model.scenario.Event#getTargetProvider() * @see #getEvent() * @generated */ - EReference getEvent_Target(); + EReference getEvent_TargetProvider(); /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Stage Stage}'. @@ -240,15 +463,119 @@ public interface ScenarioPackage extends EPackage { EReference getStage_Property(); /** - * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.Stage#getEvent Event}'. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ElementProvider Element Provider}'. + * + * + * @return the meta object for class 'Element Provider'. + * @see fr.inria.diverse.event.commons.model.scenario.ElementProvider + * @generated + */ + EClass getElementProvider(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ElementReference Element Reference}'. + * + * + * @return the meta object for class 'Element Reference'. + * @see fr.inria.diverse.event.commons.model.scenario.ElementReference + * @generated + */ + EClass getElementReference(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.scenario.ElementReference#getElement Element}'. + * + * + * @return the meta object for the reference 'Element'. + * @see fr.inria.diverse.event.commons.model.scenario.ElementReference#getElement() + * @see #getElementReference() + * @generated + */ + EReference getElementReference_Element(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ElementQuery Element Query}'. + * + * + * @return the meta object for class 'Element Query'. + * @see fr.inria.diverse.event.commons.model.scenario.ElementQuery + * @generated + */ + EClass getElementQuery(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.ElementQuery#getQuery Query}'. + * + * + * @return the meta object for the containment reference 'Query'. + * @see fr.inria.diverse.event.commons.model.scenario.ElementQuery#getQuery() + * @see #getElementQuery() + * @generated + */ + EReference getElementQuery_Query(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.TestSuite Test Suite}'. + * + * + * @return the meta object for class 'Test Suite'. + * @see fr.inria.diverse.event.commons.model.scenario.TestSuite + * @generated + */ + EClass getTestSuite(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.TestSuite#getTests Tests}'. + * + * + * @return the meta object for the containment reference list 'Tests'. + * @see fr.inria.diverse.event.commons.model.scenario.TestSuite#getTests() + * @see #getTestSuite() + * @generated + */ + EReference getTestSuite_Tests(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Date Date}'. + * + * + * @return the meta object for class 'Date'. + * @see fr.inria.diverse.event.commons.model.scenario.Date + * @generated + */ + EClass getDate(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.Date#getTime Time}'. + * + * + * @return the meta object for the attribute 'Time'. + * @see fr.inria.diverse.event.commons.model.scenario.Date#getTime() + * @see #getDate() + * @generated + */ + EAttribute getDate_Time(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Phase Phase}'. + * + * + * @return the meta object for class 'Phase'. + * @see fr.inria.diverse.event.commons.model.scenario.Phase + * @generated + */ + EClass getPhase(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.Phase#getEvent Event}'. * * * @return the meta object for the containment reference 'Event'. - * @see fr.inria.diverse.event.commons.model.scenario.Stage#getEvent() - * @see #getStage() + * @see fr.inria.diverse.event.commons.model.scenario.Phase#getEvent() + * @see #getPhase() * @generated */ - EReference getStage_Event(); + EReference getPhase_Event(); /** * Returns the factory that creates the instances of the model. @@ -284,12 +611,12 @@ interface Literals { EClass SCENARIO = eINSTANCE.getScenario(); /** - * The meta object literal for the 'Stages' containment reference list feature. + * The meta object literal for the 'Phases' containment reference list feature. * * * @generated */ - EReference SCENARIO__STAGES = eINSTANCE.getScenario_Stages(); + EReference SCENARIO__PHASES = eINSTANCE.getScenario_Phases(); /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.EventImpl Event}' class. @@ -302,12 +629,12 @@ interface Literals { EClass EVENT = eINSTANCE.getEvent(); /** - * The meta object literal for the 'Target' reference feature. + * The meta object literal for the 'Target Provider' containment reference feature. * * * @generated */ - EReference EVENT__TARGET = eINSTANCE.getEvent_Target(); + EReference EVENT__TARGET_PROVIDER = eINSTANCE.getEvent_TargetProvider(); /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl Stage}' class. @@ -327,13 +654,105 @@ interface Literals { */ EReference STAGE__PROPERTY = eINSTANCE.getStage_Property(); + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementProviderImpl Element Provider}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementProviderImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementProvider() + * @generated + */ + EClass ELEMENT_PROVIDER = eINSTANCE.getElementProvider(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementReferenceImpl Element Reference}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementReferenceImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementReference() + * @generated + */ + EClass ELEMENT_REFERENCE = eINSTANCE.getElementReference(); + + /** + * The meta object literal for the 'Element' reference feature. + * + * + * @generated + */ + EReference ELEMENT_REFERENCE__ELEMENT = eINSTANCE.getElementReference_Element(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl Element Query}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementQuery() + * @generated + */ + EClass ELEMENT_QUERY = eINSTANCE.getElementQuery(); + + /** + * The meta object literal for the 'Query' containment reference feature. + * + * + * @generated + */ + EReference ELEMENT_QUERY__QUERY = eINSTANCE.getElementQuery_Query(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl Test Suite}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getTestSuite() + * @generated + */ + EClass TEST_SUITE = eINSTANCE.getTestSuite(); + + /** + * The meta object literal for the 'Tests' containment reference list feature. + * + * + * @generated + */ + EReference TEST_SUITE__TESTS = eINSTANCE.getTestSuite_Tests(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.DateImpl Date}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.DateImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getDate() + * @generated + */ + EClass DATE = eINSTANCE.getDate(); + + /** + * The meta object literal for the 'Time' attribute feature. + * + * + * @generated + */ + EAttribute DATE__TIME = eINSTANCE.getDate_Time(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl Phase}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getPhase() + * @generated + */ + EClass PHASE = eINSTANCE.getPhase(); + /** * The meta object literal for the 'Event' containment reference feature. * * * @generated */ - EReference STAGE__EVENT = eINSTANCE.getStage_Event(); + EReference PHASE__EVENT = eINSTANCE.getPhase_Event(); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java index 1cfeecd9e..f023f4b76 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java @@ -2,9 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario; -import fr.inria.diverse.event.commons.model.property.ClassProperty; - -import org.eclipse.emf.ecore.EObject; +import fr.inria.diverse.event.commons.model.property.StateProperty; /** * @@ -16,14 +14,13 @@ *

*
    *
  • {@link fr.inria.diverse.event.commons.model.scenario.Stage#getProperty Property}
  • - *
  • {@link fr.inria.diverse.event.commons.model.scenario.Stage#getEvent Event}
  • *
* * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getStage() * @model abstract="true" * @generated */ -public interface Stage, P extends ClassProperty> extends EObject { +public interface Stage, P extends StateProperty> extends Phase { /** * Returns the value of the 'Property' containment reference. * @@ -33,7 +30,7 @@ public interface Stage, P extends ClassProperty> extends E *

* * @return the value of the 'Property' containment reference. - * @see #setProperty(ClassProperty) + * @see #setProperty(StateProperty) * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getStage_Property() * @model containment="true" * @generated @@ -50,30 +47,4 @@ public interface Stage, P extends ClassProperty> extends E */ void setProperty(P value); - /** - * Returns the value of the 'Event' containment reference. - * - *

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

- * - * @return the value of the 'Event' containment reference. - * @see #setEvent(Event) - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getStage_Event() - * @model containment="true" - * @generated - */ - E getEvent(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Stage#getEvent Event}' containment reference. - * - * - * @param value the new value of the 'Event' containment reference. - * @see #getEvent() - * @generated - */ - void setEvent(E value); - } // Stage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TestSuite.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TestSuite.java new file mode 100644 index 000000000..da2a0af41 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TestSuite.java @@ -0,0 +1,41 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Test Suite'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.TestSuite#getTests Tests}
  • + *
+ * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getTestSuite() + * @model abstract="true" + * @generated + */ +public interface TestSuite> extends EObject { + /** + * Returns the value of the 'Tests' containment reference list. + * + *

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

+ * + * @return the value of the 'Tests' containment reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getTestSuite_Tests() + * @model containment="true" + * @generated + */ + EList getTests(); + +} // TestSuite diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/DateImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/DateImpl.java new file mode 100644 index 000000000..8d48bde69 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/DateImpl.java @@ -0,0 +1,163 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.scenario.Date; +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * + * An implementation of the model object 'Date'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.DateImpl#getTime Time}
  • + *
+ * + * @generated + */ +public abstract class DateImpl> extends PhaseImpl implements Date { + /** + * The default value of the '{@link #getTime() Time}' attribute. + * + * + * @see #getTime() + * @generated + * @ordered + */ + protected static final int TIME_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getTime() Time}' attribute. + * + * + * @see #getTime() + * @generated + * @ordered + */ + protected int time = TIME_EDEFAULT; + + /** + * + * + * @generated + */ + protected DateImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.DATE; + } + + /** + * + * + * @generated + */ + public int getTime() { + return time; + } + + /** + * + * + * @generated + */ + public void setTime(int newTime) { + int oldTime = time; + time = newTime; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.DATE__TIME, oldTime, time)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.DATE__TIME: + return getTime(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.DATE__TIME: + setTime((Integer)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.DATE__TIME: + setTime(TIME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.DATE__TIME: + return time != TIME_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (time: "); + result.append(time); + result.append(')'); + return result.toString(); + } + +} //DateImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementProviderImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementProviderImpl.java new file mode 100644 index 000000000..275b5793d --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementProviderImpl.java @@ -0,0 +1,39 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.scenario.ElementProvider; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Element Provider'. + * + * + * @generated + */ +public abstract class ElementProviderImpl extends MinimalEObjectImpl.Container implements ElementProvider { + /** + * + * + * @generated + */ + protected ElementProviderImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.ELEMENT_PROVIDER; + } + +} //ElementProviderImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementQueryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementQueryImpl.java new file mode 100644 index 000000000..b7acba297 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementQueryImpl.java @@ -0,0 +1,177 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.property.StateProperty; + +import fr.inria.diverse.event.commons.model.scenario.ElementQuery; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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; + +/** + * + * An implementation of the model object 'Element Query'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl#getQuery Query}
  • + *
+ * + * @generated + */ +public abstract class ElementQueryImpl> extends ElementProviderImpl implements ElementQuery { + /** + * The cached value of the '{@link #getQuery() Query}' containment reference. + * + * + * @see #getQuery() + * @generated + * @ordered + */ + protected P query; + + /** + * + * + * @generated + */ + protected ElementQueryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.ELEMENT_QUERY; + } + + /** + * + * + * @generated + */ + public P getQuery() { + return query; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetQuery(P newQuery, NotificationChain msgs) { + P oldQuery = query; + query = newQuery; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.ELEMENT_QUERY__QUERY, oldQuery, newQuery); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setQuery(P newQuery) { + if (newQuery != query) { + NotificationChain msgs = null; + if (query != null) + msgs = ((InternalEObject)query).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.ELEMENT_QUERY__QUERY, null, msgs); + if (newQuery != null) + msgs = ((InternalEObject)newQuery).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.ELEMENT_QUERY__QUERY, null, msgs); + msgs = basicSetQuery(newQuery, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ELEMENT_QUERY__QUERY, newQuery, newQuery)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.ELEMENT_QUERY__QUERY: + return basicSetQuery(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.ELEMENT_QUERY__QUERY: + return getQuery(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.ELEMENT_QUERY__QUERY: + setQuery((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.ELEMENT_QUERY__QUERY: + setQuery((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.ELEMENT_QUERY__QUERY: + return query != null; + } + return super.eIsSet(featureID); + } + +} //ElementQueryImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementReferenceImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementReferenceImpl.java new file mode 100644 index 000000000..a891b7d6a --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ElementReferenceImpl.java @@ -0,0 +1,158 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.scenario.ElementReference; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.ENotificationImpl; + +/** + * + * An implementation of the model object 'Element Reference'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ElementReferenceImpl#getElement Element}
  • + *
+ * + * @generated + */ +public abstract class ElementReferenceImpl extends ElementProviderImpl implements ElementReference { + /** + * The cached value of the '{@link #getElement() Element}' reference. + * + * + * @see #getElement() + * @generated + * @ordered + */ + protected T element; + + /** + * + * + * @generated + */ + protected ElementReferenceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.ELEMENT_REFERENCE; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public T getElement() { + if (element != null && ((EObject)element).eIsProxy()) { + InternalEObject oldElement = (InternalEObject)element; + element = (T)eResolveProxy(oldElement); + if (element != oldElement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScenarioPackage.ELEMENT_REFERENCE__ELEMENT, oldElement, element)); + } + } + return element; + } + + /** + * + * + * @generated + */ + public T basicGetElement() { + return element; + } + + /** + * + * + * @generated + */ + public void setElement(T newElement) { + T oldElement = element; + element = newElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ELEMENT_REFERENCE__ELEMENT, oldElement, element)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.ELEMENT_REFERENCE__ELEMENT: + if (resolve) return getElement(); + return basicGetElement(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.ELEMENT_REFERENCE__ELEMENT: + setElement((T)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.ELEMENT_REFERENCE__ELEMENT: + setElement((T)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.ELEMENT_REFERENCE__ELEMENT: + return element != null; + } + return super.eIsSet(featureID); + } + +} //ElementReferenceImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventImpl.java index f350a5ecb..2e081f64c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventImpl.java @@ -2,13 +2,14 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; +import fr.inria.diverse.event.commons.model.scenario.ElementProvider; import fr.inria.diverse.event.commons.model.scenario.Event; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; 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.EObject; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -22,21 +23,21 @@ * The following features are implemented: *

*
    - *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.EventImpl#getTarget Target}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.EventImpl#getTargetProvider Target Provider}
  • *
* * @generated */ public abstract class EventImpl extends MinimalEObjectImpl.Container implements Event { /** - * The cached value of the '{@link #getTarget() Target}' reference. + * The cached value of the '{@link #getTargetProvider() Target Provider}' containment reference. * * - * @see #getTarget() + * @see #getTargetProvider() * @generated * @ordered */ - protected T target; + protected ElementProvider targetProvider; /** * @@ -62,17 +63,23 @@ protected EClass eStaticClass() { * * @generated */ - @SuppressWarnings("unchecked") - public T getTarget() { - if (target != null && ((EObject)target).eIsProxy()) { - InternalEObject oldTarget = (InternalEObject)target; - target = (T)eResolveProxy(oldTarget); - if (target != oldTarget) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScenarioPackage.EVENT__TARGET, oldTarget, target)); - } + public ElementProvider getTargetProvider() { + return targetProvider; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTargetProvider(ElementProvider newTargetProvider, NotificationChain msgs) { + ElementProvider oldTargetProvider = targetProvider; + targetProvider = newTargetProvider; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.EVENT__TARGET_PROVIDER, oldTargetProvider, newTargetProvider); + if (msgs == null) msgs = notification; else msgs.add(notification); } - return target; + return msgs; } /** @@ -80,8 +87,18 @@ public T getTarget() { * * @generated */ - public T basicGetTarget() { - return target; + public void setTargetProvider(ElementProvider newTargetProvider) { + if (newTargetProvider != targetProvider) { + NotificationChain msgs = null; + if (targetProvider != null) + msgs = ((InternalEObject)targetProvider).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.EVENT__TARGET_PROVIDER, null, msgs); + if (newTargetProvider != null) + msgs = ((InternalEObject)newTargetProvider).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.EVENT__TARGET_PROVIDER, null, msgs); + msgs = basicSetTargetProvider(newTargetProvider, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.EVENT__TARGET_PROVIDER, newTargetProvider, newTargetProvider)); } /** @@ -89,11 +106,13 @@ public T basicGetTarget() { * * @generated */ - public void setTarget(T newTarget) { - T oldTarget = target; - target = newTarget; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.EVENT__TARGET, oldTarget, target)); + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.EVENT__TARGET_PROVIDER: + return basicSetTargetProvider(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); } /** @@ -104,9 +123,8 @@ public void setTarget(T newTarget) { @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case ScenarioPackage.EVENT__TARGET: - if (resolve) return getTarget(); - return basicGetTarget(); + case ScenarioPackage.EVENT__TARGET_PROVIDER: + return getTargetProvider(); } return super.eGet(featureID, resolve, coreType); } @@ -120,8 +138,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case ScenarioPackage.EVENT__TARGET: - setTarget((T)newValue); + case ScenarioPackage.EVENT__TARGET_PROVIDER: + setTargetProvider((ElementProvider)newValue); return; } super.eSet(featureID, newValue); @@ -135,8 +153,8 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case ScenarioPackage.EVENT__TARGET: - setTarget((T)null); + case ScenarioPackage.EVENT__TARGET_PROVIDER: + setTargetProvider((ElementProvider)null); return; } super.eUnset(featureID); @@ -150,8 +168,8 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case ScenarioPackage.EVENT__TARGET: - return target != null; + case ScenarioPackage.EVENT__TARGET_PROVIDER: + return targetProvider != null; } return super.eIsSet(featureID); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/PhaseImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/PhaseImpl.java new file mode 100644 index 000000000..6574ef12f --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/PhaseImpl.java @@ -0,0 +1,177 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.Phase; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Phase'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl#getEvent Event}
  • + *
+ * + * @generated + */ +public abstract class PhaseImpl> extends MinimalEObjectImpl.Container implements Phase { + /** + * The cached value of the '{@link #getEvent() Event}' containment reference. + * + * + * @see #getEvent() + * @generated + * @ordered + */ + protected E event; + + /** + * + * + * @generated + */ + protected PhaseImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.PHASE; + } + + /** + * + * + * @generated + */ + public E getEvent() { + return event; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEvent(E newEvent, NotificationChain msgs) { + E oldEvent = event; + event = newEvent; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.PHASE__EVENT, oldEvent, newEvent); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setEvent(E newEvent) { + if (newEvent != event) { + NotificationChain msgs = null; + if (event != null) + msgs = ((InternalEObject)event).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.PHASE__EVENT, null, msgs); + if (newEvent != null) + msgs = ((InternalEObject)newEvent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.PHASE__EVENT, null, msgs); + msgs = basicSetEvent(newEvent, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.PHASE__EVENT, newEvent, newEvent)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.PHASE__EVENT: + return basicSetEvent(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.PHASE__EVENT: + return getEvent(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.PHASE__EVENT: + setEvent((E)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.PHASE__EVENT: + setEvent((E)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.PHASE__EVENT: + return event != null; + } + return super.eIsSet(featureID); + } + +} //PhaseImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java index 4c1853fd9..1e1cc99eb 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java @@ -2,9 +2,9 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; +import fr.inria.diverse.event.commons.model.scenario.Phase; import fr.inria.diverse.event.commons.model.scenario.Scenario; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; -import fr.inria.diverse.event.commons.model.scenario.Stage; import java.util.Collection; @@ -28,21 +28,21 @@ * The following features are implemented: *

*
    - *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioImpl#getStages Stages}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioImpl#getPhases Phases}
  • *
* * @generated */ -public abstract class ScenarioImpl> extends MinimalEObjectImpl.Container implements Scenario { +public abstract class ScenarioImpl

> extends MinimalEObjectImpl.Container implements Scenario

{ /** - * The cached value of the '{@link #getStages() Stages}' containment reference list. + * The cached value of the '{@link #getPhases() Phases}' containment reference list. * * - * @see #getStages() + * @see #getPhases() * @generated * @ordered */ - protected EList stages; + protected EList

phases; /** * @@ -68,11 +68,11 @@ protected EClass eStaticClass() { * * @generated */ - public EList getStages() { - if (stages == null) { - stages = new EObjectContainmentEList(Stage.class, this, ScenarioPackage.SCENARIO__STAGES); + public EList

getPhases() { + if (phases == null) { + phases = new EObjectContainmentEList

(Phase.class, this, ScenarioPackage.SCENARIO__PHASES); } - return stages; + return phases; } /** @@ -83,8 +83,8 @@ public EList getStages() { @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case ScenarioPackage.SCENARIO__STAGES: - return ((InternalEList)getStages()).basicRemove(otherEnd, msgs); + case ScenarioPackage.SCENARIO__PHASES: + return ((InternalEList)getPhases()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -97,8 +97,8 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case ScenarioPackage.SCENARIO__STAGES: - return getStages(); + case ScenarioPackage.SCENARIO__PHASES: + return getPhases(); } return super.eGet(featureID, resolve, coreType); } @@ -112,9 +112,9 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case ScenarioPackage.SCENARIO__STAGES: - getStages().clear(); - getStages().addAll((Collection)newValue); + case ScenarioPackage.SCENARIO__PHASES: + getPhases().clear(); + getPhases().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); @@ -128,8 +128,8 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case ScenarioPackage.SCENARIO__STAGES: - getStages().clear(); + case ScenarioPackage.SCENARIO__PHASES: + getPhases().clear(); return; } super.eUnset(featureID); @@ -143,8 +143,8 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case ScenarioPackage.SCENARIO__STAGES: - return stages != null && !stages.isEmpty(); + case ScenarioPackage.SCENARIO__PHASES: + return phases != null && !phases.isEmpty(); } return super.eIsSet(featureID); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java index f5419fd77..e44e9999e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java @@ -4,12 +4,19 @@ import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.scenario.Date; +import fr.inria.diverse.event.commons.model.scenario.ElementProvider; +import fr.inria.diverse.event.commons.model.scenario.ElementQuery; +import fr.inria.diverse.event.commons.model.scenario.ElementReference; import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.Phase; import fr.inria.diverse.event.commons.model.scenario.Scenario; import fr.inria.diverse.event.commons.model.scenario.ScenarioFactory; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import fr.inria.diverse.event.commons.model.scenario.Stage; +import fr.inria.diverse.event.commons.model.scenario.TestSuite; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EGenericType; import org.eclipse.emf.ecore.EPackage; @@ -46,6 +53,48 @@ public class ScenarioPackageImpl extends EPackageImpl implements ScenarioPackage */ private EClass stageEClass = null; + /** + * + * + * @generated + */ + private EClass elementProviderEClass = null; + + /** + * + * + * @generated + */ + private EClass elementReferenceEClass = null; + + /** + * + * + * @generated + */ + private EClass elementQueryEClass = null; + + /** + * + * + * @generated + */ + private EClass testSuiteEClass = null; + + /** + * + * + * @generated + */ + private EClass dateEClass = null; + + /** + * + * + * @generated + */ + private EClass phaseEClass = null; + /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package @@ -124,7 +173,7 @@ public EClass getScenario() { * * @generated */ - public EReference getScenario_Stages() { + public EReference getScenario_Phases() { return (EReference)scenarioEClass.getEStructuralFeatures().get(0); } @@ -142,7 +191,7 @@ public EClass getEvent() { * * @generated */ - public EReference getEvent_Target() { + public EReference getEvent_TargetProvider() { return (EReference)eventEClass.getEStructuralFeatures().get(0); } @@ -169,8 +218,98 @@ public EReference getStage_Property() { * * @generated */ - public EReference getStage_Event() { - return (EReference)stageEClass.getEStructuralFeatures().get(1); + public EClass getElementProvider() { + return elementProviderEClass; + } + + /** + * + * + * @generated + */ + public EClass getElementReference() { + return elementReferenceEClass; + } + + /** + * + * + * @generated + */ + public EReference getElementReference_Element() { + return (EReference)elementReferenceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getElementQuery() { + return elementQueryEClass; + } + + /** + * + * + * @generated + */ + public EReference getElementQuery_Query() { + return (EReference)elementQueryEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getTestSuite() { + return testSuiteEClass; + } + + /** + * + * + * @generated + */ + public EReference getTestSuite_Tests() { + return (EReference)testSuiteEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getDate() { + return dateEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getDate_Time() { + return (EAttribute)dateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getPhase() { + return phaseEClass; + } + + /** + * + * + * @generated + */ + public EReference getPhase_Event() { + return (EReference)phaseEClass.getEStructuralFeatures().get(0); } /** @@ -202,14 +341,30 @@ public void createPackageContents() { // Create classes and their features scenarioEClass = createEClass(SCENARIO); - createEReference(scenarioEClass, SCENARIO__STAGES); + createEReference(scenarioEClass, SCENARIO__PHASES); eventEClass = createEClass(EVENT); - createEReference(eventEClass, EVENT__TARGET); + createEReference(eventEClass, EVENT__TARGET_PROVIDER); stageEClass = createEClass(STAGE); createEReference(stageEClass, STAGE__PROPERTY); - createEReference(stageEClass, STAGE__EVENT); + + elementProviderEClass = createEClass(ELEMENT_PROVIDER); + + elementReferenceEClass = createEClass(ELEMENT_REFERENCE); + createEReference(elementReferenceEClass, ELEMENT_REFERENCE__ELEMENT); + + elementQueryEClass = createEClass(ELEMENT_QUERY); + createEReference(elementQueryEClass, ELEMENT_QUERY__QUERY); + + testSuiteEClass = createEClass(TEST_SUITE); + createEReference(testSuiteEClass, TEST_SUITE__TESTS); + + dateEClass = createEClass(DATE); + createEAttribute(dateEClass, DATE__TIME); + + phaseEClass = createEClass(PHASE); + createEReference(phaseEClass, PHASE__EVENT); } /** @@ -239,43 +394,101 @@ public void initializePackageContents() { PropertyPackage thePropertyPackage = (PropertyPackage)EPackage.Registry.INSTANCE.getEPackage(PropertyPackage.eNS_URI); // Create type parameters - ETypeParameter scenarioEClass_T = addETypeParameter(scenarioEClass, "T"); + ETypeParameter scenarioEClass_P = addETypeParameter(scenarioEClass, "P"); ETypeParameter eventEClass_T = addETypeParameter(eventEClass, "T"); ETypeParameter stageEClass_E = addETypeParameter(stageEClass, "E"); ETypeParameter stageEClass_P = addETypeParameter(stageEClass, "P"); + addETypeParameter(elementProviderEClass, "T"); + ETypeParameter elementReferenceEClass_T = addETypeParameter(elementReferenceEClass, "T"); + ETypeParameter elementQueryEClass_T = addETypeParameter(elementQueryEClass, "T"); + ETypeParameter elementQueryEClass_P = addETypeParameter(elementQueryEClass, "P"); + ETypeParameter testSuiteEClass_T = addETypeParameter(testSuiteEClass, "T"); + ETypeParameter dateEClass_E = addETypeParameter(dateEClass, "E"); + ETypeParameter phaseEClass_E = addETypeParameter(phaseEClass, "E"); // Set bounds for type parameters - EGenericType g1 = createEGenericType(this.getStage()); + EGenericType g1 = createEGenericType(this.getPhase()); EGenericType g2 = createEGenericType(); g1.getETypeArguments().add(g2); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); - scenarioEClass_T.getEBounds().add(g1); + scenarioEClass_P.getEBounds().add(g1); g1 = createEGenericType(this.getEvent()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); stageEClass_E.getEBounds().add(g1); - g1 = createEGenericType(thePropertyPackage.getClassProperty()); + g1 = createEGenericType(thePropertyPackage.getStateProperty()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); stageEClass_P.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getStateProperty()); + g2 = createEGenericType(elementQueryEClass_T); + g1.getETypeArguments().add(g2); + elementQueryEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getScenario()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + testSuiteEClass_T.getEBounds().add(g1); + g1 = createEGenericType(this.getEvent()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + dateEClass_E.getEBounds().add(g1); + g1 = createEGenericType(this.getEvent()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + phaseEClass_E.getEBounds().add(g1); // Add supertypes to classes + g1 = createEGenericType(this.getPhase()); + g2 = createEGenericType(stageEClass_E); + g1.getETypeArguments().add(g2); + stageEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getElementProvider()); + g2 = createEGenericType(elementReferenceEClass_T); + g1.getETypeArguments().add(g2); + elementReferenceEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getElementProvider()); + g2 = createEGenericType(elementQueryEClass_T); + g1.getETypeArguments().add(g2); + elementQueryEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getPhase()); + g2 = createEGenericType(dateEClass_E); + g1.getETypeArguments().add(g2); + dateEClass.getEGenericSuperTypes().add(g1); // Initialize classes, features, and operations; add parameters initEClass(scenarioEClass, Scenario.class, "Scenario", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(scenarioEClass_T); - initEReference(getScenario_Stages(), g1, null, "stages", null, 0, -1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioEClass_P); + initEReference(getScenario_Phases(), g1, null, "phases", null, 0, -1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(eventEClass, Event.class, "Event", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(eventEClass_T); - initEReference(getEvent_Target(), g1, null, "target", null, 0, 1, Event.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(this.getElementProvider()); + g2 = createEGenericType(eventEClass_T); + g1.getETypeArguments().add(g2); + initEReference(getEvent_TargetProvider(), g1, null, "targetProvider", null, 1, 1, Event.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(stageEClass, Stage.class, "Stage", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(stageEClass_P); initEReference(getStage_Property(), g1, null, "property", null, 0, 1, Stage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - g1 = createEGenericType(stageEClass_E); - initEReference(getStage_Event(), g1, null, "event", null, 0, 1, Stage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(elementProviderEClass, ElementProvider.class, "ElementProvider", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(elementReferenceEClass, ElementReference.class, "ElementReference", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(elementReferenceEClass_T); + initEReference(getElementReference_Element(), g1, null, "element", null, 0, 1, ElementReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(elementQueryEClass, ElementQuery.class, "ElementQuery", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(elementQueryEClass_P); + initEReference(getElementQuery_Query(), g1, null, "query", null, 0, 1, ElementQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(testSuiteEClass, TestSuite.class, "TestSuite", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(testSuiteEClass_T); + initEReference(getTestSuite_Tests(), g1, null, "tests", null, 0, -1, TestSuite.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(dateEClass, Date.class, "Date", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDate_Time(), ecorePackage.getEInt(), "time", null, 0, 1, Date.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(phaseEClass, Phase.class, "Phase", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(phaseEClass_E); + initEReference(getPhase_Event(), g1, null, "event", null, 0, 1, Phase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Create resource createResource(eNS_URI); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java index 6b6babfeb..11de31e51 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java @@ -2,7 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; -import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.scenario.Event; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; @@ -15,7 +15,6 @@ import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; /** * @@ -26,12 +25,11 @@ *

*
    *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl#getProperty Property}
  • - *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl#getEvent Event}
  • *
* * @generated */ -public abstract class StageImpl, P extends ClassProperty> extends MinimalEObjectImpl.Container implements Stage { +public abstract class StageImpl, P extends StateProperty> extends PhaseImpl implements Stage { /** * The cached value of the '{@link #getProperty() Property}' containment reference. * @@ -42,16 +40,6 @@ public abstract class StageImpl, P extends ClassProperty> */ protected P property; - /** - * The cached value of the '{@link #getEvent() Event}' containment reference. - * - * - * @see #getEvent() - * @generated - * @ordered - */ - protected E event; - /** * * @@ -114,49 +102,6 @@ else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.STAGE__PROPERTY, newProperty, newProperty)); } - /** - * - * - * @generated - */ - public E getEvent() { - return event; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetEvent(E newEvent, NotificationChain msgs) { - E oldEvent = event; - event = newEvent; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.STAGE__EVENT, oldEvent, newEvent); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setEvent(E newEvent) { - if (newEvent != event) { - NotificationChain msgs = null; - if (event != null) - msgs = ((InternalEObject)event).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.STAGE__EVENT, null, msgs); - if (newEvent != null) - msgs = ((InternalEObject)newEvent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.STAGE__EVENT, null, msgs); - msgs = basicSetEvent(newEvent, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.STAGE__EVENT, newEvent, newEvent)); - } - /** * * @@ -167,8 +112,6 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, switch (featureID) { case ScenarioPackage.STAGE__PROPERTY: return basicSetProperty(null, msgs); - case ScenarioPackage.STAGE__EVENT: - return basicSetEvent(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -183,8 +126,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ScenarioPackage.STAGE__PROPERTY: return getProperty(); - case ScenarioPackage.STAGE__EVENT: - return getEvent(); } return super.eGet(featureID, resolve, coreType); } @@ -201,9 +142,6 @@ public void eSet(int featureID, Object newValue) { case ScenarioPackage.STAGE__PROPERTY: setProperty((P)newValue); return; - case ScenarioPackage.STAGE__EVENT: - setEvent((E)newValue); - return; } super.eSet(featureID, newValue); } @@ -219,9 +157,6 @@ public void eUnset(int featureID) { case ScenarioPackage.STAGE__PROPERTY: setProperty((P)null); return; - case ScenarioPackage.STAGE__EVENT: - setEvent((E)null); - return; } super.eUnset(featureID); } @@ -236,8 +171,6 @@ public boolean eIsSet(int featureID) { switch (featureID) { case ScenarioPackage.STAGE__PROPERTY: return property != null; - case ScenarioPackage.STAGE__EVENT: - return event != null; } return super.eIsSet(featureID); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/TestSuiteImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/TestSuiteImpl.java new file mode 100644 index 000000000..260651a12 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/TestSuiteImpl.java @@ -0,0 +1,152 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.scenario.Scenario; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.TestSuite; + +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.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Test Suite'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl#getTests Tests}
  • + *
+ * + * @generated + */ +public abstract class TestSuiteImpl> extends MinimalEObjectImpl.Container implements TestSuite { + /** + * The cached value of the '{@link #getTests() Tests}' containment reference list. + * + * + * @see #getTests() + * @generated + * @ordered + */ + protected EList tests; + + /** + * + * + * @generated + */ + protected TestSuiteImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.TEST_SUITE; + } + + /** + * + * + * @generated + */ + public EList getTests() { + if (tests == null) { + tests = new EObjectContainmentEList(Scenario.class, this, ScenarioPackage.TEST_SUITE__TESTS); + } + return tests; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.TEST_SUITE__TESTS: + return ((InternalEList)getTests()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.TEST_SUITE__TESTS: + return getTests(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.TEST_SUITE__TESTS: + getTests().clear(); + getTests().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.TEST_SUITE__TESTS: + getTests().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.TEST_SUITE__TESTS: + return tests != null && !tests.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //TestSuiteImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java index 640e92200..11c09547c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java @@ -2,7 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario.util; -import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.scenario.*; @@ -70,7 +70,7 @@ public boolean isFactoryForType(Object object) { protected ScenarioSwitch modelSwitch = new ScenarioSwitch() { @Override - public > Adapter caseScenario(Scenario object) { + public

> Adapter caseScenario(Scenario

object) { return createScenarioAdapter(); } @Override @@ -78,10 +78,34 @@ public Adapter caseEvent(Event object) { return createEventAdapter(); } @Override - public , P extends ClassProperty> Adapter caseStage(Stage object) { + public , P extends StateProperty> Adapter caseStage(Stage object) { return createStageAdapter(); } @Override + public Adapter caseElementProvider(ElementProvider object) { + return createElementProviderAdapter(); + } + @Override + public Adapter caseElementReference(ElementReference object) { + return createElementReferenceAdapter(); + } + @Override + public > Adapter caseElementQuery(ElementQuery object) { + return createElementQueryAdapter(); + } + @Override + public > Adapter caseTestSuite(TestSuite object) { + return createTestSuiteAdapter(); + } + @Override + public > Adapter caseDate(Date object) { + return createDateAdapter(); + } + @Override + public > Adapter casePhase(Phase object) { + return createPhaseAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -143,6 +167,90 @@ public Adapter createStageAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ElementProvider Element Provider}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.ElementProvider + * @generated + */ + public Adapter createElementProviderAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ElementReference Element Reference}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.ElementReference + * @generated + */ + public Adapter createElementReferenceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ElementQuery Element Query}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.ElementQuery + * @generated + */ + public Adapter createElementQueryAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.TestSuite Test Suite}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.TestSuite + * @generated + */ + public Adapter createTestSuiteAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.Date Date}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.Date + * @generated + */ + public Adapter createDateAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.Phase Phase}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.Phase + * @generated + */ + public Adapter createPhaseAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java index e42dcd64c..7ea1f2eb8 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java @@ -2,7 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario.util; -import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.scenario.*; @@ -83,6 +83,46 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { case ScenarioPackage.STAGE: { Stage stage = (Stage)theEObject; T1 result = caseStage(stage); + if (result == null) result = casePhase(stage); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.ELEMENT_PROVIDER: { + ElementProvider elementProvider = (ElementProvider)theEObject; + T1 result = caseElementProvider(elementProvider); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.ELEMENT_REFERENCE: { + ElementReference elementReference = (ElementReference)theEObject; + T1 result = caseElementReference(elementReference); + if (result == null) result = caseElementProvider(elementReference); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.ELEMENT_QUERY: { + ElementQuery elementQuery = (ElementQuery)theEObject; + T1 result = caseElementQuery(elementQuery); + if (result == null) result = caseElementProvider(elementQuery); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.TEST_SUITE: { + TestSuite testSuite = (TestSuite)theEObject; + T1 result = caseTestSuite(testSuite); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.DATE: { + Date date = (Date)theEObject; + T1 result = caseDate(date); + if (result == null) result = casePhase(date); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.PHASE: { + Phase phase = (Phase)theEObject; + T1 result = casePhase(phase); if (result == null) result = defaultCase(theEObject); return result; } @@ -101,7 +141,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public > T1 caseScenario(Scenario object) { + public

> T1 caseScenario(Scenario

object) { return null; } @@ -131,7 +171,97 @@ public T1 caseEvent(Event object) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public , P extends ClassProperty> T1 caseStage(Stage object) { + public , P extends StateProperty> T1 caseStage(Stage object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Element Provider'. + * + * 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 'Element Provider'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseElementProvider(ElementProvider object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Element Reference'. + * + * 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 'Element Reference'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseElementReference(ElementReference object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Element Query'. + * + * 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 'Element Query'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public > T1 caseElementQuery(ElementQuery object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Test Suite'. + * + * 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 'Test Suite'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public > T1 caseTestSuite(TestSuite object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Date'. + * + * 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 'Date'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public > T1 caseDate(Date object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Phase'. + * + * 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 'Phase'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public > T1 casePhase(Phase object) { return null; } diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java index b24885682..93ab8e7db 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java @@ -48,7 +48,8 @@ protected void extractInformation() throws CoreException { _modelEntryPoint = getAttribute(LAUNCH_MODEL_ENTRY_POINT, ""); _modelInitializationMethod = getAttribute(LAUNCH_INITIALIZATION_METHOD, ""); _modelInitializationArguments = getAttribute(LAUNCH_INITIALIZATION_ARGUMENTS, ""); - _scenarioURI = URI.createPlatformResourceURI(getAttribute(LAUNCH_SCENARIO_URI, ""), true); + String scenarioPath = getAttribute(LAUNCH_SCENARIO_URI, ""); + _scenarioURI = scenarioPath.length() > 0 ? URI.createPlatformResourceURI(scenarioPath, true) : null; _melangeQuery = getAttribute(LAUNCH_MELANGE_QUERY, ""); for (EngineAddonSpecificationExtension extension : EngineAddonSpecificationExtensionPoint.getSpecifications()) { diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java index 53be0fb80..4c3c435ab 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java @@ -10,11 +10,14 @@ *******************************************************************************/ package org.gemoc.executionframework.engine.core; - +import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.PrintWriter; import java.util.ArrayList; import java.util.Set; +import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EOperation; @@ -25,41 +28,42 @@ import org.gemoc.xdsmlframework.api.core.IExecutionContext; import org.gemoc.xdsmlframework.api.core.IExecutionEngine; -import fr.inria.diverse.k3.al.annotationprocessor.stepmanager.EventManagerRegistry; -import fr.inria.diverse.k3.al.annotationprocessor.stepmanager.IEventManager; +import fr.inria.diverse.event.commons.model.IEventManager; import fr.inria.diverse.trace.commons.model.generictrace.GenericSequentialStep; import fr.inria.diverse.trace.commons.model.generictrace.GenerictraceFactory; import fr.inria.diverse.trace.commons.model.trace.GenericMSE; import fr.inria.diverse.trace.commons.model.trace.MSE; import fr.inria.diverse.trace.commons.model.trace.MSEModel; import fr.inria.diverse.trace.commons.model.trace.MSEOccurrence; -import fr.inria.diverse.trace.commons.model.trace.SequentialStep; import fr.inria.diverse.trace.commons.model.trace.Step; import fr.inria.diverse.trace.commons.model.trace.TraceFactory; import fr.inria.diverse.trace.gemoc.api.IMultiDimensionalTraceAddon; - /** * Abstract class providing a basic implementation for sequential engines - * + * * @author Didier Vojtisek * */ public abstract class AbstractSequentialExecutionEngine extends AbstractExecutionEngine implements IExecutionEngine { private MSEModel _actionModel; - private IMultiDimensionalTraceAddon traceAddon; + private IMultiDimensionalTraceAddon traceAddon; + private IEventManager eventManagerAddon; protected abstract void executeEntryPoint(); - + /** * if it exists, calls the method tagged as @Initialize */ protected abstract void initializeModel(); /** - * search for an applicable entry point for the simulation, this is typically a method having the @Main annotation - * @param executionContext the execution context of the simulation + * search for an applicable entry point for the simulation, this is + * typically a method having the @Main annotation + * + * @param executionContext + * the execution context of the simulation */ protected abstract void prepareEntryPoint(IExecutionContext executionContext); @@ -72,8 +76,17 @@ public abstract class AbstractSequentialExecutionEngine extends AbstractExecutio public final void performInitialize(IExecutionContext executionContext) { @SuppressWarnings("rawtypes") Set traceManagers = this.getAddonsTypedBy(IMultiDimensionalTraceAddon.class); - if (!traceManagers.isEmpty()) + if (!traceManagers.isEmpty()) { this.traceAddon = traceManagers.iterator().next(); + } + Set eventManagers = this.getAddonsTypedBy(IEventManager.class); + if (!eventManagers.isEmpty()) { + eventManagerAddon = eventManagers.iterator().next(); + URI scenarioURI = executionContext.getRunConfiguration().getScenarioURI(); + if (scenarioURI != null) { + eventManagerAddon.loadScenario(scenarioURI, executionContext.getResourceModel().getResourceSet()); + } + } prepareEntryPoint(executionContext); prepareInitializeModel(executionContext); } @@ -86,16 +99,13 @@ protected final void performStart() { Activator.getDefault().info("Execution finished"); } + protected void handleOutputEvent(Object result, Object caller, String className, String methodName) { + eventManagerAddon.receiveEvent(result, caller, className, methodName); + } + private void manageEvents() { - MSEOccurrence mse = getCurrentMSEOccurrence(); - if (mse != null) { - EObject container = mse.eContainer(); - if (container instanceof SequentialStep) { - IEventManager eventManager = EventManagerRegistry.getInstance().findEventManager(); - if (eventManager != null) { - eventManager.manageEvents(); - } - } + if (eventManagerAddon != null) { + eventManagerAddon.manageEvents(); } } @@ -104,7 +114,7 @@ protected final void afterExecutionStep() { manageEvents(); super.afterExecutionStep(); } - + /** * To be called just before each execution step by an implementing engine. */ @@ -189,14 +199,17 @@ private EOperation findOperation(EObject object, String className, String method return operation; } - - /** - * Find the MSE element for the triplet caller/className/MethodName in the model of precalculated possible MSE. - * If it doesn't exist yet, create one and add it to the model. - * @param caller the caller object - * @param className the class containing the method - * @param methodName the name of the method + * Find the MSE element for the triplet caller/className/MethodName in the + * model of precalculated possible MSE. If it doesn't exist yet, create one + * and add it to the model. + * + * @param caller + * the caller object + * @param className + * the class containing the method + * @param methodName + * the name of the method * @return the retrieved or created MSE */ public final MSE findOrCreateMSE(EObject caller, String className, String methodName) { @@ -248,14 +261,15 @@ protected void doExecute() { return mse; } + private long t = 0; + @Override protected void beforeStart() { - // TODO Auto-generated method stub } @Override protected void performStop() { - // TODO Auto-generated method stub + } @Override diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/META-INF/MANIFEST.MF index 3f1c8083e..7b2bf260c 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/META-INF/MANIFEST.MF @@ -11,6 +11,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.emf.ecore, fr.inria.diverse.trace.commons.model, org.eclipse.xtext, - fr.inria.diverse.event.commons.model;bundle-version="1.0.0" + fr.inria.diverse.event.commons.model;bundle-version="1.0.0", + fr.inria.diverse.event.commons.interpreter;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java index 147180711..6e46cd840 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java @@ -15,15 +15,15 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; import org.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; import org.gemoc.xdsmlframework.api.core.IExecutionEngine; import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; -import fr.inria.diverse.event.commons.model.EventManagerRegistry; +import fr.inria.diverse.event.commons.model.EventInstance; import fr.inria.diverse.event.commons.model.IEventManager; import fr.inria.diverse.trace.commons.model.trace.Step; import javafx.application.Platform; @@ -49,17 +49,17 @@ public class EventManagerRenderer extends Pane implements IEngineAddon { private final ObservableList eventList = FXCollections.observableArrayList(); - private final ObservableList pushedEvents = FXCollections.observableArrayList(); + private final ObservableList pushedEvents = FXCollections.observableArrayList(); private final Map eventTypeToEventTableView = new HashMap<>(); - private final Map> eventTypeToSelectedEvents = new HashMap<>(); + private final Map> eventTypeToSelectedEvents = new HashMap<>(); private final ScrollPane scrollPane = new ScrollPane(); private final ListView eventListView = new ListView<>(eventList); - private final ListView pushedEventListView = new ListView<>(pushedEvents); + private final ListView pushedEventListView = new ListView<>(pushedEvents); private final BorderPane borderPane = new BorderPane(); @@ -126,10 +126,10 @@ public EClass fromString(String string) { c.getAddedSubList().stream().forEach(e -> { final EventTableView tableView = new EventTableView(e, executedModel, eventManager); eventTypeToEventTableView.put(e, tableView); - final List selectedEvents = new ArrayList<>(); + final List selectedEvents = new ArrayList<>(); eventTypeToSelectedEvents.put(e, selectedEvents); - final ListChangeListener selectedEventsChangeListener = c1 -> { + final ListChangeListener selectedEventsChangeListener = c1 -> { while (c1.next()) { selectedEvents.removeAll(c1.getRemoved()); selectedEvents.addAll(c1.getAddedSubList()); @@ -191,7 +191,10 @@ public void engineStarted(IExecutionEngine executionEngine) { @Override public void engineInitialized(IExecutionEngine executionEngine) { - setEventManager(EventManagerRegistry.getInstance().findEventManager()); + Set eventManagers = executionEngine.getAddonsTypedBy(IEventManager.class); + if (!eventManagers.isEmpty()) { + setEventManager(eventManagers.iterator().next()); + } } @Override diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerViewPart.java b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerViewPart.java index 43de4b549..048e4fffe 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerViewPart.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerViewPart.java @@ -26,7 +26,7 @@ public class EventManagerViewPart extends EngineSelectionDependentViewPart { public static final String ID = "org.gemoc.executionframework.eventmanager.views.EventManager"; private FXCanvas fxCanvas; - + private EventManagerRenderer eventManagerRenderer; public void createPartControl(Composite parent) { @@ -34,9 +34,9 @@ public void createPartControl(Composite parent) { eventManagerRenderer = new EventManagerRenderer(); Scene scene = new Scene(eventManagerRenderer); fxCanvas.setScene(scene); - + parent.getShell().addListener(SWT.Resize, (e) -> { - + }); } diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java index 71b11c521..bdbc014da 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java @@ -14,19 +14,24 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EFactory; +import org.eclipse.emf.ecore.EGenericType; 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.xtext.naming.DefaultDeclarativeQualifiedNameProvider; import org.eclipse.xtext.naming.QualifiedName; +import fr.inria.diverse.event.commons.model.EventInstance; import fr.inria.diverse.event.commons.model.IEventManager; +import fr.inria.diverse.event.commons.model.scenario.Event; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import javafx.application.Platform; import javafx.beans.property.ReadOnlyObjectWrapper; @@ -35,60 +40,74 @@ import javafx.collections.ObservableList; import javafx.scene.control.TableColumn; import javafx.scene.control.TableColumn.CellDataFeatures; -import javafx.scene.control.TableRow; import javafx.scene.control.TableView; +import javafx.scene.control.cell.TextFieldTableCell; import javafx.util.Callback; -public class EventTableView extends TableView { +//public class EventTableView extends TableView { +public class EventTableView extends TableView { private final EClass eventClass; - - private final EClassifier eventTargetClass; - - private final EReference eventTargetReference; private final EFactory factory; private final Resource executedModel; -// private final List eventParameterClasses = new ArrayList<>(); + private final List eventParameterClasses = new ArrayList<>(); + + private final Map referenceToParameterClass = new HashMap<>(); private final Map> referenceToMatchingModelElements = new HashMap<>(); - private final ObservableList events = FXCollections.observableArrayList(); +// private final ObservableList events = FXCollections.observableArrayList(); + private final ObservableList events = FXCollections.observableArrayList(); - private final Function canDisplayEventFunction; + private final Function canDisplayEventFunction; public EventTableView(final EClass eventClass, final Resource executedModel, final IEventManager eventManager) { this.eventClass = eventClass; - eventTargetClass = eventClass.getEGenericSuperTypes().get(0).getETypeArguments().get(0).getEClassifier(); - eventTargetReference = ScenarioPackage.Literals.EVENT__TARGET; this.factory = eventClass.getEPackage().getEFactoryInstance(); this.executedModel = executedModel; -// eventParameterClasses.addAll(eventClass.getEReferences().stream().map(r -> r.eClass()).collect(Collectors.toList())); + extractEventTarget(); + extractEventParameters(); setItems(events); - + setEditable(true); + canDisplayEventFunction = (event) -> { return eventManager.canSendEvent(event); }; - final List> columns = new ArrayList<>(); - eventClass.getEAllReferences().stream().forEach(r -> { - final TableColumn col = new TableColumn(r.getName()); - col.setCellValueFactory(new EObjectPropertyValueFactory(r)); - columns.add(col); + final List> columns = new ArrayList<>(); + eventClass.getEAllStructuralFeatures().stream().forEach(f -> { + if (f instanceof EReference) { + final String name = f.getName().substring(0, f.getName().indexOf("Provider")); + final TableColumn col = new TableColumn(name); + col.setCellValueFactory(new EventInstanceReferencePropertyValueFactory((EReference) f)); + columns.add(col); + } else { + final String name = f.getName(); + final TableColumn col = new TableColumn(name); + col.setEditable(true); + col.setCellValueFactory(new EventInstanceAttributePropertyValueFactory((EAttribute) f)); + col.setCellFactory(TextFieldTableCell.forTableColumn()); + col.setOnEditCommit(editEvent -> { + EventInstance event = editEvent.getRowValue(); + event.getParameters().put(f, editEvent.getNewValue()); + }); + columns.add(col); + } }); - setRowFactory(tv -> { - TableRow row = new TableRow<>(); - row.setOnMouseClicked(event -> { - if (event.getClickCount() == 2 && (!row.isEmpty())) { - EObject rowData = row.getItem(); - eventManager.sendEvent(rowData); - } - }); - return row; - }); +// setRowFactory(tv -> { +// TableRow row = new TableRow<>(); +// row.setOnMouseClicked(event -> { +// if (event.getClickCount() == 3 && (!row.isEmpty())) { +// EventInstance rowData = row.getItem(); +// eventManager.sendEvent(rowData); +// } +// }); +// return row; +// }); getColumns().setAll(columns); @@ -98,49 +117,56 @@ public void refreshEvents() { Platform.runLater(() -> { referenceToMatchingModelElements.clear(); gatherPotentialParameters(); - -// final List newEvents = computeAllPossibleEvents().stream().filter(m -> { -// return !events.stream().anyMatch(event -> { -// return m.entrySet().stream().allMatch(entry -> { -// final EReference ref = entry.getKey(); -// final Object val1 = event.eGet(ref); -// final EObject val2 = entry.getValue(); -// return val1 == val2; -// }); -// }); -// }).map(m -> { -// final EObject event = factory.create(eventClass); -// m.entrySet().forEach(entry -> { -// event.eSet(entry.getKey(), entry.getValue()); -// }); -// return event; -// }).filter(event -> canDisplayEventFunction.apply(event)).collect(Collectors.toList()); -// -// final List toRemove = events.stream().filter(event -> canDisplayEventFunction.apply(event)).collect(Collectors.toList()); -// -// events.removeAll(toRemove); -// events.addAll(newEvents); - - events.clear(); - events.addAll(computeAllPossibleEvents().stream().map(m -> { - final EObject event = factory.create(eventClass); - m.entrySet().forEach(entry -> { - event.eSet(entry.getKey(), entry.getValue()); + + final List newEvents = computeAllPossibleEvents().stream().filter(m -> { + return !events.stream().anyMatch(event -> { + return m.entrySet().stream().allMatch(entry -> { + final EStructuralFeature ref = entry.getKey(); + final Object val1 = event.getParameters().get(ref); + final Object val2 = entry.getValue(); + return val1 == val2; + }); }); - return event; - }).filter(event -> canDisplayEventFunction.apply(event)).collect(Collectors.toList())); + }).map(m -> { + return new EventInstance((Event) factory.create(eventClass), m); + }).filter(event -> canDisplayEventFunction.apply(event)).collect(Collectors.toList()); + + final List toRemove = events.stream().filter(event -> !canDisplayEventFunction.apply(event)) + .collect(Collectors.toList()); + + events.removeAll(toRemove); + events.addAll(newEvents); + }); + } + + private void extractEventTarget() { + final List genericTypes = eventClass.getEGenericSuperTypes(); + final List typeArguments = genericTypes.get(0).getETypeArguments(); + final EClass correspondingClass = (EClass) typeArguments.get(0).getEClassifier(); + eventParameterClasses.add(correspondingClass); + referenceToParameterClass.put(ScenarioPackage.Literals.EVENT__TARGET_PROVIDER, correspondingClass); + } + + private void extractEventParameters() { + eventClass.getEReferences().forEach(f -> { + final List genericTypes = ((EClass) f.getEType()).getEGenericSuperTypes(); + final List typeArguments = genericTypes.get(0).getETypeArguments(); + final EClass correspondingClass = (EClass) typeArguments.get(0).getEClassifier(); + eventParameterClasses.add(correspondingClass); + referenceToParameterClass.put(f, correspondingClass); }); } private void gatherPotentialParameters() { - final List eventParameters = eventClass.getEReferences(); + final Set eventParameters = referenceToParameterClass.keySet(); executedModel.getAllContents().forEachRemaining(modelElement -> { final EClass elementClass = modelElement.eClass(); - final List matchingParameters = eventParameters.stream().filter(r -> { - return elementClass.getClassifierID() == r.getEType().getClassifierID() - || elementClass.getEAllSuperTypes().contains(r.getEType()); - }).collect(Collectors.toList()); - matchingParameters.forEach(r -> { + eventParameters.stream().filter(r -> { + final EClass parameterClass = referenceToParameterClass.get(r); + return elementClass.getClassifierID() == parameterClass.getClassifierID() + || elementClass.getEAllSuperTypes().contains(parameterClass); + }) + .forEach(r -> { List elements = referenceToMatchingModelElements.get(r); if (elements == null) { elements = new ArrayList<>(); @@ -148,27 +174,18 @@ private void gatherPotentialParameters() { } elements.add(modelElement); }); - if (elementClass.getClassifierID() == eventTargetClass.getClassifierID() - || elementClass.getEAllSuperTypes().contains(eventTargetClass)) { - List elements = referenceToMatchingModelElements.get(eventTargetReference); - if (elements == null) { - elements = new ArrayList<>(); - referenceToMatchingModelElements.put(eventTargetReference, elements); - } - elements.add(modelElement); - } }); } - private List> computeAllPossibleEvents() { - final List> result = new ArrayList<>(); + private List> computeAllPossibleEvents() { + final List> result = new ArrayList<>(); final int nbEvents = referenceToMatchingModelElements.values().stream().map(l -> l.size()) .reduce((i1, i2) -> i1 * i2).orElse(0); final List>> entries = new ArrayList<>( referenceToMatchingModelElements.entrySet()); for (int i = 0; i < nbEvents; i++) { int j = 1; - final Map parametersAssociation = new HashMap<>(); + final Map parametersAssociation = new HashMap<>(); for (Map.Entry> entry : entries) { final List modelElements = entry.getValue(); parametersAssociation.put(entry.getKey(), modelElements.get((i / j) % modelElements.size())); @@ -179,31 +196,30 @@ private List> computeAllPossibleEvents() { return result; } - static class EObjectPropertyValueFactory - implements Callback, ObservableValue> { + static class EventInstanceReferencePropertyValueFactory + implements Callback, ObservableValue> { private final EReference reference; - private final Function stringGetter; private final DefaultDeclarativeQualifiedNameProvider nameprovider = new DefaultDeclarativeQualifiedNameProvider(); + private final Function stringGetter = (o) -> { + if (o instanceof EObject) { + QualifiedName qname = nameprovider.getFullyQualifiedName((EObject) o); + if (qname != null) { + return qname.toString(); + } + } + final String string = o.toString(); + return string.substring(string.lastIndexOf(".") + 1); + }; - public EObjectPropertyValueFactory(EReference reference) { + public EventInstanceReferencePropertyValueFactory(EReference reference) { this.reference = reference; - stringGetter = (o) -> { - if (o instanceof EObject) { - QualifiedName qname = nameprovider.getFullyQualifiedName((EObject) o); - if (qname != null) { - return qname.toString(); - } - } - final String string = o.toString(); - return string.substring(string.lastIndexOf(".") + 1); - }; } @Override - public ObservableValue call(CellDataFeatures p) { - EObject object = p.getValue(); - Object refValue = object.eGet(reference); + public ObservableValue call(CellDataFeatures p) { + EventInstance event = p.getValue(); + Object refValue = event.getParameters().get(reference); if (refValue != null) { String string = stringGetter.apply(refValue); ObservableValue result = new ReadOnlyObjectWrapper(string); @@ -212,4 +228,25 @@ public ObservableValue call(CellDataFeatures p) { return null; } } + + static class EventInstanceAttributePropertyValueFactory + implements Callback, ObservableValue> { + + private final EAttribute attribute; + + public EventInstanceAttributePropertyValueFactory(EAttribute attribute) { + this.attribute = attribute; + } + + @Override + public ObservableValue call(CellDataFeatures p) { + EventInstance event = p.getValue(); + Object refValue = event.getParameters().get(attribute); + if (refValue != null) { + ObservableValue result = new ReadOnlyObjectWrapper(refValue.toString()); + return result; + } + return null; + } + } } diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java index c23f69f75..b08828d9e 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java @@ -34,7 +34,7 @@ import org.gemoc.xdsmlframework.api.core.IExecutionEngine; import fr.inria.diverse.event.commons.interpreter.property.ClassPropertyAspect; -import fr.inria.diverse.event.commons.model.property.ClassProperty; +import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.melange.resource.MelangeResourceImpl; import fr.inria.diverse.trace.commons.model.trace.MSE; import fr.inria.diverse.trace.commons.model.trace.MSEOccurrence; @@ -235,19 +235,19 @@ public boolean shouldBreak(EObject instruction) { return false; } - private final Map propertyCache = new HashMap<>(); + private final Map propertyCache = new HashMap<>(); private boolean checkBreakpointProperty(EObject originalObject, EObject actualObject) { boolean propertyResult = true; final String propertyURI = (String)getBreakpointAttributes(originalObject, GemocBreakpoint.PROPERTY); if (propertyURI != null && !propertyURI.isEmpty()) { - ClassProperty property = propertyCache.computeIfAbsent(propertyURI, p -> { + StateProperty property = propertyCache.computeIfAbsent(propertyURI, p -> { Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); final Resource resource = originalObject.eResource().getResourceSet().getResource(URI.createFileURI(propertyURI), true); EcoreUtil.resolveAll(resource); final EObject content = resource.getContents().get(0); - if (content != null && content instanceof ClassProperty) { - return (ClassProperty) content; + if (content != null && content instanceof StateProperty) { + return (StateProperty) content; } return null; }); diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java index f172d54f6..f3442f55d 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java @@ -157,8 +157,9 @@ public void initializeFrom(ILaunchConfiguration configuration) { .getLanguageName()); _modelInitializationArgumentsText.setText(runConfiguration.getModelInitializationArguments()); - _scenarioLocationText.setText(URIHelper - .removePlatformScheme(runConfiguration.getScenarioURI())); + URI scenarioURI = runConfiguration.getScenarioURI(); + _scenarioLocationText.setText(scenarioURI == null ? "" : + URIHelper.removePlatformScheme(scenarioURI)); _entryPointModelElementLabel.setText(""); updateMainElementName(); diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine/src/org/gemoc/execution/sequential/javaengine/PlainK3ExecutionEngine.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine/src/org/gemoc/execution/sequential/javaengine/PlainK3ExecutionEngine.java index 61b9dffda..8fe1c5c3c 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine/src/org/gemoc/execution/sequential/javaengine/PlainK3ExecutionEngine.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine/src/org/gemoc/execution/sequential/javaengine/PlainK3ExecutionEngine.java @@ -62,7 +62,8 @@ import fr.inria.diverse.trace.commons.model.launchconfiguration.ModelURIParameter; /** - * Implementation of the GEMOC Execution engine dedicated to run Kermeta 3 operational semantic + * Implementation of the GEMOC Execution engine dedicated to run Kermeta 3 + * operational semantic * * @author Didier Vojtisek * @@ -223,7 +224,7 @@ protected void prepareInitializeModel(IExecutionContext executionContext) { } /** - * Invoke the initialize method + * Invoke the initialize method */ private void callInitializeModel() { try { @@ -242,22 +243,24 @@ private void callInitializeModel() { throw new RuntimeException(e); } } - + @Override protected void initializeModel() { - if(initializeMethod != null){ + if (initializeMethod != null) { StepManagerRegistry.getInstance().registerManager(PlainK3ExecutionEngine.this); try { - final boolean isStepMethod = initializeMethod.isAnnotationPresent(fr.inria.diverse.k3.al.annotationprocessor.Step.class); - if(!isStepMethod){ + final boolean isStepMethod = initializeMethod + .isAnnotationPresent(fr.inria.diverse.k3.al.annotationprocessor.Step.class); + if (!isStepMethod) { fr.inria.diverse.k3.al.annotationprocessor.stepmanager.StepCommand command = new fr.inria.diverse.k3.al.annotationprocessor.stepmanager.StepCommand() { - @Override - public void execute() { - callInitializeModel(); - } - }; - fr.inria.diverse.k3.al.annotationprocessor.stepmanager.IStepManager stepManager = PlainK3ExecutionEngine.this; - stepManager.executeStep(entryPointMethodParameters.get(0),command,entryPointClass.getName(),initializeMethod.getName()); + @Override + public void execute() { + callInitializeModel(); + } + }; + fr.inria.diverse.k3.al.annotationprocessor.stepmanager.IStepManager stepManager = PlainK3ExecutionEngine.this; + stepManager.executeStep(entryPointMethodParameters.get(0), command, entryPointClass.getName(), + initializeMethod.getName()); } else { callInitializeModel(); } @@ -300,13 +303,16 @@ protected void executeEntryPoint() { * fr.inria.diverse.k3.al.annotationprocessor.stepmanager.StepCommand, * java.lang.String) */ - public void executeStep(Object caller, final StepCommand command, String className, String methodName) { + public void executeStep(Object caller, final StepCommand command, String className, String methodName, boolean output) { executeOperation(caller, className, methodName, new Runnable() { @Override public void run() { command.execute(); } }); + if (output) { + handleOutputEvent(command.getResult(), caller, className, methodName); + } } @Override @@ -427,7 +433,9 @@ private static InternalTransactionalEditingDomain getEditingDomain(ResourceSet r /** * Load the model for the given URI - * @param modelURI to load + * + * @param modelURI + * to load * @return the loaded resource */ public static Resource loadModel(URI modelURI) { @@ -446,10 +454,12 @@ public static Resource loadModel(URI modelURI) { @Override public LaunchConfiguration extractLaunchConfiguration() { final IRunConfiguration configuration = getExecutionContext().getRunConfiguration(); - final LaunchConfiguration launchConfiguration = LaunchconfigurationFactory.eINSTANCE.createLaunchConfiguration(); + final LaunchConfiguration launchConfiguration = LaunchconfigurationFactory.eINSTANCE + .createLaunchConfiguration(); launchConfiguration.setType(LAUNCH_CONFIGURATION_TYPE); if (configuration.getLanguageName() != "") { - final LanguageNameParameter languageNameParam = LaunchconfigurationFactory.eINSTANCE.createLanguageNameParameter(); + final LanguageNameParameter languageNameParam = LaunchconfigurationFactory.eINSTANCE + .createLanguageNameParameter(); languageNameParam.setValue(configuration.getLanguageName()); launchConfiguration.getParameters().add(languageNameParam); } @@ -463,12 +473,14 @@ public LaunchConfiguration extractLaunchConfiguration() { final URI animatorURI = configuration.getAnimatorURI(); if (configuration.getAnimatorURI() != null) { final String scheme = animatorURI.scheme() + ":/resource"; - final AnimatorURIParameter animatorURIParam = LaunchconfigurationFactory.eINSTANCE.createAnimatorURIParameter(); + final AnimatorURIParameter animatorURIParam = LaunchconfigurationFactory.eINSTANCE + .createAnimatorURIParameter(); animatorURIParam.setValue(animatorURI.toString().substring(scheme.length())); launchConfiguration.getParameters().add(animatorURIParam); } if (configuration.getExecutionEntryPoint() != null) { - final EntryPointParameter entryPointParam = LaunchconfigurationFactory.eINSTANCE.createEntryPointParameter(); + final EntryPointParameter entryPointParam = LaunchconfigurationFactory.eINSTANCE + .createEntryPointParameter(); entryPointParam.setValue(configuration.getExecutionEntryPoint()); launchConfiguration.getParameters().add(entryPointParam); } @@ -490,7 +502,8 @@ public LaunchConfiguration extractLaunchConfiguration() { launchConfiguration.getParameters().add(initializationArgumentsParam); } configuration.getEngineAddonExtensions().forEach(extensionPoint -> { - final AddonExtensionParameter addonExtensionParam = LaunchconfigurationFactory.eINSTANCE.createAddonExtensionParameter(); + final AddonExtensionParameter addonExtensionParam = LaunchconfigurationFactory.eINSTANCE + .createAddonExtensionParameter(); addonExtensionParam.setValue(extensionPoint.getName()); launchConfiguration.getParameters().add(addonExtensionParam); }); From 5b5daa1e1c4be981f41ce9ad6c1d7c73624761c6 Mon Sep 17 00:00:00 2001 From: d-leroy Date: Tue, 23 May 2017 10:22:21 +0200 Subject: [PATCH 03/31] Updated scenario metamodel and scenario manager --- .../property/AbstractPropertyMonitor.java | 183 +++++ .../property/IPropertyListener.java | 6 + .../property/IPropertyMonitor.java | 14 + .../scenario/IScenarioManager.java | 1 - .../interpreter/scenario/ScenarioManager.java | 337 ++++++--- .../provider/PropertyItemProvider.java} | 16 +- .../PropertyItemProviderAdapterFactory.java | 24 - .../provider/StatePropertyItemProvider.java | 28 +- .../provider/StepPropertyItemProvider.java | 66 +- .../provider/EventReportItemProvider.java | 35 +- .../report/provider/ReportItemProvider.java | 8 +- .../ReportItemProviderAdapterFactory.java | 48 -- .../scenario/provider/DateItemProvider.java | 119 ---- ....java => EventOccurrenceItemProvider.java} | 71 +- ....java => ScenarioElementItemProvider.java} | 62 +- ...ider.java => ScenarioFSMItemProvider.java} | 87 ++- .../ScenarioFSMStateItemProvider.java} | 63 +- .../ScenarioFSMTransitionItemProvider.java | 220 ++++++ .../provider/ScenarioItemProvider.java | 4 +- .../presentation/PropertyModelWizard.java | 3 +- .../event/commons/model/IEventManager.java | 18 +- .../commons/model/property/Property.java | 18 + .../model/property/PropertyFactory.java | 9 - .../model/property/PropertyPackage.java | 176 ++++- .../commons/model/property/StateProperty.java | 3 +- .../commons/model/property/StepProperty.java | 53 +- .../commons/model/property/Stepping.java | 239 +++++++ .../property/impl/PropertyFactoryImpl.java | 35 +- .../model/property/impl/PropertyImpl.java | 39 + .../property/impl/PropertyPackageImpl.java | 71 +- .../property/impl/StatePropertyImpl.java | 3 +- .../model/property/impl/StepPropertyImpl.java | 155 +++- .../property/util/PropertyAdapterFactory.java | 18 + .../model/property/util/PropertySwitch.java | 33 + .../commons/model/report/EventParameter.java | 18 - .../commons/model/report/EventReport.java | 32 +- .../event/commons/model/report/Report.java | 15 +- .../commons/model/report/ReportFactory.java | 18 - .../commons/model/report/ReportPackage.java | 195 +---- .../commons/model/report/StageReport.java | 88 --- .../model/report/impl/EventParameterImpl.java | 39 - .../model/report/impl/EventReportImpl.java | 78 +- .../model/report/impl/ReportFactoryImpl.java | 22 - .../commons/model/report/impl/ReportImpl.java | 45 +- .../model/report/impl/ReportPackageImpl.java | 90 +-- .../model/report/impl/StageReportImpl.java | 252 ------- .../report/util/ReportAdapterFactory.java | 36 - .../model/report/util/ReportSwitch.java | 42 -- .../event/commons/model/scenario/Date.java | 49 -- .../model/scenario/EventOccurrence.java | 77 ++ .../event/commons/model/scenario/Phase.java | 50 -- .../commons/model/scenario/Scenario.java | 14 +- .../model/scenario/ScenarioElement.java | 71 ++ .../commons/model/scenario/ScenarioFSM.java | 100 +++ .../model/scenario/ScenarioFSMState.java | 88 +++ .../model/scenario/ScenarioFSMTransition.java | 109 +++ .../model/scenario/ScenarioPackage.java | 668 +++++++++++++----- .../event/commons/model/scenario/Stage.java | 50 -- .../commons/model/scenario/TestSuite.java | 41 -- .../commons/model/scenario/impl/DateImpl.java | 163 ----- ...haseImpl.java => EventOccurrenceImpl.java} | 103 ++- .../scenario/impl/ScenarioElementImpl.java | 218 ++++++ .../model/scenario/impl/ScenarioFSMImpl.java | 288 ++++++++ .../scenario/impl/ScenarioFSMStateImpl.java | 273 +++++++ .../impl/ScenarioFSMTransitionImpl.java | 368 ++++++++++ .../model/scenario/impl/ScenarioImpl.java | 42 +- .../scenario/impl/ScenarioPackageImpl.java | 357 +++++++--- .../model/scenario/impl/StageImpl.java | 178 ----- .../model/scenario/impl/TestSuiteImpl.java | 152 ---- .../scenario/util/ScenarioAdapterFactory.java | 82 ++- .../model/scenario/util/ScenarioSwitch.java | 99 ++- 71 files changed, 4483 insertions(+), 2392 deletions(-) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/AbstractPropertyMonitor.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyListener.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/EventParameterItemProvider.java => property/provider/PropertyItemProvider.java} (88%) delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/DateItemProvider.java rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/{TestSuiteItemProvider.java => EventOccurrenceItemProvider.java} (67%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/{PhaseItemProvider.java => ScenarioElementItemProvider.java} (66%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/{StageItemProvider.java => ScenarioFSMItemProvider.java} (59%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/StageReportItemProvider.java => scenario/provider/ScenarioFSMStateItemProvider.java} (71%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Property.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Stepping.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyImpl.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventParameter.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventParameterImpl.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Date.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/EventOccurrence.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Phase.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSM.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMState.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMTransition.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TestSuite.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/DateImpl.java rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/{PhaseImpl.java => EventOccurrenceImpl.java} (56%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMTransitionImpl.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/TestSuiteImpl.java diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/AbstractPropertyMonitor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/AbstractPropertyMonitor.java new file mode 100644 index 000000000..dd44af0c0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/AbstractPropertyMonitor.java @@ -0,0 +1,183 @@ +package fr.inria.diverse.event.commons.interpreter.property; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.resource.Resource; +import org.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; +import org.gemoc.xdsmlframework.api.core.IExecutionEngine; +import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; + +import fr.inria.diverse.event.commons.model.property.Property; +import fr.inria.diverse.event.commons.model.property.StateProperty; +import fr.inria.diverse.event.commons.model.property.StepProperty; +import fr.inria.diverse.event.commons.model.property.Stepping; +import fr.inria.diverse.trace.commons.model.trace.Step; + +public abstract class AbstractPropertyMonitor implements IEngineAddon, IPropertyMonitor { + + private Resource executedModel; + + private final Map monitoredProperties = new HashMap<>(); + + private final Map> propertyListeners = new HashMap<>(); + + private final Set ongoingSteps = new HashSet<>(); + + private final Set endedSteps = new HashSet<>(); + + private final Set endingSteps = new HashSet<>(); + + @Override + public boolean monitor(Property property) { + boolean result = false; + if (property instanceof StepProperty) { + final StepProperty stepProperty = (StepProperty) property; + final EOperation operation = stepProperty.getOperation(); + final Stepping stepping = stepProperty.getStepping(); + result = ongoingSteps.contains(operation) && stepping == Stepping.ONGOING || + endedSteps.contains(operation) && stepping == Stepping.ENDED || + endingSteps.contains(operation) && stepping == Stepping.ENDING; + } else { + result = evaluateStateProperty((StateProperty) property); + } + monitoredProperties.put(property, result); + return result; + } + + @Override + public void unmonitor(Property property) { + monitoredProperties.remove(property); + } + + private void updateProperties() { + propertyListeners.entrySet().stream().forEach(e -> { + final Property p = e.getKey(); + if (monitoredProperties.get(p) != monitor(p)) { + final boolean newValue = monitoredProperties.get(p); + e.getValue().forEach(l -> l.update(newValue)); + } + }); + } + + @Override + public void aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute) { + final EOperation operation = stepToExecute.getMseoccurrence().getMse().getAction(); + ongoingSteps.add(operation); + endedSteps.addAll(endingSteps); + endingSteps.clear(); + updateProperties(); + } + + @Override + public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { + final EOperation operation = stepExecuted.getMseoccurrence().getMse().getAction(); + endedSteps.addAll(endingSteps); + endingSteps.clear(); + endingSteps.add(operation); + updateProperties(); + } + + private boolean evaluateStateProperty(StateProperty property) { + final List eventReceivers = new ArrayList<>(); + final Object target = property.getTarget(); + if (target == null) { + Set eClasses = new HashSet<>(); + property.eClass().getEAllGenericSuperTypes().stream() + .forEach(t -> t.getETypeArguments().stream().forEach(a -> eClasses.add(a.getEClassifier()))); + final Iterator it = executedModel.getAllContents(); + while (it.hasNext()) { + EObject o = it.next(); + if (eClasses.contains(o.eClass()) && ClassPropertyAspect.evaluate(property, o)) { + eventReceivers.add(o); + } + } + } else { + final EObject target_cast = (EObject) target; + if (ClassPropertyAspect.evaluate(property, target_cast)) { + eventReceivers.add(target_cast); + } + } + return !eventReceivers.isEmpty(); + } + + @Override + public void addListener(Property property, IPropertyListener listener) { + List listeners = propertyListeners.get(property); + if (listeners == null) { + listeners = new ArrayList<>(); + propertyListeners.put(property, listeners); + } + listeners.add(listener); + listener.update(monitor(property)); + } + + @Override + public void removeListener(Property property, IPropertyListener listener) { + List listeners = propertyListeners.get(property); + if (listeners != null) { + listeners.remove(listener); + if (listeners.isEmpty()) { + propertyListeners.remove(property); + } + } + } + + @Override + public void engineAboutToStart(IExecutionEngine engine) { + executedModel = engine.getExecutionContext().getResourceModel(); + } + + @Override + public void engineInitialized(IExecutionEngine executionEngine) { + } + + @Override + public void engineStarted(IExecutionEngine executionEngine) { + } + + @Override + public void engineAboutToStop(IExecutionEngine engine) { + } + + @Override + public void engineStopped(IExecutionEngine engine) { + } + + @Override + public void engineAboutToDispose(IExecutionEngine engine) { + } + + @SuppressWarnings("rawtypes") + @Override + public void aboutToSelectStep(IExecutionEngine engine, Collection steps) { + } + + @SuppressWarnings("rawtypes") + @Override + public void proposedStepsChanged(IExecutionEngine engine, Collection steps) { + } + + @Override + public void stepSelected(IExecutionEngine engine, Step selectedStep) { + } + + @Override + public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { + } + + @Override + public List validate(List otherAddons) { + return Collections.emptyList(); + } +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyListener.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyListener.java new file mode 100644 index 000000000..906dd47ce --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyListener.java @@ -0,0 +1,6 @@ +package fr.inria.diverse.event.commons.interpreter.property; + +public interface IPropertyListener { + + void update(boolean propertyValue); +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java new file mode 100644 index 000000000..26ce07b48 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java @@ -0,0 +1,14 @@ +package fr.inria.diverse.event.commons.interpreter.property; + +import fr.inria.diverse.event.commons.model.property.Property; + +public interface IPropertyMonitor { + + boolean monitor(Property property); + + void unmonitor(Property property); + + void addListener(Property property, IPropertyListener listener); + + void removeListener(Property property, IPropertyListener listener); +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java index 430342665..b8d6ec57b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java @@ -6,7 +6,6 @@ public interface IScenarioManager { -// List> getEvents(); List getEvents(); boolean isScenarioComplete(); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java index 0e4d5044e..d4301dd56 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java @@ -3,14 +3,13 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; -import java.util.Deque; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.function.Supplier; +import java.util.stream.Stream; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EAttribute; @@ -27,130 +26,156 @@ import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; import fr.inria.diverse.event.commons.interpreter.property.ClassPropertyAspect; +import fr.inria.diverse.event.commons.interpreter.property.IPropertyListener; +import fr.inria.diverse.event.commons.interpreter.property.IPropertyMonitor; import fr.inria.diverse.event.commons.model.EventInstance; +import fr.inria.diverse.event.commons.model.IEventManager; +import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.Report; import fr.inria.diverse.event.commons.model.report.ReportFactory; -import fr.inria.diverse.event.commons.model.report.StageReport; -import fr.inria.diverse.event.commons.model.scenario.Date; import fr.inria.diverse.event.commons.model.scenario.ElementProvider; import fr.inria.diverse.event.commons.model.scenario.Event; -import fr.inria.diverse.event.commons.model.scenario.Phase; +import fr.inria.diverse.event.commons.model.scenario.EventOccurrence; import fr.inria.diverse.event.commons.model.scenario.Scenario; +import fr.inria.diverse.event.commons.model.scenario.ScenarioElement; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSM; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; -import fr.inria.diverse.event.commons.model.scenario.Stage; -import fr.inria.diverse.trace.commons.model.trace.MSEOccurrence; public class ScenarioManager implements IScenarioManager { private final Scenario scenario; - private final Iterator> stageIterator; private final Resource executedModel; - private final Supplier> stackSupplier; + private final IEventManager eventManager; + private final IPropertyMonitor propertyMonitor; + private final List> currentElements = new ArrayList<>(); + private final Map, ScenarioFSMState> currentFSMStates = new HashMap<>(); private final Report report; - private Phase currentPhase; - private EventInstance currentPendingEvent; - private long scheduledTime = -1; - private StageReport currentStageReport; - @SuppressWarnings({ "unchecked", "rawtypes" }) - public ScenarioManager(Scenario scenario, Resource executedModel, Supplier> stackSupplier) { + public ScenarioManager(Scenario scenario, Resource executedModel, IEventManager eventManager, + IPropertyMonitor propertyMonitor) { this.scenario = scenario; this.executedModel = executedModel; - this.stackSupplier = stackSupplier; - this.stageIterator = ((List>) this.scenario.getPhases()).iterator(); - this.currentPhase = stageIterator.next(); + this.eventManager = eventManager; + this.propertyMonitor = propertyMonitor; + scenario.getElements().forEach(element -> { + final Property property = element.getGuard(); + propertyMonitor.addListener(property, new ScenarioGuardListener(element, property)); + }); this.report = ReportFactory.eINSTANCE.createReport(); } @Override public List getEvents() { - if (stageIterator == null || System.nanoTime() < scheduledTime) { + if (currentElements.isEmpty()) { return Collections.emptyList(); } else { final List events = new ArrayList<>(); - if (currentPendingEvent != null && System.nanoTime() >= scheduledTime) { - events.add(currentPendingEvent); - currentPendingEvent = null; - scheduledTime = -1; - } - final List matches = new ArrayList<>(); - boolean searchForEvents = true; - while (searchForEvents) { - if (currentPhase instanceof Stage) { - final Stage currentStage = (Stage) currentPhase; - if (currentStage.getProperty() == null) { - matches.add(currentStage.getEvent()); - } else { - matches.addAll(evaluateStateProperty(currentStage.getProperty())); - } - } else if (currentPhase instanceof Date) { - final Date currentDate = (Date) currentPhase; - currentPendingEvent = createEvent(currentDate.getEvent()); - searchForEvents = false; - scheduledTime = currentDate.getTime() + System.nanoTime(); - } - - if (!matches.isEmpty()) { -// currentStageReport = ReportFactory.eINSTANCE.createStageReport(); -// report.getStages().add(currentStageReport); -// currentStageReport.setStage(currentPhase); -// currentStageReport.getMatches().addAll(matches); - if (currentPhase.getEvent() != null) { - events.add(createEvent(currentPhase.getEvent())); - } - if (stageIterator.hasNext()) { - currentPhase = stageIterator.next(); + while (events.addAll(gatherEventInstances())); + return events; + } + } + + private List gatherEventInstances() { + final List result = new ArrayList<>(); + final Stream> reachedSet = currentElements.stream().filter(e -> { + if (e.getGuard() == null || evaluateStateProperty(e.getGuard())) { + if (e instanceof ScenarioFSM) { + return getEventInstances((ScenarioFSM) e, result); + } else { + final EventOccurrence eventOccurrence = (EventOccurrence) e; + final EventInstance eventInstance = createEvent(eventOccurrence.getEvent()); + if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { + result.add(eventInstance); + return true; } else { - System.out.println("Scenario completed"); - currentPhase = null; - searchForEvents = false; + return false; } - } else { - searchForEvents = false; } + } else { + return false; } - return events; - } + }); + reachedSet.forEach(e -> { + currentElements.remove(e); + currentElements.addAll(e.getNextElements()); + }); + return result; } - @Override - public boolean isScenarioComplete() { - return stageIterator != null && currentPhase == null; + private void handleFSM(ScenarioFSM fsm) { + final ScenarioFSMState initialState = fsm.getInitialState(); + if (initialState.getEvent() != null) { + final EventInstance eventInstance = createEvent(initialState.getEvent()); + if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { + eventManager.sendEvent(eventInstance); + } + final Map fsmGuards = new HashMap<>(); + initialState.getOutgoingTransitions().forEach(t -> { + final Property property = t.getGuard(); + if (property != null) { + IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), property, fsmGuards); + fsmGuards.put(property, listener); + } + }); + fsmGuards.forEach((p, l) -> { + propertyMonitor.addListener(p, l); + }); + } } - @Override - public void saveScenarioReport() { - final ResourceSet resourceSet = scenario.eResource().getResourceSet(); - final TransactionalEditingDomain editingDomain = TransactionalEditingDomain.Factory.INSTANCE - .getEditingDomain(resourceSet); - final URI scenarioURI = scenario.eResource().getURI(); - final URI reportURI = scenarioURI.trimFileExtension().appendFileExtension("report"); - final Resource resource = resourceSet.createResource(reportURI); - final RecordingCommand command = new RecordingCommand(editingDomain) { - @Override - public void doExecute() { - resource.getContents().add(report); + private boolean getEventInstances(ScenarioFSM fsm, List result) { + ScenarioFSMState currentState = currentFSMStates.get(fsm); + boolean canProgress = true; + if (currentState == null) { + currentState = fsm.getInitialState(); + if (currentState.getEvent() != null) { + final EventInstance eventInstance = createEvent(currentState.getEvent()); + if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { + result.add(eventInstance); + currentFSMStates.put(fsm, currentState); + } else { + // The FSM is stuck as it is supposed to send an event is + // invalid or cannot be received, + // thus we 'rollback' to the previous state by not saving + // the current state. + canProgress = false; + } } - }; - EMFCommandTransaction transaction = new EMFCommandTransaction(command, - (InternalTransactionalEditingDomain) editingDomain, null); - try { - transaction.start(); - command.execute(); - transaction.commit(); - } catch (InterruptedException | RollbackException e) { - e.printStackTrace(); } - try { - resource.save((new PlatformResourceURIHandlerImpl()).createOutputStream(reportURI, Collections.emptyMap()), - Collections.emptyMap()); - } catch (IOException e) { - e.printStackTrace(); + if (canProgress) { + ScenarioFSMTransition fireableTransition = currentState.getOutgoingTransitions().stream() + .filter(t -> t.getGuard() == null || evaluateStateProperty(t.getGuard())).findFirst().orElse(null); + while (fireableTransition != null && canProgress) { + currentState = fireableTransition.getTarget(); + final EventInstance eventInstance = createEvent(currentState.getEvent()); + if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { + result.add(eventInstance); + currentFSMStates.put(fsm, currentState); + fireableTransition = currentState.getOutgoingTransitions().stream() + .filter(t -> t.getGuard() == null || evaluateStateProperty(t.getGuard())).findFirst() + .orElse(null); + } else { + // The FSM is stuck as it is supposed to send an event is + // invalid or cannot be received, + // thus we 'rollback' to the previous state by not saving + // the current state. + canProgress = false; + } + } + } + if (fsm.getAcceptingStates().contains(currentState)) { + // The FSM reached an accepting state, it will not be used again for + // this execution of the scenario + currentFSMStates.remove(fsm); + return true; } + return false; } - + private EventInstance createEvent(Event originalEvent) { final ElementProvider targetProvider = originalEvent.getTargetProvider(); final List eventParameterMatches = new ArrayList<>(); @@ -172,17 +197,19 @@ private EventInstance createEvent(Event originalEvent) { } } } -// final EventReport eventReport = ReportFactory.eINSTANCE.createEventReport(); -// currentStageReport.getEvents().add(eventReport); -// eventReport.setEvent(originalEvent); - // TODO eventReport.getMatches().addAll(eventParameterMatches); + final EventReport eventReport = ReportFactory.eINSTANCE.createEventReport(); + if (eventParameterMatches.size() > 1) { + eventReport.getMatches().addAll(eventParameterMatches.subList(1, eventParameterMatches.size() - 1)); + } + eventReport.setEvent(originalEvent); + report.getEvents().add(eventReport); return new EventInstance(originalEvent, parameters); } } return null; } - private List evaluateStateProperty(StateProperty property) { + private boolean evaluateStateProperty(StateProperty property) { final List eventReceivers = new ArrayList<>(); final Object target = property.getTarget(); if (target == null) { @@ -202,6 +229,128 @@ private List evaluateStateProperty(StateProperty property) { eventReceivers.add(target_cast); } } - return eventReceivers; + return !eventReceivers.isEmpty(); + } + + @Override + public boolean isScenarioComplete() { + return currentElements.isEmpty(); + } + + @Override + public void saveScenarioReport() { + final ResourceSet resourceSet = scenario.eResource().getResourceSet(); + final TransactionalEditingDomain editingDomain = TransactionalEditingDomain.Factory.INSTANCE + .getEditingDomain(resourceSet); + final URI scenarioURI = scenario.eResource().getURI(); + final URI reportURI = scenarioURI.trimFileExtension().appendFileExtension("report"); + final Resource resource = resourceSet.createResource(reportURI); + final RecordingCommand command = new RecordingCommand(editingDomain) { + @Override + public void doExecute() { + resource.getContents().add(report); + } + }; + EMFCommandTransaction transaction = new EMFCommandTransaction(command, + (InternalTransactionalEditingDomain) editingDomain, null); + try { + transaction.start(); + command.execute(); + transaction.commit(); + } catch (InterruptedException | RollbackException e) { + e.printStackTrace(); + } + try { + resource.save((new PlatformResourceURIHandlerImpl()).createOutputStream(reportURI, Collections.emptyMap()), + Collections.emptyMap()); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private class ScenarioGuardListener implements IPropertyListener { + + private final ScenarioElement element; + private final Property property; + + public ScenarioGuardListener(ScenarioElement element, Property property) { + this.element = element; + this.property = property; + } + + @Override + public void update(boolean propertyValue) { + if (element instanceof ScenarioFSM) { + // FSM elements + handleFSM((ScenarioFSM) element); + } else { + final EventOccurrence eventOccurrence = (EventOccurrence) element; + final EventInstance eventInstance = createEvent(eventOccurrence.getEvent()); + if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { + eventManager.sendEvent(eventInstance); + } + } + currentElements.remove(element); + currentElements.addAll(element.getNextElements()); + propertyMonitor.removeListener(property, this); + element.getNextElements().stream().filter(e -> e instanceof EventOccurrence).forEach(e -> { + final Property property = e.getGuard(); + propertyMonitor.addListener(property, new ScenarioGuardListener(e, property)); + }); + } + } + + private class FSMGuardListener implements IPropertyListener { + + private final ScenarioFSM fsm; + private final ScenarioFSMState state; + private final Property property; + private Map fsmGuards = new HashMap<>(); + + public FSMGuardListener(ScenarioFSM fsm, ScenarioFSMState state, Property property, + Map fsmGuards) { + this.fsm = fsm; + this.state = state; + this.property = property; + this.fsmGuards = fsmGuards; + } + + @Override + public void update(boolean propertyValue) { + // We send the event associated to the newly reached state of the FSM, if any. + final EventInstance eventInstance = createEvent(state.getEvent()); + if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { + eventManager.sendEvent(eventInstance); + } + // We stop monitoring the current guard as well as the guards of the + // other outgoing transitions of the previous state of the FSM. + propertyMonitor.removeListener(property, this); + fsmGuards.forEach((p, l) -> propertyMonitor.removeListener(p, l)); + fsmGuards.clear(); + if (fsm.getAcceptingStates().contains(state)) { + // The FSM has reached an accepting state, thus we start monitoring + // the guards of the next elements in the scenario tree. + currentElements.remove(fsm); + currentElements.addAll(fsm.getNextElements()); + propertyMonitor.removeListener(property, this); + fsm.getNextElements().stream().filter(e -> e instanceof EventOccurrence).forEach(e -> { + final Property property = e.getGuard(); + propertyMonitor.addListener(property, new ScenarioGuardListener(e, property)); + }); + } else { + // Otherwise we start monitoring the guards of the outgoing transitions. + final Map fsmGuards = new HashMap<>(); + state.getOutgoingTransitions().forEach(t -> { + final Property property = t.getGuard(); + if (property != null) { + IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), property, fsmGuards); + fsmGuards.put(property, listener); + } + }); + fsmGuards.forEach((p, l) -> { + propertyMonitor.addListener(p, l); + }); + } + } } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventParameterItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java similarity index 88% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventParameterItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java index 4915153f6..b8e1d88ee 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventParameterItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java @@ -1,6 +1,6 @@ /** */ -package fr.inria.diverse.event.commons.model.report.provider; +package fr.inria.diverse.event.commons.model.property.provider; import java.util.Collection; @@ -20,12 +20,12 @@ import org.eclipse.emf.edit.provider.ItemProviderAdapter; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.EventParameter} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.Property} object. * * * @generated */ -public class EventParameterItemProvider +public class PropertyItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, @@ -39,7 +39,7 @@ public class EventParameterItemProvider * * @generated */ - public EventParameterItemProvider(AdapterFactory adapterFactory) { + public PropertyItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -59,14 +59,14 @@ public List getPropertyDescriptors(Object object) { } /** - * This returns EventParameter.gif. + * This returns Property.gif. * * * @generated */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/EventParameter")); + return overlayImage(object, getResourceLocator().getImage("full/obj16/Property")); } /** @@ -77,7 +77,7 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - return getString("_UI_EventParameter_type"); + return getString("_UI_Property_type"); } @@ -114,7 +114,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors */ @Override public ResourceLocator getResourceLocator() { - return ReportEditPlugin.INSTANCE; + return PropertyEditPlugin.INSTANCE; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java index 4d5b2a079..3f234703d 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java @@ -163,29 +163,6 @@ public Adapter createManyStringAttributePropertyAdapter() { return manyStringAttributePropertyItemProvider; } - /** - * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.StepProperty} instances. - * - * - * @generated - */ - protected StepPropertyItemProvider stepPropertyItemProvider; - - /** - * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.StepProperty}. - * - * - * @generated - */ - @Override - public Adapter createStepPropertyAdapter() { - if (stepPropertyItemProvider == null) { - stepPropertyItemProvider = new StepPropertyItemProvider(this); - } - - return stepPropertyItemProvider; - } - /** * This returns the root adapter factory that contains this factory. * @@ -289,7 +266,6 @@ public void dispose() { if (manyBooleanAttributePropertyItemProvider != null) manyBooleanAttributePropertyItemProvider.dispose(); if (manyIntegerAttributePropertyItemProvider != null) manyIntegerAttributePropertyItemProvider.dispose(); if (manyStringAttributePropertyItemProvider != null) manyStringAttributePropertyItemProvider.dispose(); - if (stepPropertyItemProvider != null) stepPropertyItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StatePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StatePropertyItemProvider.java index 08c5dd8a9..b9c5b872b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StatePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StatePropertyItemProvider.java @@ -11,16 +11,8 @@ 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.ItemProviderAdapter; /** * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.StateProperty} object. @@ -28,14 +20,7 @@ * * @generated */ -public class StatePropertyItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { +public class StatePropertyItemProvider extends PropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * @@ -121,15 +106,4 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors super.collectNewChildDescriptors(newChildDescriptors, object); } - /** - * Return the resource locator for this item provider's resources. - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return PropertyEditPlugin.INSTANCE; - } - } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java index 63a1e1785..b7fd70cce 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java @@ -3,21 +3,19 @@ package fr.inria.diverse.event.commons.model.property.provider; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.StepProperty; +import fr.inria.diverse.event.commons.model.property.Stepping; 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.ComposeableAdapterFactory; 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; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; /** * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.StepProperty} object. @@ -25,14 +23,7 @@ * * @generated */ -public class StepPropertyItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { +public class StepPropertyItemProvider extends PropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * @@ -54,19 +45,31 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + addSteppingPropertyDescriptor(object); } return itemPropertyDescriptors; } /** - * This returns StepProperty.gif. + * This adds a property descriptor for the Stepping feature. * * * @generated */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/StepProperty")); + protected void addSteppingPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_StepProperty_stepping_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_StepProperty_stepping_feature", "_UI_StepProperty_type"), + PropertyPackage.Literals.STEP_PROPERTY__STEPPING, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); } /** @@ -77,7 +80,11 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - return getString("_UI_StepProperty_type"); + Stepping labelValue = ((StepProperty)object).getStepping(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_StepProperty_type") : + getString("_UI_StepProperty_type") + " " + label; } @@ -91,6 +98,12 @@ public String getText(Object object) { @Override public void notifyChanged(Notification notification) { updateChildren(notification); + + switch (notification.getFeatureID(StepProperty.class)) { + case PropertyPackage.STEP_PROPERTY__STEPPING: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } super.notifyChanged(notification); } @@ -106,15 +119,4 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors super.collectNewChildDescriptors(newChildDescriptors, object); } - /** - * Return the resource locator for this item provider's resources. - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return PropertyEditPlugin.INSTANCE; - } - } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java index add6bf369..1c0236fcc 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java @@ -3,6 +3,7 @@ package fr.inria.diverse.event.commons.model.report.provider; +import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.ReportPackage; import java.util.Collection; @@ -20,7 +21,9 @@ 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; /** * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.EventReport} object. @@ -60,6 +63,7 @@ public List getPropertyDescriptors(Object object) { addEventPropertyDescriptor(object); addMatchesPropertyDescriptor(object); addTargetPropertyDescriptor(object); + addTimePropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -130,6 +134,28 @@ protected void addTargetPropertyDescriptor(Object object) { null)); } + /** + * This adds a property descriptor for the Time feature. + * + * + * @generated + */ + protected void addTimePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_EventReport_time_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventReport_time_feature", "_UI_EventReport_type"), + ReportPackage.Literals.EVENT_REPORT__TIME, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + /** * This returns EventReport.gif. * @@ -149,7 +175,8 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - return getString("_UI_EventReport_type"); + EventReport eventReport = (EventReport)object; + return getString("_UI_EventReport_type") + " " + eventReport.getTime(); } @@ -163,6 +190,12 @@ public String getText(Object object) { @Override public void notifyChanged(Notification notification) { updateChildren(notification); + + switch (notification.getFeatureID(EventReport.class)) { + case ReportPackage.EVENT_REPORT__TIME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } super.notifyChanged(notification); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java index 497b825d5..873884bc5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java @@ -77,7 +77,7 @@ public List getPropertyDescriptors(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ReportPackage.Literals.REPORT__STAGES); + childrenFeatures.add(ReportPackage.Literals.REPORT__EVENTS); } return childrenFeatures; } @@ -130,7 +130,7 @@ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Report.class)) { - case ReportPackage.REPORT__STAGES: + case ReportPackage.REPORT__EVENTS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -150,8 +150,8 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors newChildDescriptors.add (createChildParameter - (ReportPackage.Literals.REPORT__STAGES, - ReportFactory.eINSTANCE.createStageReport())); + (ReportPackage.Literals.REPORT__EVENTS, + ReportFactory.eINSTANCE.createEventReport())); } /** diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java index 64b4c7108..9e8b1855f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java @@ -94,29 +94,6 @@ public Adapter createReportAdapter() { return reportItemProvider; } - /** - * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.StageReport} instances. - * - * - * @generated - */ - protected StageReportItemProvider stageReportItemProvider; - - /** - * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.StageReport}. - * - * - * @generated - */ - @Override - public Adapter createStageReportAdapter() { - if (stageReportItemProvider == null) { - stageReportItemProvider = new StageReportItemProvider(this); - } - - return stageReportItemProvider; - } - /** * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.EventReport} instances. * @@ -140,29 +117,6 @@ public Adapter createEventReportAdapter() { return eventReportItemProvider; } - /** - * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.EventParameter} instances. - * - * - * @generated - */ - protected EventParameterItemProvider eventParameterItemProvider; - - /** - * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.EventParameter}. - * - * - * @generated - */ - @Override - public Adapter createEventParameterAdapter() { - if (eventParameterItemProvider == null) { - eventParameterItemProvider = new EventParameterItemProvider(this); - } - - return eventParameterItemProvider; - } - /** * This returns the root adapter factory that contains this factory. * @@ -263,9 +217,7 @@ public void fireNotifyChanged(Notification notification) { */ public void dispose() { if (reportItemProvider != null) reportItemProvider.dispose(); - if (stageReportItemProvider != null) stageReportItemProvider.dispose(); if (eventReportItemProvider != null) eventReportItemProvider.dispose(); - if (eventParameterItemProvider != null) eventParameterItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/DateItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/DateItemProvider.java deleted file mode 100644 index 9a48d803a..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/DateItemProvider.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.scenario.provider; - - -import fr.inria.diverse.event.commons.model.scenario.Date; -import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; - -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.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Date} object. - * - * - * @generated - */ -public class DateItemProvider extends PhaseItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public DateItemProvider(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); - - addTimePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Time feature. - * - * - * @generated - */ - protected void addTimePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Date_time_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Date_time_feature", "_UI_Date_type"), - ScenarioPackage.Literals.DATE__TIME, - true, - false, - false, - ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - Date date = (Date)object; - return getString("_UI_Date_type") + " " + date.getTime(); - } - - - /** - * 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(Date.class)) { - case ScenarioPackage.DATE__TIME: - 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/TestSuiteItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventOccurrenceItemProvider.java similarity index 67% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/TestSuiteItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventOccurrenceItemProvider.java index dc143b041..4f282323e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/TestSuiteItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/EventOccurrenceItemProvider.java @@ -3,8 +3,8 @@ package fr.inria.diverse.event.commons.model.scenario.provider; +import fr.inria.diverse.event.commons.model.scenario.EventOccurrence; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; -import fr.inria.diverse.event.commons.model.scenario.TestSuite; import java.util.Collection; import java.util.List; @@ -12,40 +12,27 @@ 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.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; 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; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.TestSuite} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.EventOccurrence} object. * * * @generated */ -public class TestSuiteItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { +public class EventOccurrenceItemProvider extends ScenarioElementItemProvider { /** * This constructs an instance from a factory and a notifier. * * * @generated */ - public TestSuiteItemProvider(AdapterFactory adapterFactory) { + public EventOccurrenceItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -60,10 +47,33 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + addTimePropertyDescriptor(object); } return itemPropertyDescriptors; } + /** + * This adds a property descriptor for the Time feature. + * + * + * @generated + */ + protected void addTimePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_EventOccurrence_time_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventOccurrence_time_feature", "_UI_EventOccurrence_type"), + ScenarioPackage.Literals.EVENT_OCCURRENCE__TIME, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_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 @@ -76,7 +86,7 @@ public List getPropertyDescriptors(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ScenarioPackage.Literals.TEST_SUITE__TESTS); + childrenFeatures.add(ScenarioPackage.Literals.EVENT_OCCURRENCE__EVENT); } return childrenFeatures; } @@ -102,7 +112,8 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { */ @Override public String getText(Object object) { - return getString("_UI_TestSuite_type"); + EventOccurrence eventOccurrence = (EventOccurrence)object; + return getString("_UI_EventOccurrence_type") + " " + eventOccurrence.getTime(); } @@ -117,8 +128,11 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(TestSuite.class)) { - case ScenarioPackage.TEST_SUITE__TESTS: + switch (notification.getFeatureID(EventOccurrence.class)) { + case ScenarioPackage.EVENT_OCCURRENCE__TIME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case ScenarioPackage.EVENT_OCCURRENCE__EVENT: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -137,15 +151,4 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors super.collectNewChildDescriptors(newChildDescriptors, object); } - /** - * Return the resource locator for this item provider's resources. - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return ScenarioEditPlugin.INSTANCE; - } - } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/PhaseItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java similarity index 66% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/PhaseItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java index 52318b3f8..860d28d58 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/PhaseItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java @@ -3,7 +3,9 @@ package fr.inria.diverse.event.commons.model.scenario.provider; -import fr.inria.diverse.event.commons.model.scenario.Phase; +import fr.inria.diverse.event.commons.model.property.PropertyFactory; + +import fr.inria.diverse.event.commons.model.scenario.ScenarioElement; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import java.util.Collection; @@ -16,6 +18,7 @@ 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; @@ -26,12 +29,12 @@ import org.eclipse.emf.edit.provider.ViewerNotification; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Phase} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement} object. * * * @generated */ -public class PhaseItemProvider +public class ScenarioElementItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, @@ -45,7 +48,7 @@ public class PhaseItemProvider * * @generated */ - public PhaseItemProvider(AdapterFactory adapterFactory) { + public ScenarioElementItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -60,10 +63,33 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + addNextElementsPropertyDescriptor(object); } return itemPropertyDescriptors; } + /** + * This adds a property descriptor for the Next Elements feature. + * + * + * @generated + */ + protected void addNextElementsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioElement_nextElements_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioElement_nextElements_feature", "_UI_ScenarioElement_type"), + ScenarioPackage.Literals.SCENARIO_ELEMENT__NEXT_ELEMENTS, + true, + false, + true, + null, + 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 @@ -76,7 +102,7 @@ public List getPropertyDescriptors(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ScenarioPackage.Literals.PHASE__EVENT); + childrenFeatures.add(ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD); } return childrenFeatures; } @@ -102,7 +128,7 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { */ @Override public String getText(Object object) { - return getString("_UI_Phase_type"); + return getString("_UI_ScenarioElement_type"); } @@ -117,8 +143,8 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(Phase.class)) { - case ScenarioPackage.PHASE__EVENT: + switch (notification.getFeatureID(ScenarioElement.class)) { + case ScenarioPackage.SCENARIO_ELEMENT__GUARD: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -135,6 +161,26 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); } /** diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMItemProvider.java similarity index 59% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMItemProvider.java index cb1686703..5a84db060 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/StageItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMItemProvider.java @@ -3,10 +3,8 @@ package fr.inria.diverse.event.commons.model.scenario.provider; -import fr.inria.diverse.event.commons.model.property.PropertyFactory; - +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSM; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; -import fr.inria.diverse.event.commons.model.scenario.Stage; import java.util.Collection; import java.util.List; @@ -16,23 +14,24 @@ import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Stage} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM} object. * * * @generated */ -public class StageItemProvider extends PhaseItemProvider { +public class ScenarioFSMItemProvider extends ScenarioElementItemProvider { /** * This constructs an instance from a factory and a notifier. * * * @generated */ - public StageItemProvider(AdapterFactory adapterFactory) { + public ScenarioFSMItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -47,10 +46,56 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + addInitialStatePropertyDescriptor(object); + addAcceptingStatesPropertyDescriptor(object); } return itemPropertyDescriptors; } + /** + * This adds a property descriptor for the Initial State feature. + * + * + * @generated + */ + protected void addInitialStatePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioFSM_initialState_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioFSM_initialState_feature", "_UI_ScenarioFSM_type"), + ScenarioPackage.Literals.SCENARIO_FSM__INITIAL_STATE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Accepting States feature. + * + * + * @generated + */ + protected void addAcceptingStatesPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioFSM_acceptingStates_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioFSM_acceptingStates_feature", "_UI_ScenarioFSM_type"), + ScenarioPackage.Literals.SCENARIO_FSM__ACCEPTING_STATES, + true, + false, + true, + null, + 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 @@ -63,7 +108,8 @@ public List getPropertyDescriptors(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ScenarioPackage.Literals.STAGE__PROPERTY); + childrenFeatures.add(ScenarioPackage.Literals.SCENARIO_FSM__STATES); + childrenFeatures.add(ScenarioPackage.Literals.SCENARIO_FSM__TRANSITIONS); } return childrenFeatures; } @@ -89,7 +135,7 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { */ @Override public String getText(Object object) { - return getString("_UI_Stage_type"); + return getString("_UI_ScenarioFSM_type"); } @@ -104,8 +150,9 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(Stage.class)) { - case ScenarioPackage.STAGE__PROPERTY: + switch (notification.getFeatureID(ScenarioFSM.class)) { + case ScenarioPackage.SCENARIO_FSM__STATES: + case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -122,26 +169,6 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (ScenarioPackage.Literals.STAGE__PROPERTY, - PropertyFactory.eINSTANCE.createContainerReferenceProperty())); - - newChildDescriptors.add - (createChildParameter - (ScenarioPackage.Literals.STAGE__PROPERTY, - PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); - - newChildDescriptors.add - (createChildParameter - (ScenarioPackage.Literals.STAGE__PROPERTY, - PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); - - newChildDescriptors.add - (createChildParameter - (ScenarioPackage.Literals.STAGE__PROPERTY, - PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMStateItemProvider.java similarity index 71% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMStateItemProvider.java index 870729015..868bc10ea 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/StageReportItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMStateItemProvider.java @@ -1,11 +1,10 @@ /** */ -package fr.inria.diverse.event.commons.model.report.provider; +package fr.inria.diverse.event.commons.model.scenario.provider; -import fr.inria.diverse.event.commons.model.report.ReportFactory; -import fr.inria.diverse.event.commons.model.report.ReportPackage; -import fr.inria.diverse.event.commons.model.report.StageReport; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import java.util.Collection; import java.util.List; @@ -28,12 +27,12 @@ import org.eclipse.emf.edit.provider.ViewerNotification; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.StageReport} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState} object. * * * @generated */ -public class StageReportItemProvider +public class ScenarioFSMStateItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, @@ -47,7 +46,7 @@ public class StageReportItemProvider * * @generated */ - public StageReportItemProvider(AdapterFactory adapterFactory) { + public ScenarioFSMStateItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -62,26 +61,26 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - addStagePropertyDescriptor(object); - addMatchesPropertyDescriptor(object); + addOutgoingTransitionsPropertyDescriptor(object); + addIncomingTransitionsPropertyDescriptor(object); } return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Stage feature. + * This adds a property descriptor for the Outgoing Transitions feature. * * * @generated */ - protected void addStagePropertyDescriptor(Object object) { + protected void addOutgoingTransitionsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_StageReport_stage_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_StageReport_stage_feature", "_UI_StageReport_type"), - ReportPackage.Literals.STAGE_REPORT__STAGE, + getString("_UI_ScenarioFSMState_outgoingTransitions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioFSMState_outgoingTransitions_feature", "_UI_ScenarioFSMState_type"), + ScenarioPackage.Literals.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS, true, false, true, @@ -91,19 +90,19 @@ protected void addStagePropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Matches feature. + * This adds a property descriptor for the Incoming Transitions feature. * * * @generated */ - protected void addMatchesPropertyDescriptor(Object object) { + protected void addIncomingTransitionsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_StageReport_matches_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_StageReport_matches_feature", "_UI_StageReport_type"), - ReportPackage.Literals.STAGE_REPORT__MATCHES, + getString("_UI_ScenarioFSMState_incomingTransitions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioFSMState_incomingTransitions_feature", "_UI_ScenarioFSMState_type"), + ScenarioPackage.Literals.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS, true, false, true, @@ -124,7 +123,7 @@ protected void addMatchesPropertyDescriptor(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ReportPackage.Literals.STAGE_REPORT__EVENTS); + childrenFeatures.add(ScenarioPackage.Literals.SCENARIO_FSM_STATE__EVENT); } return childrenFeatures; } @@ -142,17 +141,6 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { return super.getChildFeature(object, child); } - /** - * This returns StageReport.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/StageReport")); - } - /** * This returns the label text for the adapted class. * @@ -161,7 +149,7 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - return getString("_UI_StageReport_type"); + return getString("_UI_ScenarioFSMState_type"); } @@ -176,8 +164,8 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(StageReport.class)) { - case ReportPackage.STAGE_REPORT__EVENTS: + switch (notification.getFeatureID(ScenarioFSMState.class)) { + case ScenarioPackage.SCENARIO_FSM_STATE__EVENT: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -194,11 +182,6 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (ReportPackage.Literals.STAGE_REPORT__EVENTS, - ReportFactory.eINSTANCE.createEventReport())); } /** @@ -209,7 +192,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors */ @Override public ResourceLocator getResourceLocator() { - return ReportEditPlugin.INSTANCE; + return ScenarioEditPlugin.INSTANCE; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java new file mode 100644 index 000000000..bfa933f4c --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java @@ -0,0 +1,220 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyFactory; + +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition} object. + * + * + * @generated + */ +public class ScenarioFSMTransitionItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ScenarioFSMTransitionItemProvider(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); + + addSourcePropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Source feature. + * + * + * @generated + */ + protected void addSourcePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioFSMTransition_source_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioFSMTransition_source_feature", "_UI_ScenarioFSMTransition_type"), + ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__SOURCE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioFSMTransition_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioFSMTransition_target_feature", "_UI_ScenarioFSMTransition_type"), + ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__TARGET, + true, + false, + true, + null, + 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(ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD); + } + 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) { + return getString("_UI_ScenarioFSMTransition_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); + + switch (notification.getFeatureID(ScenarioFSMTransition.class)) { + case ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD: + 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 + (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ScenarioEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java index 90712f9c6..e61a86956 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProvider.java @@ -76,7 +76,7 @@ public List getPropertyDescriptors(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ScenarioPackage.Literals.SCENARIO__PHASES); + childrenFeatures.add(ScenarioPackage.Literals.SCENARIO__ELEMENTS); } return childrenFeatures; } @@ -129,7 +129,7 @@ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Scenario.class)) { - case ScenarioPackage.SCENARIO__PHASES: + case ScenarioPackage.SCENARIO__ELEMENTS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java index 7f2012397..941bf3af3 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java @@ -395,8 +395,7 @@ public PropertyModelWizardInitialObjectCreationPage(String pageId) { * @generated */ public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - { + Composite composite = new Composite(parent, SWT.NONE); { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java index 4a69b4073..9b0f7d2b9 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java @@ -8,22 +8,22 @@ import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; public interface IEventManager extends IEngineAddon { - + void sendEvent(Object event); - + void receiveEvent(Object result, Object caller, String className, String methodName); - + void manageEvents(); - + void waitForEvents(); - + Set getEventClasses(); - + boolean canSendEvent(Object event); - + void loadScenario(URI uri, ResourceSet resourceSet); - + void addListener(IEventManagerListener listener); - + void removeListener(IEventManagerListener listener); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Property.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Property.java new file mode 100644 index 000000000..318429ff4 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Property.java @@ -0,0 +1,18 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Property'. + * + * + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getProperty() + * @model abstract="true" + * @generated + */ +public interface Property extends EObject { +} // Property diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java index 17ce2874a..82a467c1b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java @@ -57,15 +57,6 @@ public interface PropertyFactory extends EFactory { */ ManyStringAttributeProperty createManyStringAttributeProperty(); - /** - * Returns a new object of class 'Step Property'. - * - * - * @return a new object of class 'Step Property'. - * @generated - */ - StepProperty createStepProperty(); - /** * Returns the package supported by this factory. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java index b1f8baf65..2cb494925 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java @@ -58,6 +58,34 @@ public interface PropertyPackage extends EPackage { */ PropertyPackage eINSTANCE = fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl.init(); + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.PropertyImpl Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getProperty() + * @generated + */ + int PROPERTY = 0; + + /** + * The number of structural features of the 'Property' class. + * + * + * @generated + * @ordered + */ + int PROPERTY_FEATURE_COUNT = 0; + + /** + * The number of operations of the 'Property' class. + * + * + * @generated + * @ordered + */ + int PROPERTY_OPERATION_COUNT = 0; + /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl State Property}' class. * @@ -66,7 +94,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStateProperty() * @generated */ - int STATE_PROPERTY = 0; + int STATE_PROPERTY = 1; /** * The feature id for the 'Target' reference. @@ -75,7 +103,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int STATE_PROPERTY__TARGET = 0; + int STATE_PROPERTY__TARGET = PROPERTY_FEATURE_COUNT + 0; /** * The number of structural features of the 'State Property' class. @@ -84,7 +112,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int STATE_PROPERTY_FEATURE_COUNT = 1; + int STATE_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; /** * The operation id for the 'Get Feature' operation. @@ -93,7 +121,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int STATE_PROPERTY___GET_FEATURE = 0; + int STATE_PROPERTY___GET_FEATURE = PROPERTY_OPERATION_COUNT + 0; /** * The number of operations of the 'State Property' class. @@ -102,7 +130,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int STATE_PROPERTY_OPERATION_COUNT = 1; + int STATE_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 1; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl Binary Property}' class. @@ -112,7 +140,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBinaryProperty() * @generated */ - int BINARY_PROPERTY = 1; + int BINARY_PROPERTY = 2; /** * The feature id for the 'Target' reference. @@ -185,7 +213,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyReferenceProperty() * @generated */ - int MANY_REFERENCE_PROPERTY = 2; + int MANY_REFERENCE_PROPERTY = 3; /** * The feature id for the 'Target' reference. @@ -249,7 +277,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getSingleReferenceProperty() * @generated */ - int SINGLE_REFERENCE_PROPERTY = 3; + int SINGLE_REFERENCE_PROPERTY = 4; /** * The feature id for the 'Target' reference. @@ -304,7 +332,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getContainerReferenceProperty() * @generated */ - int CONTAINER_REFERENCE_PROPERTY = 4; + int CONTAINER_REFERENCE_PROPERTY = 5; /** * The feature id for the 'Target' reference. @@ -359,7 +387,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyBooleanAttributeProperty() * @generated */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY = 5; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY = 6; /** * The feature id for the 'Target' reference. @@ -432,7 +460,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyIntegerAttributeProperty() * @generated */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY = 6; + int MANY_INTEGER_ATTRIBUTE_PROPERTY = 7; /** * The feature id for the 'Target' reference. @@ -505,7 +533,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyStringAttributeProperty() * @generated */ - int MANY_STRING_ATTRIBUTE_PROPERTY = 7; + int MANY_STRING_ATTRIBUTE_PROPERTY = 8; /** * The feature id for the 'Target' reference. @@ -578,7 +606,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanAttributeProperty() * @generated */ - int BOOLEAN_ATTRIBUTE_PROPERTY = 8; + int BOOLEAN_ATTRIBUTE_PROPERTY = 9; /** * The feature id for the 'Target' reference. @@ -642,7 +670,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getIntegerAttributeProperty() * @generated */ - int INTEGER_ATTRIBUTE_PROPERTY = 9; + int INTEGER_ATTRIBUTE_PROPERTY = 10; /** * The feature id for the 'Target' reference. @@ -706,7 +734,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStringAttributeProperty() * @generated */ - int STRING_ATTRIBUTE_PROPERTY = 10; + int STRING_ATTRIBUTE_PROPERTY = 11; /** * The feature id for the 'Target' reference. @@ -770,7 +798,16 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepProperty() * @generated */ - int STEP_PROPERTY = 11; + int STEP_PROPERTY = 12; + + /** + * The feature id for the 'Stepping' attribute. + * + * + * @generated + * @ordered + */ + int STEP_PROPERTY__STEPPING = PROPERTY_FEATURE_COUNT + 0; /** * The number of structural features of the 'Step Property' class. @@ -779,7 +816,16 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int STEP_PROPERTY_FEATURE_COUNT = 0; + int STEP_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; + + /** + * The operation id for the 'Get Operation' operation. + * + * + * @generated + * @ordered + */ + int STEP_PROPERTY___GET_OPERATION = PROPERTY_OPERATION_COUNT + 0; /** * The number of operations of the 'Step Property' class. @@ -788,7 +834,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int STEP_PROPERTY_OPERATION_COUNT = 0; + int STEP_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 1; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. @@ -798,7 +844,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getOperator() * @generated */ - int OPERATOR = 12; + int OPERATOR = 13; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}' enum. @@ -808,7 +854,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanOperator() * @generated */ - int BOOLEAN_OPERATOR = 13; + int BOOLEAN_OPERATOR = 14; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Quantifier Quantifier}' enum. @@ -818,7 +864,18 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getQuantifier() * @generated */ - int QUANTIFIER = 14; + int QUANTIFIER = 15; + + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Stepping Stepping}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.Stepping + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepping() + * @generated + */ + int STEPPING = 16; /** @@ -1204,6 +1261,37 @@ public interface PropertyPackage extends EPackage { */ EClass getStepProperty(); + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.StepProperty#getStepping Stepping}'. + * + * + * @return the meta object for the attribute 'Stepping'. + * @see fr.inria.diverse.event.commons.model.property.StepProperty#getStepping() + * @see #getStepProperty() + * @generated + */ + EAttribute getStepProperty_Stepping(); + + /** + * Returns the meta object for the '{@link fr.inria.diverse.event.commons.model.property.StepProperty#getOperation() Get Operation}' operation. + * + * + * @return the meta object for the 'Get Operation' operation. + * @see fr.inria.diverse.event.commons.model.property.StepProperty#getOperation() + * @generated + */ + EOperation getStepProperty__GetOperation(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.Property Property}'. + * + * + * @return the meta object for class 'Property'. + * @see fr.inria.diverse.event.commons.model.property.Property + * @generated + */ + EClass getProperty(); + /** * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}'. * @@ -1234,6 +1322,16 @@ public interface PropertyPackage extends EPackage { */ EEnum getQuantifier(); + /** + * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.Stepping Stepping}'. + * + * + * @return the meta object for enum 'Stepping'. + * @see fr.inria.diverse.event.commons.model.property.Stepping + * @generated + */ + EEnum getStepping(); + /** * Returns the factory that creates the instances of the model. * @@ -1569,6 +1667,32 @@ interface Literals { */ EClass STEP_PROPERTY = eINSTANCE.getStepProperty(); + /** + * The meta object literal for the 'Stepping' attribute feature. + * + * + * @generated + */ + EAttribute STEP_PROPERTY__STEPPING = eINSTANCE.getStepProperty_Stepping(); + + /** + * The meta object literal for the 'Get Operation' operation. + * + * + * @generated + */ + EOperation STEP_PROPERTY___GET_OPERATION = eINSTANCE.getStepProperty__GetOperation(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.PropertyImpl Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getProperty() + * @generated + */ + EClass PROPERTY = eINSTANCE.getProperty(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. * @@ -1599,6 +1723,16 @@ interface Literals { */ EEnum QUANTIFIER = eINSTANCE.getQuantifier(); + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.Stepping Stepping}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.Stepping + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepping() + * @generated + */ + EEnum STEPPING = eINSTANCE.getStepping(); + } } //PropertyPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StateProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StateProperty.java index 8ea157223..1fd797e06 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StateProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StateProperty.java @@ -2,7 +2,6 @@ */ package fr.inria.diverse.event.commons.model.property; -import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; /** @@ -21,7 +20,7 @@ * @model abstract="true" * @generated */ -public interface StateProperty extends EObject { +public interface StateProperty extends Property { /** * Returns the value of the 'Target' reference. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java index b2ff2a6bb..8a462fa0c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java @@ -2,17 +2,64 @@ */ package fr.inria.diverse.event.commons.model.property; -import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EOperation; /** * * A representation of the model object 'Step Property'. * * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.StepProperty#getStepping Stepping}
  • + *
* * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStepProperty() - * @model + * @model abstract="true" * @generated */ -public interface StepProperty extends EObject { +public interface StepProperty extends Property { + + /** + * + *

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

+ * + * @model kind="operation" + * @generated + */ + EOperation getOperation(); + + /** + * Returns the value of the 'Stepping' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Stepping}. + * + *

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

+ * + * @return the value of the 'Stepping' attribute. + * @see fr.inria.diverse.event.commons.model.property.Stepping + * @see #setStepping(Stepping) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStepProperty_Stepping() + * @model + * @generated + */ + Stepping getStepping(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.StepProperty#getStepping Stepping}' attribute. + * + * + * @param value the new value of the 'Stepping' attribute. + * @see fr.inria.diverse.event.commons.model.property.Stepping + * @see #getStepping() + * @generated + */ + void setStepping(Stepping value); } // StepProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Stepping.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Stepping.java new file mode 100644 index 000000000..b26be1c3e --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Stepping.java @@ -0,0 +1,239 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +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 'Stepping', + * and utility methods for working with them. + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStepping() + * @model + * @generated + */ +public enum Stepping implements Enumerator { + /** + * The 'ONGOING' literal object. + * + * + * @see #ONGOING_VALUE + * @generated + * @ordered + */ + ONGOING(0, "ONGOING", "ONGOING"), + + /** + * The 'ENDED' literal object. + * + * + * @see #ENDED_VALUE + * @generated + * @ordered + */ + ENDED(1, "ENDED", "ENDED"), /** + * The 'ENDING' literal object. + * + * + * @see #ENDING_VALUE + * @generated + * @ordered + */ + ENDING(2, "ENDING", "ENDING"); + + /** + * The 'ONGOING' literal value. + * + *

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

+ * + * @see #ONGOING + * @model + * @generated + * @ordered + */ + public static final int ONGOING_VALUE = 0; + + /** + * The 'ENDED' literal value. + * + *

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

+ * + * @see #ENDED + * @model + * @generated + * @ordered + */ + public static final int ENDED_VALUE = 1; + + /** + * The 'ENDING' literal value. + * + *

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

+ * + * @see #ENDING + * @model + * @generated + * @ordered + */ + public static final int ENDING_VALUE = 2; + + /** + * An array of all the 'Stepping' enumerators. + * + * + * @generated + */ + private static final Stepping[] VALUES_ARRAY = + new Stepping[] { + ONGOING, + ENDED, + ENDING, + }; + + /** + * A public read-only list of all the 'Stepping' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Stepping' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static Stepping get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + Stepping result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Stepping' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static Stepping getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + Stepping result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Stepping' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static Stepping get(int value) { + switch (value) { + case ONGOING_VALUE: return ONGOING; + case ENDED_VALUE: return ENDED; + case ENDING_VALUE: return ENDING; + } + 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 Stepping(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //Stepping diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java index c62daadc1..bf69d4180 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java @@ -61,7 +61,6 @@ public EObject create(EClass eClass) { case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY: return createManyBooleanAttributeProperty(); case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY: return createManyIntegerAttributeProperty(); case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY: return createManyStringAttributeProperty(); - case PropertyPackage.STEP_PROPERTY: return createStepProperty(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -81,6 +80,8 @@ public Object createFromString(EDataType eDataType, String initialValue) { return createBooleanOperatorFromString(eDataType, initialValue); case PropertyPackage.QUANTIFIER: return createQuantifierFromString(eDataType, initialValue); + case PropertyPackage.STEPPING: + return createSteppingFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } @@ -100,6 +101,8 @@ public String convertToString(EDataType eDataType, Object instanceValue) { return convertBooleanOperatorToString(eDataType, instanceValue); case PropertyPackage.QUANTIFIER: return convertQuantifierToString(eDataType, instanceValue); + case PropertyPackage.STEPPING: + return convertSteppingToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } @@ -145,16 +148,6 @@ public ManyStringAttributeProperty createManyStringAttributeProperty() { return manyStringAttributeProperty; } - /** - * - * - * @generated - */ - public StepProperty createStepProperty() { - StepPropertyImpl stepProperty = new StepPropertyImpl(); - return stepProperty; - } - /** * * @@ -215,6 +208,26 @@ public String convertQuantifierToString(EDataType eDataType, Object instanceValu return instanceValue == null ? null : instanceValue.toString(); } + /** + * + * + * @generated + */ + public Stepping createSteppingFromString(EDataType eDataType, String initialValue) { + Stepping result = Stepping.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertSteppingToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + /** * * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyImpl.java new file mode 100644 index 000000000..9b9d903a0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyImpl.java @@ -0,0 +1,39 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.Property; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Property'. + * + * + * @generated + */ +public abstract class PropertyImpl extends MinimalEObjectImpl.Container implements Property { + /** + * + * + * @generated + */ + protected PropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.PROPERTY; + } + +} //PropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java index f04128c3d..e8d6f5a1b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java @@ -12,12 +12,14 @@ import fr.inria.diverse.event.commons.model.property.ManyReferenceProperty; import fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty; import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.property.PropertyFactory; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.Quantifier; import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty; import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.property.StepProperty; +import fr.inria.diverse.event.commons.model.property.Stepping; import fr.inria.diverse.event.commons.model.property.StringAttributeProperty; import org.eclipse.emf.ecore.EAttribute; @@ -123,6 +125,13 @@ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage */ private EClass stepPropertyEClass = null; + /** + * + * + * @generated + */ + private EClass propertyEClass = null; + /** * * @@ -144,6 +153,13 @@ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage */ private EEnum quantifierEEnum = null; + /** + * + * + * @generated + */ + private EEnum steppingEEnum = null; + /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package @@ -532,6 +548,33 @@ public EClass getStepProperty() { return stepPropertyEClass; } + /** + * + * + * @generated + */ + public EAttribute getStepProperty_Stepping() { + return (EAttribute)stepPropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EOperation getStepProperty__GetOperation() { + return stepPropertyEClass.getEOperations().get(0); + } + + /** + * + * + * @generated + */ + public EClass getProperty() { + return propertyEClass; + } + /** * * @@ -559,6 +602,15 @@ public EEnum getQuantifier() { return quantifierEEnum; } + /** + * + * + * @generated + */ + public EEnum getStepping() { + return steppingEEnum; + } + /** * * @@ -587,6 +639,8 @@ public void createPackageContents() { isCreated = true; // Create classes and their features + propertyEClass = createEClass(PROPERTY); + statePropertyEClass = createEClass(STATE_PROPERTY); createEReference(statePropertyEClass, STATE_PROPERTY__TARGET); createEOperation(statePropertyEClass, STATE_PROPERTY___GET_FEATURE); @@ -634,11 +688,14 @@ public void createPackageContents() { createEAttribute(stringAttributePropertyEClass, STRING_ATTRIBUTE_PROPERTY__OPERATOR); stepPropertyEClass = createEClass(STEP_PROPERTY); + createEAttribute(stepPropertyEClass, STEP_PROPERTY__STEPPING); + createEOperation(stepPropertyEClass, STEP_PROPERTY___GET_OPERATION); // Create enums operatorEEnum = createEEnum(OPERATOR); booleanOperatorEEnum = createEEnum(BOOLEAN_OPERATOR); quantifierEEnum = createEEnum(QUANTIFIER); + steppingEEnum = createEEnum(STEPPING); } /** @@ -703,6 +760,7 @@ public void initializePackageContents() { containerReferencePropertyEClass_P.getEBounds().add(g1); // Add supertypes to classes + statePropertyEClass.getESuperTypes().add(this.getProperty()); g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(binaryPropertyEClass_T); g1.getETypeArguments().add(g2); @@ -743,8 +801,11 @@ public void initializePackageContents() { g2 = createEGenericType(stringAttributePropertyEClass_T); g1.getETypeArguments().add(g2); stringAttributePropertyEClass.getEGenericSuperTypes().add(g1); + stepPropertyEClass.getESuperTypes().add(this.getProperty()); // Initialize classes, features, and operations; add parameters + initEClass(propertyEClass, Property.class, "Property", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(statePropertyEClass, StateProperty.class, "StateProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(statePropertyEClass_T); initEReference(getStateProperty_Target(), g1, null, "target", null, 0, 1, StateProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -798,7 +859,10 @@ public void initializePackageContents() { initEAttribute(getStringAttributeProperty_Value(), theEcorePackage.getEString(), "value", null, 0, 1, StringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getStringAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, StringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(stepPropertyEClass, StepProperty.class, "StepProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(stepPropertyEClass, StepProperty.class, "StepProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getStepProperty_Stepping(), this.getStepping(), "stepping", null, 0, 1, StepProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEOperation(getStepProperty__GetOperation(), theEcorePackage.getEOperation(), "getOperation", 0, 1, IS_UNIQUE, IS_ORDERED); // Initialize enums and add enum literals initEEnum(operatorEEnum, Operator.class, "Operator"); @@ -813,6 +877,11 @@ public void initializePackageContents() { addEEnumLiteral(quantifierEEnum, Quantifier.EXISTS); addEEnumLiteral(quantifierEEnum, Quantifier.FORALL); + initEEnum(steppingEEnum, Stepping.class, "Stepping"); + addEEnumLiteral(steppingEEnum, Stepping.ONGOING); + addEEnumLiteral(steppingEEnum, Stepping.ENDED); + addEEnumLiteral(steppingEEnum, Stepping.ENDING); + // Create resource createResource(eNS_URI); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StatePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StatePropertyImpl.java index b3140e92f..3e60f5262 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StatePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StatePropertyImpl.java @@ -17,7 +17,6 @@ import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; /** * @@ -32,7 +31,7 @@ * * @generated */ -public abstract class StatePropertyImpl extends MinimalEObjectImpl.Container implements StateProperty { +public abstract class StatePropertyImpl extends PropertyImpl implements StateProperty { /** * The cached value of the '{@link #getTarget() Target}' reference. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java index 143a1695b..b54339f5a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java @@ -5,18 +5,47 @@ import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.StepProperty; +import fr.inria.diverse.event.commons.model.property.Stepping; +import java.lang.reflect.InvocationTargetException; +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.MinimalEObjectImpl; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * * An implementation of the model object 'Step Property'. * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl#getStepping Stepping}
  • + *
* * @generated */ -public class StepPropertyImpl extends MinimalEObjectImpl.Container implements StepProperty { +public abstract class StepPropertyImpl extends PropertyImpl implements StepProperty { + /** + * The default value of the '{@link #getStepping() Stepping}' attribute. + * + * + * @see #getStepping() + * @generated + * @ordered + */ + protected static final Stepping STEPPING_EDEFAULT = Stepping.ONGOING; + /** + * The cached value of the '{@link #getStepping() Stepping}' attribute. + * + * + * @see #getStepping() + * @generated + * @ordered + */ + protected Stepping stepping = STEPPING_EDEFAULT; + /** * * @@ -36,4 +65,124 @@ protected EClass eStaticClass() { return PropertyPackage.Literals.STEP_PROPERTY; } + /** + * + * + * @generated + */ + public EOperation getOperation() { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + public Stepping getStepping() { + return stepping; + } + + /** + * + * + * @generated + */ + public void setStepping(Stepping newStepping) { + Stepping oldStepping = stepping; + stepping = newStepping == null ? STEPPING_EDEFAULT : newStepping; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.STEP_PROPERTY__STEPPING, oldStepping, stepping)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.STEP_PROPERTY__STEPPING: + return getStepping(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.STEP_PROPERTY__STEPPING: + setStepping((Stepping)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.STEP_PROPERTY__STEPPING: + setStepping(STEPPING_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.STEP_PROPERTY__STEPPING: + return stepping != STEPPING_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { + switch (operationID) { + case PropertyPackage.STEP_PROPERTY___GET_OPERATION: + return getOperation(); + } + return super.eInvoke(operationID, arguments); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (stepping: "); + result.append(stepping); + result.append(')'); + return result.toString(); + } + } //StepPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java index 738b7e7d4..7ec8ebe9c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java @@ -67,6 +67,10 @@ public boolean isFactoryForType(Object object) { */ protected PropertySwitch modelSwitch = new PropertySwitch() { + @Override + public Adapter caseProperty(Property object) { + return createPropertyAdapter(); + } @Override public Adapter caseStateProperty(StateProperty object) { return createStatePropertyAdapter(); @@ -303,6 +307,20 @@ public Adapter createStepPropertyAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.Property 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 fr.inria.diverse.event.commons.model.property.Property + * @generated + */ + public Adapter createPropertyAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java index d820c14fb..b89b87d43 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java @@ -66,9 +66,16 @@ protected boolean isSwitchFor(EPackage ePackage) { @Override protected T1 doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { + case PropertyPackage.PROPERTY: { + Property property = (Property)theEObject; + T1 result = caseProperty(property); + if (result == null) result = defaultCase(theEObject); + return result; + } case PropertyPackage.STATE_PROPERTY: { StateProperty stateProperty = (StateProperty)theEObject; T1 result = caseStateProperty(stateProperty); + if (result == null) result = caseProperty(stateProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -76,6 +83,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { BinaryProperty binaryProperty = (BinaryProperty)theEObject; T1 result = caseBinaryProperty(binaryProperty); if (result == null) result = caseStateProperty(binaryProperty); + if (result == null) result = caseProperty(binaryProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -83,6 +91,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { ManyReferenceProperty manyReferenceProperty = (ManyReferenceProperty)theEObject; T1 result = caseManyReferenceProperty(manyReferenceProperty); if (result == null) result = caseStateProperty(manyReferenceProperty); + if (result == null) result = caseProperty(manyReferenceProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -90,6 +99,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { SingleReferenceProperty singleReferenceProperty = (SingleReferenceProperty)theEObject; T1 result = caseSingleReferenceProperty(singleReferenceProperty); if (result == null) result = caseStateProperty(singleReferenceProperty); + if (result == null) result = caseProperty(singleReferenceProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -97,6 +107,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { ContainerReferenceProperty containerReferenceProperty = (ContainerReferenceProperty)theEObject; T1 result = caseContainerReferenceProperty(containerReferenceProperty); if (result == null) result = caseStateProperty(containerReferenceProperty); + if (result == null) result = caseProperty(containerReferenceProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -104,6 +115,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { ManyBooleanAttributeProperty manyBooleanAttributeProperty = (ManyBooleanAttributeProperty)theEObject; T1 result = caseManyBooleanAttributeProperty(manyBooleanAttributeProperty); if (result == null) result = caseStateProperty(manyBooleanAttributeProperty); + if (result == null) result = caseProperty(manyBooleanAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -111,6 +123,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { ManyIntegerAttributeProperty manyIntegerAttributeProperty = (ManyIntegerAttributeProperty)theEObject; T1 result = caseManyIntegerAttributeProperty(manyIntegerAttributeProperty); if (result == null) result = caseStateProperty(manyIntegerAttributeProperty); + if (result == null) result = caseProperty(manyIntegerAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -118,6 +131,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { ManyStringAttributeProperty manyStringAttributeProperty = (ManyStringAttributeProperty)theEObject; T1 result = caseManyStringAttributeProperty(manyStringAttributeProperty); if (result == null) result = caseStateProperty(manyStringAttributeProperty); + if (result == null) result = caseProperty(manyStringAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -125,6 +139,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { BooleanAttributeProperty booleanAttributeProperty = (BooleanAttributeProperty)theEObject; T1 result = caseBooleanAttributeProperty(booleanAttributeProperty); if (result == null) result = caseStateProperty(booleanAttributeProperty); + if (result == null) result = caseProperty(booleanAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -132,6 +147,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { IntegerAttributeProperty integerAttributeProperty = (IntegerAttributeProperty)theEObject; T1 result = caseIntegerAttributeProperty(integerAttributeProperty); if (result == null) result = caseStateProperty(integerAttributeProperty); + if (result == null) result = caseProperty(integerAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -139,12 +155,14 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { StringAttributeProperty stringAttributeProperty = (StringAttributeProperty)theEObject; T1 result = caseStringAttributeProperty(stringAttributeProperty); if (result == null) result = caseStateProperty(stringAttributeProperty); + if (result == null) result = caseProperty(stringAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.STEP_PROPERTY: { StepProperty stepProperty = (StepProperty)theEObject; T1 result = caseStepProperty(stepProperty); + if (result == null) result = caseProperty(stepProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -332,6 +350,21 @@ public T1 caseStepProperty(StepProperty 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 T1 caseProperty(Property object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventParameter.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventParameter.java deleted file mode 100644 index 4275a09cf..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventParameter.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Event Parameter'. - * - * - * - * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getEventParameter() - * @model - * @generated - */ -public interface EventParameter extends EObject { -} // EventParameter diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventReport.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventReport.java index a84f2f0aa..3fe5057d6 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventReport.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/EventReport.java @@ -3,7 +3,6 @@ package fr.inria.diverse.event.commons.model.report; import fr.inria.diverse.event.commons.model.scenario.Event; - import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; @@ -20,6 +19,7 @@ *
  • {@link fr.inria.diverse.event.commons.model.report.EventReport#getEvent Event}
  • *
  • {@link fr.inria.diverse.event.commons.model.report.EventReport#getMatches Matches}
  • *
  • {@link fr.inria.diverse.event.commons.model.report.EventReport#getTarget Target}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.EventReport#getTime Time}
  • * * * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getEventReport() @@ -55,7 +55,7 @@ public interface EventReport extends EObject { /** * Returns the value of the 'Matches' reference list. - * The list contents are of type {@link fr.inria.diverse.event.commons.model.report.EventParameter}. + * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. * *

    * If the meaning of the 'Matches' reference list isn't clear, @@ -67,7 +67,7 @@ public interface EventReport extends EObject { * @model * @generated */ - EList getMatches(); + EList getMatches(); /** * Returns the value of the 'Target' reference. @@ -95,4 +95,30 @@ public interface EventReport extends EObject { */ void setTarget(EObject value); + /** + * Returns the value of the 'Time' attribute. + * + *

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

    + * + * @return the value of the 'Time' attribute. + * @see #setTime(int) + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getEventReport_Time() + * @model + * @generated + */ + int getTime(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.report.EventReport#getTime Time}' attribute. + * + * + * @param value the new value of the 'Time' attribute. + * @see #getTime() + * @generated + */ + void setTime(int value); + } // EventReport diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java index 9926c4bb9..3549a0001 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/Report.java @@ -3,7 +3,6 @@ package fr.inria.diverse.event.commons.model.report; import org.eclipse.emf.common.util.EList; - import org.eclipse.emf.ecore.EObject; /** @@ -15,7 +14,7 @@ * The following features are supported: *

    *
      - *
    • {@link fr.inria.diverse.event.commons.model.report.Report#getStages Stages}
    • + *
    • {@link fr.inria.diverse.event.commons.model.report.Report#getEvents Events}
    • *
    * * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getReport() @@ -24,19 +23,19 @@ */ public interface Report extends EObject { /** - * Returns the value of the 'Stages' containment reference list. - * The list contents are of type {@link fr.inria.diverse.event.commons.model.report.StageReport}. + * Returns the value of the 'Events' containment reference list. + * The list contents are of type {@link fr.inria.diverse.event.commons.model.report.EventReport}. * *

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

    * - * @return the value of the 'Stages' containment reference list. - * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getReport_Stages() + * @return the value of the 'Events' containment reference list. + * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getReport_Events() * @model containment="true" * @generated */ - EList getStages(); + EList getEvents(); } // Report diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java index 5e4be268c..9ac78e660 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportFactory.java @@ -30,15 +30,6 @@ public interface ReportFactory extends EFactory { */ Report createReport(); - /** - * Returns a new object of class 'Stage Report'. - * - * - * @return a new object of class 'Stage Report'. - * @generated - */ - StageReport createStageReport(); - /** * Returns a new object of class 'Event Report'. * @@ -48,15 +39,6 @@ public interface ReportFactory extends EFactory { */ EventReport createEventReport(); - /** - * Returns a new object of class 'Event Parameter'. - * - * - * @return a new object of class 'Event Parameter'. - * @generated - */ - EventParameter createEventParameter(); - /** * Returns the package supported by this factory. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java index d07b6c781..386f73b29 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/ReportPackage.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.report; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; @@ -66,13 +67,13 @@ public interface ReportPackage extends EPackage { int REPORT = 0; /** - * The feature id for the 'Stages' containment reference list. + * The feature id for the 'Events' containment reference list. * * * @generated * @ordered */ - int REPORT__STAGES = 0; + int REPORT__EVENTS = 0; /** * The number of structural features of the 'Report' class. @@ -92,61 +93,6 @@ public interface ReportPackage extends EPackage { */ int REPORT_OPERATION_COUNT = 0; - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl Stage Report}' class. - * - * - * @see fr.inria.diverse.event.commons.model.report.impl.StageReportImpl - * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getStageReport() - * @generated - */ - int STAGE_REPORT = 1; - - /** - * The feature id for the 'Stage' reference. - * - * - * @generated - * @ordered - */ - int STAGE_REPORT__STAGE = 0; - - /** - * The feature id for the 'Matches' reference list. - * - * - * @generated - * @ordered - */ - int STAGE_REPORT__MATCHES = 1; - - /** - * The feature id for the 'Events' containment reference list. - * - * - * @generated - * @ordered - */ - int STAGE_REPORT__EVENTS = 2; - - /** - * The number of structural features of the 'Stage Report' class. - * - * - * @generated - * @ordered - */ - int STAGE_REPORT_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'Stage Report' class. - * - * - * @generated - * @ordered - */ - int STAGE_REPORT_OPERATION_COUNT = 0; - /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl Event Report}' class. * @@ -155,7 +101,7 @@ public interface ReportPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getEventReport() * @generated */ - int EVENT_REPORT = 2; + int EVENT_REPORT = 1; /** * The feature id for the 'Event' reference. @@ -185,50 +131,31 @@ public interface ReportPackage extends EPackage { int EVENT_REPORT__TARGET = 2; /** - * The number of structural features of the 'Event Report' class. - * - * - * @generated - * @ordered - */ - int EVENT_REPORT_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'Event Report' class. + * The feature id for the 'Time' attribute. * * * @generated * @ordered */ - int EVENT_REPORT_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.report.impl.EventParameterImpl Event Parameter}' class. - * - * - * @see fr.inria.diverse.event.commons.model.report.impl.EventParameterImpl - * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getEventParameter() - * @generated - */ - int EVENT_PARAMETER = 3; + int EVENT_REPORT__TIME = 3; /** - * The number of structural features of the 'Event Parameter' class. + * The number of structural features of the 'Event Report' class. * * * @generated * @ordered */ - int EVENT_PARAMETER_FEATURE_COUNT = 0; + int EVENT_REPORT_FEATURE_COUNT = 4; /** - * The number of operations of the 'Event Parameter' class. + * The number of operations of the 'Event Report' class. * * * @generated * @ordered */ - int EVENT_PARAMETER_OPERATION_COUNT = 0; + int EVENT_REPORT_OPERATION_COUNT = 0; /** @@ -242,58 +169,15 @@ public interface ReportPackage extends EPackage { EClass getReport(); /** - * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.report.Report#getStages Stages}'. - * - * - * @return the meta object for the containment reference list 'Stages'. - * @see fr.inria.diverse.event.commons.model.report.Report#getStages() - * @see #getReport() - * @generated - */ - EReference getReport_Stages(); - - /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.report.StageReport Stage Report}'. - * - * - * @return the meta object for class 'Stage Report'. - * @see fr.inria.diverse.event.commons.model.report.StageReport - * @generated - */ - EClass getStageReport(); - - /** - * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.report.StageReport#getStage Stage}'. - * - * - * @return the meta object for the reference 'Stage'. - * @see fr.inria.diverse.event.commons.model.report.StageReport#getStage() - * @see #getStageReport() - * @generated - */ - EReference getStageReport_Stage(); - - /** - * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.report.StageReport#getMatches Matches}'. - * - * - * @return the meta object for the reference list 'Matches'. - * @see fr.inria.diverse.event.commons.model.report.StageReport#getMatches() - * @see #getStageReport() - * @generated - */ - EReference getStageReport_Matches(); - - /** - * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.report.StageReport#getEvents Events}'. + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.report.Report#getEvents Events}'. * * * @return the meta object for the containment reference list 'Events'. - * @see fr.inria.diverse.event.commons.model.report.StageReport#getEvents() - * @see #getStageReport() + * @see fr.inria.diverse.event.commons.model.report.Report#getEvents() + * @see #getReport() * @generated */ - EReference getStageReport_Events(); + EReference getReport_Events(); /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.report.EventReport Event Report}'. @@ -339,14 +223,15 @@ public interface ReportPackage extends EPackage { EReference getEventReport_Target(); /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.report.EventParameter Event Parameter}'. + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.report.EventReport#getTime Time}'. * * - * @return the meta object for class 'Event Parameter'. - * @see fr.inria.diverse.event.commons.model.report.EventParameter + * @return the meta object for the attribute 'Time'. + * @see fr.inria.diverse.event.commons.model.report.EventReport#getTime() + * @see #getEventReport() * @generated */ - EClass getEventParameter(); + EAttribute getEventReport_Time(); /** * Returns the factory that creates the instances of the model. @@ -381,47 +266,13 @@ interface Literals { */ EClass REPORT = eINSTANCE.getReport(); - /** - * The meta object literal for the 'Stages' containment reference list feature. - * - * - * @generated - */ - EReference REPORT__STAGES = eINSTANCE.getReport_Stages(); - - /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl Stage Report}' class. - * - * - * @see fr.inria.diverse.event.commons.model.report.impl.StageReportImpl - * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getStageReport() - * @generated - */ - EClass STAGE_REPORT = eINSTANCE.getStageReport(); - - /** - * The meta object literal for the 'Stage' reference feature. - * - * - * @generated - */ - EReference STAGE_REPORT__STAGE = eINSTANCE.getStageReport_Stage(); - - /** - * The meta object literal for the 'Matches' reference list feature. - * - * - * @generated - */ - EReference STAGE_REPORT__MATCHES = eINSTANCE.getStageReport_Matches(); - /** * The meta object literal for the 'Events' containment reference list feature. * * * @generated */ - EReference STAGE_REPORT__EVENTS = eINSTANCE.getStageReport_Events(); + EReference REPORT__EVENTS = eINSTANCE.getReport_Events(); /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl Event Report}' class. @@ -458,14 +309,12 @@ interface Literals { EReference EVENT_REPORT__TARGET = eINSTANCE.getEventReport_Target(); /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.report.impl.EventParameterImpl Event Parameter}' class. + * The meta object literal for the 'Time' attribute feature. * * - * @see fr.inria.diverse.event.commons.model.report.impl.EventParameterImpl - * @see fr.inria.diverse.event.commons.model.report.impl.ReportPackageImpl#getEventParameter() * @generated */ - EClass EVENT_PARAMETER = eINSTANCE.getEventParameter(); + EAttribute EVENT_REPORT__TIME = eINSTANCE.getEventReport_Time(); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java deleted file mode 100644 index 6f7fb9d20..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/StageReport.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report; - -import fr.inria.diverse.event.commons.model.scenario.Stage; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Stage Report'. - * - * - *

    - * The following features are supported: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.report.StageReport#getStage Stage}
    • - *
    • {@link fr.inria.diverse.event.commons.model.report.StageReport#getMatches Matches}
    • - *
    • {@link fr.inria.diverse.event.commons.model.report.StageReport#getEvents Events}
    • - *
    - * - * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getStageReport() - * @model - * @generated - */ -public interface StageReport extends EObject { - /** - * Returns the value of the 'Stage' reference. - * - *

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

    - * - * @return the value of the 'Stage' reference. - * @see #setStage(Stage) - * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getStageReport_Stage() - * @model - * @generated - */ - Stage getStage(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.report.StageReport#getStage Stage}' reference. - * - * - * @param value the new value of the 'Stage' reference. - * @see #getStage() - * @generated - */ - void setStage(Stage value); - - /** - * Returns the value of the 'Matches' reference list. - * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. - * - *

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

    - * - * @return the value of the 'Matches' reference list. - * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getStageReport_Matches() - * @model - * @generated - */ - EList getMatches(); - - /** - * Returns the value of the 'Events' containment reference list. - * The list contents are of type {@link fr.inria.diverse.event.commons.model.report.EventReport}. - * - *

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

    - * - * @return the value of the 'Events' containment reference list. - * @see fr.inria.diverse.event.commons.model.report.ReportPackage#getStageReport_Events() - * @model containment="true" - * @generated - */ - EList getEvents(); - -} // StageReport diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventParameterImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventParameterImpl.java deleted file mode 100644 index 0918e26ca..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventParameterImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report.impl; - -import fr.inria.diverse.event.commons.model.report.EventParameter; -import fr.inria.diverse.event.commons.model.report.ReportPackage; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -/** - * - * An implementation of the model object 'Event Parameter'. - * - * - * @generated - */ -public class EventParameterImpl extends MinimalEObjectImpl.Container implements EventParameter { - /** - * - * - * @generated - */ - protected EventParameterImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ReportPackage.Literals.EVENT_PARAMETER; - } - -} //EventParameterImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventReportImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventReportImpl.java index 2ced8e846..fa07d42de 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventReportImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/EventReportImpl.java @@ -2,12 +2,10 @@ */ package fr.inria.diverse.event.commons.model.report.impl; -import fr.inria.diverse.event.commons.model.report.EventParameter; import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.ReportPackage; import fr.inria.diverse.event.commons.model.scenario.Event; - import java.util.Collection; import org.eclipse.emf.common.notify.Notification; @@ -34,6 +32,7 @@ *
  • {@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl#getEvent Event}
  • *
  • {@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl#getMatches Matches}
  • *
  • {@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl#getTarget Target}
  • + *
  • {@link fr.inria.diverse.event.commons.model.report.impl.EventReportImpl#getTime Time}
  • * * * @generated @@ -57,7 +56,7 @@ public class EventReportImpl extends MinimalEObjectImpl.Container implements Eve * @generated * @ordered */ - protected EList matches; + protected EList matches; /** * The cached value of the '{@link #getTarget() Target}' reference. @@ -69,6 +68,26 @@ public class EventReportImpl extends MinimalEObjectImpl.Container implements Eve */ protected EObject target; + /** + * The default value of the '{@link #getTime() Time}' attribute. + * + * + * @see #getTime() + * @generated + * @ordered + */ + protected static final int TIME_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getTime() Time}' attribute. + * + * + * @see #getTime() + * @generated + * @ordered + */ + protected int time = TIME_EDEFAULT; + /** * * @@ -131,9 +150,9 @@ public void setEvent(Event newEvent) { * * @generated */ - public EList getMatches() { + public EList getMatches() { if (matches == null) { - matches = new EObjectResolvingEList(EventParameter.class, this, ReportPackage.EVENT_REPORT__MATCHES); + matches = new EObjectResolvingEList(EObject.class, this, ReportPackage.EVENT_REPORT__MATCHES); } return matches; } @@ -176,6 +195,27 @@ public void setTarget(EObject newTarget) { eNotify(new ENotificationImpl(this, Notification.SET, ReportPackage.EVENT_REPORT__TARGET, oldTarget, target)); } + /** + * + * + * @generated + */ + public int getTime() { + return time; + } + + /** + * + * + * @generated + */ + public void setTime(int newTime) { + int oldTime = time; + time = newTime; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ReportPackage.EVENT_REPORT__TIME, oldTime, time)); + } + /** * * @@ -192,6 +232,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { case ReportPackage.EVENT_REPORT__TARGET: if (resolve) return getTarget(); return basicGetTarget(); + case ReportPackage.EVENT_REPORT__TIME: + return getTime(); } return super.eGet(featureID, resolve, coreType); } @@ -210,11 +252,14 @@ public void eSet(int featureID, Object newValue) { return; case ReportPackage.EVENT_REPORT__MATCHES: getMatches().clear(); - getMatches().addAll((Collection)newValue); + getMatches().addAll((Collection)newValue); return; case ReportPackage.EVENT_REPORT__TARGET: setTarget((EObject)newValue); return; + case ReportPackage.EVENT_REPORT__TIME: + setTime((Integer)newValue); + return; } super.eSet(featureID, newValue); } @@ -236,6 +281,9 @@ public void eUnset(int featureID) { case ReportPackage.EVENT_REPORT__TARGET: setTarget((EObject)null); return; + case ReportPackage.EVENT_REPORT__TIME: + setTime(TIME_EDEFAULT); + return; } super.eUnset(featureID); } @@ -254,8 +302,26 @@ public boolean eIsSet(int featureID) { return matches != null && !matches.isEmpty(); case ReportPackage.EVENT_REPORT__TARGET: return target != null; + case ReportPackage.EVENT_REPORT__TIME: + return time != TIME_EDEFAULT; } return super.eIsSet(featureID); } + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (time: "); + result.append(time); + result.append(')'); + return result.toString(); + } + } //EventReportImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java index 0b69cb6a0..2fc8f44c1 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportFactoryImpl.java @@ -57,9 +57,7 @@ public ReportFactoryImpl() { public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case ReportPackage.REPORT: return createReport(); - case ReportPackage.STAGE_REPORT: return createStageReport(); case ReportPackage.EVENT_REPORT: return createEventReport(); - case ReportPackage.EVENT_PARAMETER: return createEventParameter(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -75,16 +73,6 @@ public Report createReport() { return report; } - /** - * - * - * @generated - */ - public StageReport createStageReport() { - StageReportImpl stageReport = new StageReportImpl(); - return stageReport; - } - /** * * @@ -95,16 +83,6 @@ public EventReport createEventReport() { return eventReport; } - /** - * - * - * @generated - */ - public EventParameter createEventParameter() { - EventParameterImpl eventParameter = new EventParameterImpl(); - return eventParameter; - } - /** * * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java index 44d7e8acc..f8e67190a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportImpl.java @@ -2,21 +2,16 @@ */ package fr.inria.diverse.event.commons.model.report.impl; +import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.Report; import fr.inria.diverse.event.commons.model.report.ReportPackage; -import fr.inria.diverse.event.commons.model.report.StageReport; 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.impl.MinimalEObjectImpl; - import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; @@ -28,21 +23,21 @@ * The following features are implemented: *

    *
      - *
    • {@link fr.inria.diverse.event.commons.model.report.impl.ReportImpl#getStages Stages}
    • + *
    • {@link fr.inria.diverse.event.commons.model.report.impl.ReportImpl#getEvents Events}
    • *
    * * @generated */ public class ReportImpl extends MinimalEObjectImpl.Container implements Report { /** - * The cached value of the '{@link #getStages() Stages}' containment reference list. + * The cached value of the '{@link #getEvents() Events}' containment reference list. * * - * @see #getStages() + * @see #getEvents() * @generated * @ordered */ - protected EList stages; + protected EList events; /** * @@ -68,11 +63,11 @@ protected EClass eStaticClass() { * * @generated */ - public EList getStages() { - if (stages == null) { - stages = new EObjectContainmentEList(StageReport.class, this, ReportPackage.REPORT__STAGES); + public EList getEvents() { + if (events == null) { + events = new EObjectContainmentEList(EventReport.class, this, ReportPackage.REPORT__EVENTS); } - return stages; + return events; } /** @@ -83,8 +78,8 @@ public EList getStages() { @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case ReportPackage.REPORT__STAGES: - return ((InternalEList)getStages()).basicRemove(otherEnd, msgs); + case ReportPackage.REPORT__EVENTS: + return ((InternalEList)getEvents()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -97,8 +92,8 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case ReportPackage.REPORT__STAGES: - return getStages(); + case ReportPackage.REPORT__EVENTS: + return getEvents(); } return super.eGet(featureID, resolve, coreType); } @@ -112,9 +107,9 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case ReportPackage.REPORT__STAGES: - getStages().clear(); - getStages().addAll((Collection)newValue); + case ReportPackage.REPORT__EVENTS: + getEvents().clear(); + getEvents().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); @@ -128,8 +123,8 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case ReportPackage.REPORT__STAGES: - getStages().clear(); + case ReportPackage.REPORT__EVENTS: + getEvents().clear(); return; } super.eUnset(featureID); @@ -143,8 +138,8 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case ReportPackage.REPORT__STAGES: - return stages != null && !stages.isEmpty(); + case ReportPackage.REPORT__EVENTS: + return events != null && !events.isEmpty(); } return super.eIsSet(featureID); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java index 1c2196a1f..8d2c90971 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java @@ -2,15 +2,14 @@ */ package fr.inria.diverse.event.commons.model.report.impl; -import fr.inria.diverse.event.commons.model.report.EventParameter; import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.Report; import fr.inria.diverse.event.commons.model.report.ReportFactory; import fr.inria.diverse.event.commons.model.report.ReportPackage; -import fr.inria.diverse.event.commons.model.report.StageReport; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EGenericType; import org.eclipse.emf.ecore.EPackage; @@ -32,13 +31,6 @@ public class ReportPackageImpl extends EPackageImpl implements ReportPackage { */ private EClass reportEClass = null; - /** - * - * - * @generated - */ - private EClass stageReportEClass = null; - /** * * @@ -46,13 +38,6 @@ public class ReportPackageImpl extends EPackageImpl implements ReportPackage { */ private EClass eventReportEClass = null; - /** - * - * - * @generated - */ - private EClass eventParameterEClass = null; - /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package @@ -131,46 +116,10 @@ public EClass getReport() { * * @generated */ - public EReference getReport_Stages() { + public EReference getReport_Events() { return (EReference)reportEClass.getEStructuralFeatures().get(0); } - /** - * - * - * @generated - */ - public EClass getStageReport() { - return stageReportEClass; - } - - /** - * - * - * @generated - */ - public EReference getStageReport_Stage() { - return (EReference)stageReportEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getStageReport_Matches() { - return (EReference)stageReportEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getStageReport_Events() { - return (EReference)stageReportEClass.getEStructuralFeatures().get(2); - } - /** * * @@ -212,8 +161,8 @@ public EReference getEventReport_Target() { * * @generated */ - public EClass getEventParameter() { - return eventParameterEClass; + public EAttribute getEventReport_Time() { + return (EAttribute)eventReportEClass.getEStructuralFeatures().get(3); } /** @@ -245,19 +194,13 @@ public void createPackageContents() { // Create classes and their features reportEClass = createEClass(REPORT); - createEReference(reportEClass, REPORT__STAGES); - - stageReportEClass = createEClass(STAGE_REPORT); - createEReference(stageReportEClass, STAGE_REPORT__STAGE); - createEReference(stageReportEClass, STAGE_REPORT__MATCHES); - createEReference(stageReportEClass, STAGE_REPORT__EVENTS); + createEReference(reportEClass, REPORT__EVENTS); eventReportEClass = createEClass(EVENT_REPORT); createEReference(eventReportEClass, EVENT_REPORT__EVENT); createEReference(eventReportEClass, EVENT_REPORT__MATCHES); createEReference(eventReportEClass, EVENT_REPORT__TARGET); - - eventParameterEClass = createEClass(EVENT_PARAMETER); + createEAttribute(eventReportEClass, EVENT_REPORT__TIME); } /** @@ -294,27 +237,16 @@ public void initializePackageContents() { // Initialize classes, features, and operations; add parameters initEClass(reportEClass, Report.class, "Report", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getReport_Stages(), this.getStageReport(), null, "stages", null, 0, -1, Report.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(stageReportEClass, StageReport.class, "StageReport", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - EGenericType g1 = createEGenericType(theScenarioPackage.getStage()); - EGenericType g2 = createEGenericType(); - g1.getETypeArguments().add(g2); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); - initEReference(getStageReport_Stage(), g1, null, "stage", null, 0, 1, StageReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getStageReport_Matches(), ecorePackage.getEObject(), null, "matches", null, 0, -1, StageReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getStageReport_Events(), this.getEventReport(), null, "events", null, 0, -1, StageReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getReport_Events(), this.getEventReport(), null, "events", null, 0, -1, Report.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(eventReportEClass, EventReport.class, "EventReport", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(theScenarioPackage.getEvent()); - g2 = createEGenericType(); + EGenericType g1 = createEGenericType(theScenarioPackage.getEvent()); + EGenericType g2 = createEGenericType(); g1.getETypeArguments().add(g2); initEReference(getEventReport_Event(), g1, null, "event", null, 0, 1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getEventReport_Matches(), this.getEventParameter(), null, "matches", null, 0, -1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getEventReport_Matches(), ecorePackage.getEObject(), null, "matches", null, 0, -1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getEventReport_Target(), ecorePackage.getEObject(), null, "target", null, 0, 1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(eventParameterEClass, EventParameter.class, "EventParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getEventReport_Time(), ecorePackage.getEInt(), "time", null, 0, 1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Create resource createResource(eNS_URI); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java deleted file mode 100644 index 904ca6207..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/StageReportImpl.java +++ /dev/null @@ -1,252 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report.impl; - -import fr.inria.diverse.event.commons.model.report.EventReport; -import fr.inria.diverse.event.commons.model.report.ReportPackage; -import fr.inria.diverse.event.commons.model.report.StageReport; - -import fr.inria.diverse.event.commons.model.scenario.Stage; - -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.EObject; -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.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Stage Report'. - * - *

    - * The following features are implemented: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl#getStage Stage}
    • - *
    • {@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl#getMatches Matches}
    • - *
    • {@link fr.inria.diverse.event.commons.model.report.impl.StageReportImpl#getEvents Events}
    • - *
    - * - * @generated - */ -public class StageReportImpl extends MinimalEObjectImpl.Container implements StageReport { - /** - * The cached value of the '{@link #getStage() Stage}' reference. - * - * - * @see #getStage() - * @generated - * @ordered - */ - protected Stage stage; - - /** - * The cached value of the '{@link #getMatches() Matches}' reference list. - * - * - * @see #getMatches() - * @generated - * @ordered - */ - protected EList matches; - - /** - * The cached value of the '{@link #getEvents() Events}' containment reference list. - * - * - * @see #getEvents() - * @generated - * @ordered - */ - protected EList events; - - /** - * - * - * @generated - */ - protected StageReportImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ReportPackage.Literals.STAGE_REPORT; - } - - /** - * - * - * @generated - */ - public Stage getStage() { - if (stage != null && stage.eIsProxy()) { - InternalEObject oldStage = (InternalEObject)stage; - stage = (Stage)eResolveProxy(oldStage); - if (stage != oldStage) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReportPackage.STAGE_REPORT__STAGE, oldStage, stage)); - } - } - return stage; - } - - /** - * - * - * @generated - */ - public Stage basicGetStage() { - return stage; - } - - /** - * - * - * @generated - */ - public void setStage(Stage newStage) { - Stage oldStage = stage; - stage = newStage; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ReportPackage.STAGE_REPORT__STAGE, oldStage, stage)); - } - - /** - * - * - * @generated - */ - public EList getMatches() { - if (matches == null) { - matches = new EObjectResolvingEList(EObject.class, this, ReportPackage.STAGE_REPORT__MATCHES); - } - return matches; - } - - /** - * - * - * @generated - */ - public EList getEvents() { - if (events == null) { - events = new EObjectContainmentEList(EventReport.class, this, ReportPackage.STAGE_REPORT__EVENTS); - } - return events; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ReportPackage.STAGE_REPORT__EVENTS: - return ((InternalEList)getEvents()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ReportPackage.STAGE_REPORT__STAGE: - if (resolve) return getStage(); - return basicGetStage(); - case ReportPackage.STAGE_REPORT__MATCHES: - return getMatches(); - case ReportPackage.STAGE_REPORT__EVENTS: - return getEvents(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ReportPackage.STAGE_REPORT__STAGE: - setStage((Stage)newValue); - return; - case ReportPackage.STAGE_REPORT__MATCHES: - getMatches().clear(); - getMatches().addAll((Collection)newValue); - return; - case ReportPackage.STAGE_REPORT__EVENTS: - getEvents().clear(); - getEvents().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ReportPackage.STAGE_REPORT__STAGE: - setStage((Stage)null); - return; - case ReportPackage.STAGE_REPORT__MATCHES: - getMatches().clear(); - return; - case ReportPackage.STAGE_REPORT__EVENTS: - getEvents().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ReportPackage.STAGE_REPORT__STAGE: - return stage != null; - case ReportPackage.STAGE_REPORT__MATCHES: - return matches != null && !matches.isEmpty(); - case ReportPackage.STAGE_REPORT__EVENTS: - return events != null && !events.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //StageReportImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java index 023b014ce..3a79aa83d 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportAdapterFactory.java @@ -72,18 +72,10 @@ public Adapter caseReport(Report object) { return createReportAdapter(); } @Override - public Adapter caseStageReport(StageReport object) { - return createStageReportAdapter(); - } - @Override public Adapter caseEventReport(EventReport object) { return createEventReportAdapter(); } @Override - public Adapter caseEventParameter(EventParameter object) { - return createEventParameterAdapter(); - } - @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -117,20 +109,6 @@ public Adapter createReportAdapter() { return null; } - /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.report.StageReport Stage Report}'. - * - * 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 fr.inria.diverse.event.commons.model.report.StageReport - * @generated - */ - public Adapter createStageReportAdapter() { - return null; - } - /** * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.report.EventReport Event Report}'. * @@ -145,20 +123,6 @@ public Adapter createEventReportAdapter() { return null; } - /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.report.EventParameter Event 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 fr.inria.diverse.event.commons.model.report.EventParameter - * @generated - */ - public Adapter createEventParameterAdapter() { - return null; - } - /** * Creates a new adapter for the default case. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java index 0d7fddd6b..16b7fa0c5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/util/ReportSwitch.java @@ -72,24 +72,12 @@ protected T doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } - case ReportPackage.STAGE_REPORT: { - StageReport stageReport = (StageReport)theEObject; - T result = caseStageReport(stageReport); - if (result == null) result = defaultCase(theEObject); - return result; - } case ReportPackage.EVENT_REPORT: { EventReport eventReport = (EventReport)theEObject; T result = caseEventReport(eventReport); if (result == null) result = defaultCase(theEObject); return result; } - case ReportPackage.EVENT_PARAMETER: { - EventParameter eventParameter = (EventParameter)theEObject; - T result = caseEventParameter(eventParameter); - if (result == null) result = defaultCase(theEObject); - return result; - } default: return defaultCase(theEObject); } } @@ -109,21 +97,6 @@ public T caseReport(Report object) { return null; } - /** - * Returns the result of interpreting the object as an instance of 'Stage Report'. - * - * 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 'Stage Report'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseStageReport(StageReport object) { - return null; - } - /** * Returns the result of interpreting the object as an instance of 'Event Report'. * @@ -139,21 +112,6 @@ public T caseEventReport(EventReport object) { return null; } - /** - * Returns the result of interpreting the object as an instance of 'Event 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 'Event Parameter'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseEventParameter(EventParameter object) { - return null; - } - /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Date.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Date.java deleted file mode 100644 index bb30a35b3..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Date.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.scenario; - - -/** - * - * A representation of the model object 'Date'. - * - * - *

    - * The following features are supported: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.Date#getTime Time}
    • - *
    - * - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getDate() - * @model abstract="true" - * @generated - */ -public interface Date> extends Phase { - /** - * Returns the value of the 'Time' attribute. - * - *

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

    - * - * @return the value of the 'Time' attribute. - * @see #setTime(int) - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getDate_Time() - * @model - * @generated - */ - int getTime(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Date#getTime Time}' attribute. - * - * - * @param value the new value of the 'Time' attribute. - * @see #getTime() - * @generated - */ - void setTime(int value); - -} // Date diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/EventOccurrence.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/EventOccurrence.java new file mode 100644 index 000000000..faef7d725 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/EventOccurrence.java @@ -0,0 +1,77 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import fr.inria.diverse.event.commons.model.property.StateProperty; + +/** + * + * A representation of the model object 'Event Occurrence'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.EventOccurrence#getEvent Event}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.EventOccurrence#getTime Time}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getEventOccurrence() + * @model abstract="true" + * @generated + */ +public interface EventOccurrence, P extends StateProperty> extends ScenarioElement

    { + /** + * Returns the value of the 'Event' containment reference. + * + *

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

    + * + * @return the value of the 'Event' containment reference. + * @see #setEvent(Event) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getEventOccurrence_Event() + * @model containment="true" + * @generated + */ + E getEvent(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.EventOccurrence#getEvent Event}' containment reference. + * + * + * @param value the new value of the 'Event' containment reference. + * @see #getEvent() + * @generated + */ + void setEvent(E value); + + /** + * Returns the value of the 'Time' attribute. + * + *

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

    + * + * @return the value of the 'Time' attribute. + * @see #setTime(int) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getEventOccurrence_Time() + * @model + * @generated + */ + int getTime(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.EventOccurrence#getTime Time}' attribute. + * + * + * @param value the new value of the 'Time' attribute. + * @see #getTime() + * @generated + */ + void setTime(int value); + +} // EventOccurrence diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Phase.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Phase.java deleted file mode 100644 index b5c5de157..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Phase.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.scenario; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Phase'. - * - * - *

    - * The following features are supported: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.Phase#getEvent Event}
    • - *
    - * - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getPhase() - * @model abstract="true" - * @generated - */ -public interface Phase> extends EObject { - /** - * Returns the value of the 'Event' containment reference. - * - *

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

    - * - * @return the value of the 'Event' containment reference. - * @see #setEvent(Event) - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getPhase_Event() - * @model containment="true" - * @generated - */ - E getEvent(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Phase#getEvent Event}' containment reference. - * - * - * @param value the new value of the 'Event' containment reference. - * @see #getEvent() - * @generated - */ - void setEvent(E value); - -} // Phase diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java index cf9baedb2..9bc353e72 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Scenario.java @@ -15,27 +15,27 @@ * The following features are supported: *

    *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.Scenario#getPhases Phases}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.Scenario#getElements Elements}
    • *
    * * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenario() * @model abstract="true" * @generated */ -public interface Scenario

    > extends EObject { +public interface Scenario> extends EObject { /** - * Returns the value of the 'Phases' containment reference list. + * Returns the value of the 'Elements' containment reference list. * *

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

    * - * @return the value of the 'Phases' containment reference list. - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenario_Phases() + * @return the value of the 'Elements' containment reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenario_Elements() * @model containment="true" * @generated */ - EList

    getPhases(); + EList getElements(); } // Scenario diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java new file mode 100644 index 000000000..1202d06ed --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java @@ -0,0 +1,71 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import fr.inria.diverse.event.commons.model.property.StateProperty; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Element'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getNextElements Next Elements}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getGuard Guard}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioElement() + * @model abstract="true" + * @generated + */ +public interface ScenarioElement

    > extends EObject { + /** + * Returns the value of the 'Next Elements' reference list. + * The list contents are of type {@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement}<P>. + * + *

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

    + * + * @return the value of the 'Next Elements' reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioElement_NextElements() + * @model + * @generated + */ + EList> getNextElements(); + + /** + * Returns the value of the 'Guard' containment reference. + * + *

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

    + * + * @return the value of the 'Guard' containment reference. + * @see #setGuard(StateProperty) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioElement_Guard() + * @model containment="true" + * @generated + */ + P getGuard(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getGuard Guard}' containment reference. + * + * + * @param value the new value of the 'Guard' containment reference. + * @see #getGuard() + * @generated + */ + void setGuard(P value); + +} // ScenarioElement diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSM.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSM.java new file mode 100644 index 000000000..674165c9f --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSM.java @@ -0,0 +1,100 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import fr.inria.diverse.event.commons.model.property.StateProperty; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'FSM'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getStates States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getInitialState Initial State}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getAcceptingStates Accepting States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getTransitions Transitions}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSM() + * @model abstract="true" + * @generated + */ +public interface ScenarioFSM

    , E extends Event, S extends ScenarioFSMState, T extends ScenarioFSMTransition> extends ScenarioElement

    { + /** + * Returns the value of the 'States' containment reference list. + * + *

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

    + * + * @return the value of the 'States' containment reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSM_States() + * @model containment="true" + * @generated + */ + EList getStates(); + + /** + * Returns the value of the 'Initial State' reference. + * + *

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

    + * + * @return the value of the 'Initial State' reference. + * @see #setInitialState(ScenarioFSMState) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSM_InitialState() + * @model required="true" + * @generated + */ + S getInitialState(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getInitialState Initial State}' reference. + * + * + * @param value the new value of the 'Initial State' reference. + * @see #getInitialState() + * @generated + */ + void setInitialState(S value); + + /** + * Returns the value of the 'Accepting States' reference list. + * + *

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

    + * + * @return the value of the 'Accepting States' reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSM_AcceptingStates() + * @model + * @generated + */ + EList getAcceptingStates(); + + /** + * Returns the value of the 'Transitions' containment reference list. + * + *

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

    + * + * @return the value of the 'Transitions' containment reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSM_Transitions() + * @model containment="true" + * @generated + */ + EList getTransitions(); + +} // ScenarioFSM diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMState.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMState.java new file mode 100644 index 000000000..22e7551c0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMState.java @@ -0,0 +1,88 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'FSM State'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getEvent Event}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getOutgoingTransitions Outgoing Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getIncomingTransitions Incoming Transitions}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMState() + * @model abstract="true" + * @generated + */ +public interface ScenarioFSMState, T extends ScenarioFSMTransition> extends EObject { + /** + * Returns the value of the 'Event' containment reference. + * + *

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

    + * + * @return the value of the 'Event' containment reference. + * @see #setEvent(Event) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMState_Event() + * @model containment="true" + * @generated + */ + E getEvent(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getEvent Event}' containment reference. + * + * + * @param value the new value of the 'Event' containment reference. + * @see #getEvent() + * @generated + */ + void setEvent(E value); + + /** + * Returns the value of the 'Outgoing Transitions' reference list. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getSource Source}'. + * + *

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

    + * + * @return the value of the 'Outgoing Transitions' reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMState_OutgoingTransitions() + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getSource + * @model opposite="source" + * @generated + */ + EList getOutgoingTransitions(); + + /** + * Returns the value of the 'Incoming Transitions' reference list. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getTarget Target}'. + * + *

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

    + * + * @return the value of the 'Incoming Transitions' reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMState_IncomingTransitions() + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getTarget + * @model opposite="target" + * @generated + */ + EList getIncomingTransitions(); + +} // ScenarioFSMState diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMTransition.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMTransition.java new file mode 100644 index 000000000..9c4f730d5 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMTransition.java @@ -0,0 +1,109 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import fr.inria.diverse.event.commons.model.property.StateProperty; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'FSM Transition'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getGuard Guard}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getSource Source}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getTarget Target}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMTransition() + * @model abstract="true" + * @generated + */ +public interface ScenarioFSMTransition

    , S extends ScenarioFSMState> extends EObject { + /** + * Returns the value of the 'Guard' containment reference. + * + *

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

    + * + * @return the value of the 'Guard' containment reference. + * @see #setGuard(StateProperty) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMTransition_Guard() + * @model containment="true" + * @generated + */ + P getGuard(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getGuard Guard}' containment reference. + * + * + * @param value the new value of the 'Guard' containment reference. + * @see #getGuard() + * @generated + */ + void setGuard(P value); + + /** + * Returns the value of the 'Source' reference. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getOutgoingTransitions Outgoing Transitions}'. + * + *

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

    + * + * @return the value of the 'Source' reference. + * @see #setSource(ScenarioFSMState) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMTransition_Source() + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getOutgoingTransitions + * @model opposite="outgoingTransitions" required="true" + * @generated + */ + S getSource(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getSource Source}' reference. + * + * + * @param value the new value of the 'Source' reference. + * @see #getSource() + * @generated + */ + void setSource(S value); + + /** + * Returns the value of the 'Target' reference. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getIncomingTransitions Incoming Transitions}'. + * + *

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

    + * + * @return the value of the 'Target' reference. + * @see #setTarget(ScenarioFSMState) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMTransition_Target() + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getIncomingTransitions + * @model opposite="incomingTransitions" required="true" + * @generated + */ + S getTarget(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(S value); + +} // ScenarioFSMTransition diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java index 9d87fc084..28efbfa2b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java @@ -67,13 +67,13 @@ public interface ScenarioPackage extends EPackage { int SCENARIO = 0; /** - * The feature id for the 'Phases' containment reference list. + * The feature id for the 'Elements' containment reference list. * * * @generated * @ordered */ - int SCENARIO__PHASES = 0; + int SCENARIO__ELEMENTS = 0; /** * The number of structural features of the 'Scenario' class. @@ -131,236 +131,308 @@ public interface ScenarioPackage extends EPackage { int EVENT_OPERATION_COUNT = 0; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl Phase}' class. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementProviderImpl Element Provider}' class. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getPhase() + * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementProviderImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementProvider() * @generated */ - int PHASE = 8; + int ELEMENT_PROVIDER = 2; /** - * The feature id for the 'Event' containment reference. + * The number of structural features of the 'Element Provider' class. * * * @generated * @ordered */ - int PHASE__EVENT = 0; + int ELEMENT_PROVIDER_FEATURE_COUNT = 0; /** - * The number of structural features of the 'Phase' class. + * The number of operations of the 'Element Provider' class. * * * @generated * @ordered */ - int PHASE_FEATURE_COUNT = 1; + int ELEMENT_PROVIDER_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementReferenceImpl Element Reference}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementReferenceImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementReference() + * @generated + */ + int ELEMENT_REFERENCE = 3; /** - * The number of operations of the 'Phase' class. + * The feature id for the 'Element' reference. * * * @generated * @ordered */ - int PHASE_OPERATION_COUNT = 0; + int ELEMENT_REFERENCE__ELEMENT = ELEMENT_PROVIDER_FEATURE_COUNT + 0; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl Stage}' class. + * The number of structural features of the 'Element Reference' class. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.StageImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getStage() * @generated + * @ordered */ - int STAGE = 2; + int ELEMENT_REFERENCE_FEATURE_COUNT = ELEMENT_PROVIDER_FEATURE_COUNT + 1; /** - * The feature id for the 'Event' containment reference. + * The number of operations of the 'Element Reference' class. * * * @generated * @ordered */ - int STAGE__EVENT = PHASE__EVENT; + int ELEMENT_REFERENCE_OPERATION_COUNT = ELEMENT_PROVIDER_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl Element Query}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementQuery() + * @generated + */ + int ELEMENT_QUERY = 4; /** - * The feature id for the 'Property' containment reference. + * The feature id for the 'Query' containment reference. * * * @generated * @ordered */ - int STAGE__PROPERTY = PHASE_FEATURE_COUNT + 0; + int ELEMENT_QUERY__QUERY = ELEMENT_PROVIDER_FEATURE_COUNT + 0; /** - * The number of structural features of the 'Stage' class. + * The number of structural features of the 'Element Query' class. * * * @generated * @ordered */ - int STAGE_FEATURE_COUNT = PHASE_FEATURE_COUNT + 1; + int ELEMENT_QUERY_FEATURE_COUNT = ELEMENT_PROVIDER_FEATURE_COUNT + 1; /** - * The number of operations of the 'Stage' class. + * The number of operations of the 'Element Query' class. * * * @generated * @ordered */ - int STAGE_OPERATION_COUNT = PHASE_OPERATION_COUNT + 0; + int ELEMENT_QUERY_OPERATION_COUNT = ELEMENT_PROVIDER_OPERATION_COUNT + 0; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementProviderImpl Element Provider}' class. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioElementImpl Element}' class. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementProviderImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementProvider() + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioElementImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenarioElement() * @generated */ - int ELEMENT_PROVIDER = 3; + int SCENARIO_ELEMENT = 6; /** - * The number of structural features of the 'Element Provider' class. + * The feature id for the 'Next Elements' reference list. * * * @generated * @ordered */ - int ELEMENT_PROVIDER_FEATURE_COUNT = 0; + int SCENARIO_ELEMENT__NEXT_ELEMENTS = 0; /** - * The number of operations of the 'Element Provider' class. + * The feature id for the 'Guard' containment reference. * * * @generated * @ordered */ - int ELEMENT_PROVIDER_OPERATION_COUNT = 0; + int SCENARIO_ELEMENT__GUARD = 1; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementReferenceImpl Element Reference}' class. + * The number of structural features of the 'Element' class. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementReferenceImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementReference() * @generated + * @ordered */ - int ELEMENT_REFERENCE = 4; + int SCENARIO_ELEMENT_FEATURE_COUNT = 2; /** - * The feature id for the 'Element' reference. + * The number of operations of the 'Element' class. * * * @generated * @ordered */ - int ELEMENT_REFERENCE__ELEMENT = ELEMENT_PROVIDER_FEATURE_COUNT + 0; + int SCENARIO_ELEMENT_OPERATION_COUNT = 0; /** - * The number of structural features of the 'Element Reference' class. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.EventOccurrenceImpl Event Occurrence}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.EventOccurrenceImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getEventOccurrence() + * @generated + */ + int EVENT_OCCURRENCE = 5; + + /** + * The feature id for the 'Next Elements' reference list. * * * @generated * @ordered */ - int ELEMENT_REFERENCE_FEATURE_COUNT = ELEMENT_PROVIDER_FEATURE_COUNT + 1; + int EVENT_OCCURRENCE__NEXT_ELEMENTS = SCENARIO_ELEMENT__NEXT_ELEMENTS; /** - * The number of operations of the 'Element Reference' class. + * The feature id for the 'Guard' containment reference. * * * @generated * @ordered */ - int ELEMENT_REFERENCE_OPERATION_COUNT = ELEMENT_PROVIDER_OPERATION_COUNT + 0; + int EVENT_OCCURRENCE__GUARD = SCENARIO_ELEMENT__GUARD; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl Element Query}' class. + * The feature id for the 'Event' containment reference. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getElementQuery() * @generated + * @ordered */ - int ELEMENT_QUERY = 5; + int EVENT_OCCURRENCE__EVENT = SCENARIO_ELEMENT_FEATURE_COUNT + 0; /** - * The feature id for the 'Query' containment reference. + * The feature id for the 'Time' attribute. * * * @generated * @ordered */ - int ELEMENT_QUERY__QUERY = ELEMENT_PROVIDER_FEATURE_COUNT + 0; + int EVENT_OCCURRENCE__TIME = SCENARIO_ELEMENT_FEATURE_COUNT + 1; /** - * The number of structural features of the 'Element Query' class. + * The number of structural features of the 'Event Occurrence' class. * * * @generated * @ordered */ - int ELEMENT_QUERY_FEATURE_COUNT = ELEMENT_PROVIDER_FEATURE_COUNT + 1; + int EVENT_OCCURRENCE_FEATURE_COUNT = SCENARIO_ELEMENT_FEATURE_COUNT + 2; /** - * The number of operations of the 'Element Query' class. + * The number of operations of the 'Event Occurrence' class. * * * @generated * @ordered */ - int ELEMENT_QUERY_OPERATION_COUNT = ELEMENT_PROVIDER_OPERATION_COUNT + 0; + int EVENT_OCCURRENCE_OPERATION_COUNT = SCENARIO_ELEMENT_OPERATION_COUNT + 0; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl Test Suite}' class. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl FSM}' class. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getTestSuite() + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenarioFSM() * @generated */ - int TEST_SUITE = 6; + int SCENARIO_FSM = 7; /** - * The feature id for the 'Tests' containment reference list. + * The feature id for the 'Next Elements' reference list. * * * @generated * @ordered */ - int TEST_SUITE__TESTS = 0; + int SCENARIO_FSM__NEXT_ELEMENTS = SCENARIO_ELEMENT__NEXT_ELEMENTS; /** - * The number of structural features of the 'Test Suite' class. + * The feature id for the 'Guard' containment reference. * * * @generated * @ordered */ - int TEST_SUITE_FEATURE_COUNT = 1; + int SCENARIO_FSM__GUARD = SCENARIO_ELEMENT__GUARD; /** - * The number of operations of the 'Test Suite' class. + * The feature id for the 'States' containment reference list. * * * @generated * @ordered */ - int TEST_SUITE_OPERATION_COUNT = 0; + int SCENARIO_FSM__STATES = SCENARIO_ELEMENT_FEATURE_COUNT + 0; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.DateImpl Date}' class. + * The feature id for the 'Initial State' reference. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.DateImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getDate() * @generated + * @ordered */ - int DATE = 7; + int SCENARIO_FSM__INITIAL_STATE = SCENARIO_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Accepting States' reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM__ACCEPTING_STATES = SCENARIO_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Transitions' containment reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM__TRANSITIONS = SCENARIO_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'FSM' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_FEATURE_COUNT = SCENARIO_ELEMENT_FEATURE_COUNT + 4; + + /** + * The number of operations of the 'FSM' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_OPERATION_COUNT = SCENARIO_ELEMENT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl FSM State}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenarioFSMState() + * @generated + */ + int SCENARIO_FSM_STATE = 8; /** * The feature id for the 'Event' containment reference. @@ -369,34 +441,98 @@ public interface ScenarioPackage extends EPackage { * @generated * @ordered */ - int DATE__EVENT = PHASE__EVENT; + int SCENARIO_FSM_STATE__EVENT = 0; /** - * The feature id for the 'Time' attribute. + * The feature id for the 'Outgoing Transitions' reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS = 1; + + /** + * The feature id for the 'Incoming Transitions' reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_STATE__INCOMING_TRANSITIONS = 2; + + /** + * The number of structural features of the 'FSM State' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_STATE_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'FSM State' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_STATE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl FSM Transition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenarioFSMTransition() + * @generated + */ + int SCENARIO_FSM_TRANSITION = 9; + + /** + * The feature id for the 'Guard' containment reference. * * * @generated * @ordered */ - int DATE__TIME = PHASE_FEATURE_COUNT + 0; + int SCENARIO_FSM_TRANSITION__GUARD = 0; /** - * The number of structural features of the 'Date' class. + * The feature id for the 'Source' reference. * * * @generated * @ordered */ - int DATE_FEATURE_COUNT = PHASE_FEATURE_COUNT + 1; + int SCENARIO_FSM_TRANSITION__SOURCE = 1; /** - * The number of operations of the 'Date' class. + * The feature id for the 'Target' reference. * * * @generated * @ordered */ - int DATE_OPERATION_COUNT = PHASE_OPERATION_COUNT + 0; + int SCENARIO_FSM_TRANSITION__TARGET = 2; + + /** + * The number of structural features of the 'FSM Transition' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_TRANSITION_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'FSM Transition' class. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_TRANSITION_OPERATION_COUNT = 0; /** @@ -410,15 +546,15 @@ public interface ScenarioPackage extends EPackage { EClass getScenario(); /** - * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.Scenario#getPhases Phases}'. + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.Scenario#getElements Elements}'. * * - * @return the meta object for the containment reference list 'Phases'. - * @see fr.inria.diverse.event.commons.model.scenario.Scenario#getPhases() + * @return the meta object for the containment reference list 'Elements'. + * @see fr.inria.diverse.event.commons.model.scenario.Scenario#getElements() * @see #getScenario() * @generated */ - EReference getScenario_Phases(); + EReference getScenario_Elements(); /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Event Event}'. @@ -441,27 +577,6 @@ public interface ScenarioPackage extends EPackage { */ EReference getEvent_TargetProvider(); - /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Stage Stage}'. - * - * - * @return the meta object for class 'Stage'. - * @see fr.inria.diverse.event.commons.model.scenario.Stage - * @generated - */ - EClass getStage(); - - /** - * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.Stage#getProperty Property}'. - * - * - * @return the meta object for the containment reference 'Property'. - * @see fr.inria.diverse.event.commons.model.scenario.Stage#getProperty() - * @see #getStage() - * @generated - */ - EReference getStage_Property(); - /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ElementProvider Element Provider}'. * @@ -515,67 +630,208 @@ public interface ScenarioPackage extends EPackage { EReference getElementQuery_Query(); /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.TestSuite Test Suite}'. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.EventOccurrence Event Occurrence}'. * * - * @return the meta object for class 'Test Suite'. - * @see fr.inria.diverse.event.commons.model.scenario.TestSuite + * @return the meta object for class 'Event Occurrence'. + * @see fr.inria.diverse.event.commons.model.scenario.EventOccurrence * @generated */ - EClass getTestSuite(); + EClass getEventOccurrence(); /** - * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.TestSuite#getTests Tests}'. + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.EventOccurrence#getEvent Event}'. * * - * @return the meta object for the containment reference list 'Tests'. - * @see fr.inria.diverse.event.commons.model.scenario.TestSuite#getTests() - * @see #getTestSuite() + * @return the meta object for the containment reference 'Event'. + * @see fr.inria.diverse.event.commons.model.scenario.EventOccurrence#getEvent() + * @see #getEventOccurrence() * @generated */ - EReference getTestSuite_Tests(); + EReference getEventOccurrence_Event(); /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Date Date}'. + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.EventOccurrence#getTime Time}'. * * - * @return the meta object for class 'Date'. - * @see fr.inria.diverse.event.commons.model.scenario.Date + * @return the meta object for the attribute 'Time'. + * @see fr.inria.diverse.event.commons.model.scenario.EventOccurrence#getTime() + * @see #getEventOccurrence() * @generated */ - EClass getDate(); + EAttribute getEventOccurrence_Time(); /** - * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.Date#getTime Time}'. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement Element}'. * * - * @return the meta object for the attribute 'Time'. - * @see fr.inria.diverse.event.commons.model.scenario.Date#getTime() - * @see #getDate() + * @return the meta object for class 'Element'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioElement + * @generated + */ + EClass getScenarioElement(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getNextElements Next Elements}'. + * + * + * @return the meta object for the reference list 'Next Elements'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getNextElements() + * @see #getScenarioElement() + * @generated + */ + EReference getScenarioElement_NextElements(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getGuard Guard}'. + * + * + * @return the meta object for the containment reference 'Guard'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getGuard() + * @see #getScenarioElement() + * @generated + */ + EReference getScenarioElement_Guard(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM FSM}'. + * + * + * @return the meta object for class 'FSM'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSM + * @generated + */ + EClass getScenarioFSM(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getStates States}'. + * + * + * @return the meta object for the containment reference list 'States'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getStates() + * @see #getScenarioFSM() + * @generated + */ + EReference getScenarioFSM_States(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getInitialState Initial State}'. + * + * + * @return the meta object for the reference 'Initial State'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getInitialState() + * @see #getScenarioFSM() + * @generated + */ + EReference getScenarioFSM_InitialState(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getAcceptingStates Accepting States}'. + * + * + * @return the meta object for the reference list 'Accepting States'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getAcceptingStates() + * @see #getScenarioFSM() + * @generated + */ + EReference getScenarioFSM_AcceptingStates(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getTransitions Transitions}'. + * + * + * @return the meta object for the containment reference list 'Transitions'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getTransitions() + * @see #getScenarioFSM() * @generated */ - EAttribute getDate_Time(); + EReference getScenarioFSM_Transitions(); /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Phase Phase}'. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState FSM State}'. * * - * @return the meta object for class 'Phase'. - * @see fr.inria.diverse.event.commons.model.scenario.Phase + * @return the meta object for class 'FSM State'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState * @generated */ - EClass getPhase(); + EClass getScenarioFSMState(); /** - * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.Phase#getEvent Event}'. + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getEvent Event}'. * * * @return the meta object for the containment reference 'Event'. - * @see fr.inria.diverse.event.commons.model.scenario.Phase#getEvent() - * @see #getPhase() + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getEvent() + * @see #getScenarioFSMState() * @generated */ - EReference getPhase_Event(); + EReference getScenarioFSMState_Event(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getOutgoingTransitions Outgoing Transitions}'. + * + * + * @return the meta object for the reference list 'Outgoing Transitions'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getOutgoingTransitions() + * @see #getScenarioFSMState() + * @generated + */ + EReference getScenarioFSMState_OutgoingTransitions(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getIncomingTransitions Incoming Transitions}'. + * + * + * @return the meta object for the reference list 'Incoming Transitions'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getIncomingTransitions() + * @see #getScenarioFSMState() + * @generated + */ + EReference getScenarioFSMState_IncomingTransitions(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition FSM Transition}'. + * + * + * @return the meta object for class 'FSM Transition'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition + * @generated + */ + EClass getScenarioFSMTransition(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getGuard Guard}'. + * + * + * @return the meta object for the containment reference 'Guard'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getGuard() + * @see #getScenarioFSMTransition() + * @generated + */ + EReference getScenarioFSMTransition_Guard(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getSource Source}'. + * + * + * @return the meta object for the reference 'Source'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getSource() + * @see #getScenarioFSMTransition() + * @generated + */ + EReference getScenarioFSMTransition_Source(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getTarget() + * @see #getScenarioFSMTransition() + * @generated + */ + EReference getScenarioFSMTransition_Target(); /** * Returns the factory that creates the instances of the model. @@ -611,12 +867,12 @@ interface Literals { EClass SCENARIO = eINSTANCE.getScenario(); /** - * The meta object literal for the 'Phases' containment reference list feature. + * The meta object literal for the 'Elements' containment reference list feature. * * * @generated */ - EReference SCENARIO__PHASES = eINSTANCE.getScenario_Phases(); + EReference SCENARIO__ELEMENTS = eINSTANCE.getScenario_Elements(); /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.EventImpl Event}' class. @@ -636,24 +892,6 @@ interface Literals { */ EReference EVENT__TARGET_PROVIDER = eINSTANCE.getEvent_TargetProvider(); - /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl Stage}' class. - * - * - * @see fr.inria.diverse.event.commons.model.scenario.impl.StageImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getStage() - * @generated - */ - EClass STAGE = eINSTANCE.getStage(); - - /** - * The meta object literal for the 'Property' containment reference feature. - * - * - * @generated - */ - EReference STAGE__PROPERTY = eINSTANCE.getStage_Property(); - /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ElementProviderImpl Element Provider}' class. * @@ -701,50 +939,108 @@ interface Literals { EReference ELEMENT_QUERY__QUERY = eINSTANCE.getElementQuery_Query(); /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl Test Suite}' class. + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.EventOccurrenceImpl Event Occurrence}' class. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getTestSuite() + * @see fr.inria.diverse.event.commons.model.scenario.impl.EventOccurrenceImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getEventOccurrence() * @generated */ - EClass TEST_SUITE = eINSTANCE.getTestSuite(); + EClass EVENT_OCCURRENCE = eINSTANCE.getEventOccurrence(); /** - * The meta object literal for the 'Tests' containment reference list feature. + * The meta object literal for the 'Event' containment reference feature. * * * @generated */ - EReference TEST_SUITE__TESTS = eINSTANCE.getTestSuite_Tests(); + EReference EVENT_OCCURRENCE__EVENT = eINSTANCE.getEventOccurrence_Event(); /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.DateImpl Date}' class. + * The meta object literal for the 'Time' attribute feature. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.DateImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getDate() * @generated */ - EClass DATE = eINSTANCE.getDate(); + EAttribute EVENT_OCCURRENCE__TIME = eINSTANCE.getEventOccurrence_Time(); /** - * The meta object literal for the 'Time' attribute feature. + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioElementImpl Element}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioElementImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenarioElement() + * @generated + */ + EClass SCENARIO_ELEMENT = eINSTANCE.getScenarioElement(); + + /** + * The meta object literal for the 'Next Elements' reference list feature. + * + * + * @generated + */ + EReference SCENARIO_ELEMENT__NEXT_ELEMENTS = eINSTANCE.getScenarioElement_NextElements(); + + /** + * The meta object literal for the 'Guard' containment reference feature. + * + * + * @generated + */ + EReference SCENARIO_ELEMENT__GUARD = eINSTANCE.getScenarioElement_Guard(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl FSM}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenarioFSM() + * @generated + */ + EClass SCENARIO_FSM = eINSTANCE.getScenarioFSM(); + + /** + * The meta object literal for the 'States' containment reference list feature. + * + * + * @generated + */ + EReference SCENARIO_FSM__STATES = eINSTANCE.getScenarioFSM_States(); + + /** + * The meta object literal for the 'Initial State' reference feature. + * + * + * @generated + */ + EReference SCENARIO_FSM__INITIAL_STATE = eINSTANCE.getScenarioFSM_InitialState(); + + /** + * The meta object literal for the 'Accepting States' reference list feature. * * * @generated */ - EAttribute DATE__TIME = eINSTANCE.getDate_Time(); + EReference SCENARIO_FSM__ACCEPTING_STATES = eINSTANCE.getScenarioFSM_AcceptingStates(); /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl Phase}' class. + * The meta object literal for the 'Transitions' containment reference list feature. * * - * @see fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl - * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getPhase() * @generated */ - EClass PHASE = eINSTANCE.getPhase(); + EReference SCENARIO_FSM__TRANSITIONS = eINSTANCE.getScenarioFSM_Transitions(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl FSM State}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenarioFSMState() + * @generated + */ + EClass SCENARIO_FSM_STATE = eINSTANCE.getScenarioFSMState(); /** * The meta object literal for the 'Event' containment reference feature. @@ -752,7 +1048,57 @@ interface Literals { * * @generated */ - EReference PHASE__EVENT = eINSTANCE.getPhase_Event(); + EReference SCENARIO_FSM_STATE__EVENT = eINSTANCE.getScenarioFSMState_Event(); + + /** + * The meta object literal for the 'Outgoing Transitions' reference list feature. + * + * + * @generated + */ + EReference SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS = eINSTANCE.getScenarioFSMState_OutgoingTransitions(); + + /** + * The meta object literal for the 'Incoming Transitions' reference list feature. + * + * + * @generated + */ + EReference SCENARIO_FSM_STATE__INCOMING_TRANSITIONS = eINSTANCE.getScenarioFSMState_IncomingTransitions(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl FSM Transition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getScenarioFSMTransition() + * @generated + */ + EClass SCENARIO_FSM_TRANSITION = eINSTANCE.getScenarioFSMTransition(); + + /** + * The meta object literal for the 'Guard' containment reference feature. + * + * + * @generated + */ + EReference SCENARIO_FSM_TRANSITION__GUARD = eINSTANCE.getScenarioFSMTransition_Guard(); + + /** + * The meta object literal for the 'Source' reference feature. + * + * + * @generated + */ + EReference SCENARIO_FSM_TRANSITION__SOURCE = eINSTANCE.getScenarioFSMTransition_Source(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference SCENARIO_FSM_TRANSITION__TARGET = eINSTANCE.getScenarioFSMTransition_Target(); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java deleted file mode 100644 index f023f4b76..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Stage.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.scenario; - -import fr.inria.diverse.event.commons.model.property.StateProperty; - -/** - * - * A representation of the model object 'Stage'. - * - * - *

    - * The following features are supported: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.Stage#getProperty Property}
    • - *
    - * - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getStage() - * @model abstract="true" - * @generated - */ -public interface Stage, P extends StateProperty> extends Phase { - /** - * Returns the value of the 'Property' containment reference. - * - *

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

    - * - * @return the value of the 'Property' containment reference. - * @see #setProperty(StateProperty) - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getStage_Property() - * @model containment="true" - * @generated - */ - P getProperty(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Stage#getProperty Property}' containment reference. - * - * - * @param value the new value of the 'Property' containment reference. - * @see #getProperty() - * @generated - */ - void setProperty(P value); - -} // Stage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TestSuite.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TestSuite.java deleted file mode 100644 index da2a0af41..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TestSuite.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.scenario; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Test Suite'. - * - * - *

    - * The following features are supported: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.TestSuite#getTests Tests}
    • - *
    - * - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getTestSuite() - * @model abstract="true" - * @generated - */ -public interface TestSuite> extends EObject { - /** - * Returns the value of the 'Tests' containment reference list. - * - *

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

    - * - * @return the value of the 'Tests' containment reference list. - * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getTestSuite_Tests() - * @model containment="true" - * @generated - */ - EList getTests(); - -} // TestSuite diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/DateImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/DateImpl.java deleted file mode 100644 index 8d48bde69..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/DateImpl.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.scenario.impl; - -import fr.inria.diverse.event.commons.model.scenario.Date; -import fr.inria.diverse.event.commons.model.scenario.Event; -import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * - * An implementation of the model object 'Date'. - * - *

    - * The following features are implemented: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.DateImpl#getTime Time}
    • - *
    - * - * @generated - */ -public abstract class DateImpl> extends PhaseImpl implements Date { - /** - * The default value of the '{@link #getTime() Time}' attribute. - * - * - * @see #getTime() - * @generated - * @ordered - */ - protected static final int TIME_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getTime() Time}' attribute. - * - * - * @see #getTime() - * @generated - * @ordered - */ - protected int time = TIME_EDEFAULT; - - /** - * - * - * @generated - */ - protected DateImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ScenarioPackage.Literals.DATE; - } - - /** - * - * - * @generated - */ - public int getTime() { - return time; - } - - /** - * - * - * @generated - */ - public void setTime(int newTime) { - int oldTime = time; - time = newTime; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.DATE__TIME, oldTime, time)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ScenarioPackage.DATE__TIME: - return getTime(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ScenarioPackage.DATE__TIME: - setTime((Integer)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ScenarioPackage.DATE__TIME: - setTime(TIME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ScenarioPackage.DATE__TIME: - return time != TIME_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (time: "); - result.append(time); - result.append(')'); - return result.toString(); - } - -} //DateImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/PhaseImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventOccurrenceImpl.java similarity index 56% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/PhaseImpl.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventOccurrenceImpl.java index 6574ef12f..476bd1e6a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/PhaseImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventOccurrenceImpl.java @@ -2,8 +2,10 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; +import fr.inria.diverse.event.commons.model.property.StateProperty; + import fr.inria.diverse.event.commons.model.scenario.Event; -import fr.inria.diverse.event.commons.model.scenario.Phase; +import fr.inria.diverse.event.commons.model.scenario.EventOccurrence; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import org.eclipse.emf.common.notify.Notification; @@ -13,22 +15,22 @@ import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; /** * - * An implementation of the model object 'Phase'. + * An implementation of the model object 'Event Occurrence'. * *

    * The following features are implemented: *

    *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.PhaseImpl#getEvent Event}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.EventOccurrenceImpl#getEvent Event}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.EventOccurrenceImpl#getTime Time}
    • *
    * * @generated */ -public abstract class PhaseImpl> extends MinimalEObjectImpl.Container implements Phase { +public abstract class EventOccurrenceImpl, P extends StateProperty> extends ScenarioElementImpl

    implements EventOccurrence { /** * The cached value of the '{@link #getEvent() Event}' containment reference. * @@ -39,12 +41,32 @@ public abstract class PhaseImpl> extends MinimalEObjectImpl.C */ protected E event; + /** + * The default value of the '{@link #getTime() Time}' attribute. + * + * + * @see #getTime() + * @generated + * @ordered + */ + protected static final int TIME_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getTime() Time}' attribute. + * + * + * @see #getTime() + * @generated + * @ordered + */ + protected int time = TIME_EDEFAULT; + /** * * * @generated */ - protected PhaseImpl() { + protected EventOccurrenceImpl() { super(); } @@ -55,7 +77,7 @@ protected PhaseImpl() { */ @Override protected EClass eStaticClass() { - return ScenarioPackage.Literals.PHASE; + return ScenarioPackage.Literals.EVENT_OCCURRENCE; } /** @@ -76,7 +98,7 @@ public NotificationChain basicSetEvent(E newEvent, NotificationChain msgs) { E oldEvent = event; event = newEvent; if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.PHASE__EVENT, oldEvent, newEvent); + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.EVENT_OCCURRENCE__EVENT, oldEvent, newEvent); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; @@ -91,14 +113,35 @@ public void setEvent(E newEvent) { if (newEvent != event) { NotificationChain msgs = null; if (event != null) - msgs = ((InternalEObject)event).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.PHASE__EVENT, null, msgs); + msgs = ((InternalEObject)event).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.EVENT_OCCURRENCE__EVENT, null, msgs); if (newEvent != null) - msgs = ((InternalEObject)newEvent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.PHASE__EVENT, null, msgs); + msgs = ((InternalEObject)newEvent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.EVENT_OCCURRENCE__EVENT, null, msgs); msgs = basicSetEvent(newEvent, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.PHASE__EVENT, newEvent, newEvent)); + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.EVENT_OCCURRENCE__EVENT, newEvent, newEvent)); + } + + /** + * + * + * @generated + */ + public int getTime() { + return time; + } + + /** + * + * + * @generated + */ + public void setTime(int newTime) { + int oldTime = time; + time = newTime; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.EVENT_OCCURRENCE__TIME, oldTime, time)); } /** @@ -109,7 +152,7 @@ else if (eNotificationRequired()) @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case ScenarioPackage.PHASE__EVENT: + case ScenarioPackage.EVENT_OCCURRENCE__EVENT: return basicSetEvent(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); @@ -123,8 +166,10 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case ScenarioPackage.PHASE__EVENT: + case ScenarioPackage.EVENT_OCCURRENCE__EVENT: return getEvent(); + case ScenarioPackage.EVENT_OCCURRENCE__TIME: + return getTime(); } return super.eGet(featureID, resolve, coreType); } @@ -138,9 +183,12 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case ScenarioPackage.PHASE__EVENT: + case ScenarioPackage.EVENT_OCCURRENCE__EVENT: setEvent((E)newValue); return; + case ScenarioPackage.EVENT_OCCURRENCE__TIME: + setTime((Integer)newValue); + return; } super.eSet(featureID, newValue); } @@ -153,9 +201,12 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case ScenarioPackage.PHASE__EVENT: + case ScenarioPackage.EVENT_OCCURRENCE__EVENT: setEvent((E)null); return; + case ScenarioPackage.EVENT_OCCURRENCE__TIME: + setTime(TIME_EDEFAULT); + return; } super.eUnset(featureID); } @@ -168,10 +219,28 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case ScenarioPackage.PHASE__EVENT: + case ScenarioPackage.EVENT_OCCURRENCE__EVENT: return event != null; + case ScenarioPackage.EVENT_OCCURRENCE__TIME: + return time != TIME_EDEFAULT; } return super.eIsSet(featureID); } -} //PhaseImpl + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (time: "); + result.append(time); + result.append(')'); + return result.toString(); + } + +} //EventOccurrenceImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java new file mode 100644 index 000000000..2f57e1545 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java @@ -0,0 +1,218 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.property.StateProperty; + +import fr.inria.diverse.event.commons.model.scenario.ScenarioElement; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'Element'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioElementImpl#getNextElements Next Elements}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioElementImpl#getGuard Guard}
    • + *
    + * + * @generated + */ +public abstract class ScenarioElementImpl

    > extends MinimalEObjectImpl.Container implements ScenarioElement

    { + /** + * The cached value of the '{@link #getNextElements() Next Elements}' reference list. + * + * + * @see #getNextElements() + * @generated + * @ordered + */ + protected EList> nextElements; + + /** + * The cached value of the '{@link #getGuard() Guard}' containment reference. + * + * + * @see #getGuard() + * @generated + * @ordered + */ + protected P guard; + + /** + * + * + * @generated + */ + protected ScenarioElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.SCENARIO_ELEMENT; + } + + /** + * + * + * @generated + */ + public EList> getNextElements() { + if (nextElements == null) { + nextElements = new EObjectResolvingEList>(ScenarioElement.class, this, ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS); + } + return nextElements; + } + + /** + * + * + * @generated + */ + public P getGuard() { + return guard; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGuard(P newGuard, NotificationChain msgs) { + P oldGuard = guard; + guard = newGuard; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_ELEMENT__GUARD, oldGuard, newGuard); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setGuard(P newGuard) { + if (newGuard != guard) { + NotificationChain msgs = null; + if (guard != null) + msgs = ((InternalEObject)guard).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.SCENARIO_ELEMENT__GUARD, null, msgs); + if (newGuard != null) + msgs = ((InternalEObject)newGuard).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.SCENARIO_ELEMENT__GUARD, null, msgs); + msgs = basicSetGuard(newGuard, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_ELEMENT__GUARD, newGuard, newGuard)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__GUARD: + return basicSetGuard(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: + return getNextElements(); + case ScenarioPackage.SCENARIO_ELEMENT__GUARD: + return getGuard(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: + getNextElements().clear(); + getNextElements().addAll((Collection>)newValue); + return; + case ScenarioPackage.SCENARIO_ELEMENT__GUARD: + setGuard((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: + getNextElements().clear(); + return; + case ScenarioPackage.SCENARIO_ELEMENT__GUARD: + setGuard((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: + return nextElements != null && !nextElements.isEmpty(); + case ScenarioPackage.SCENARIO_ELEMENT__GUARD: + return guard != null; + } + return super.eIsSet(featureID); + } + +} //ScenarioElementImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMImpl.java new file mode 100644 index 000000000..512f29e61 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMImpl.java @@ -0,0 +1,288 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.property.StateProperty; + +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSM; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'FSM'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl#getStates States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl#getInitialState Initial State}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl#getAcceptingStates Accepting States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl#getTransitions Transitions}
    • + *
    + * + * @generated + */ +public abstract class ScenarioFSMImpl

    , E extends Event, S extends ScenarioFSMState, T extends ScenarioFSMTransition> extends ScenarioElementImpl

    implements ScenarioFSM { + /** + * The cached value of the '{@link #getStates() States}' containment reference list. + * + * + * @see #getStates() + * @generated + * @ordered + */ + protected EList states; + + /** + * The cached value of the '{@link #getInitialState() Initial State}' reference. + * + * + * @see #getInitialState() + * @generated + * @ordered + */ + protected S initialState; + + /** + * The cached value of the '{@link #getAcceptingStates() Accepting States}' reference list. + * + * + * @see #getAcceptingStates() + * @generated + * @ordered + */ + protected EList acceptingStates; + + /** + * The cached value of the '{@link #getTransitions() Transitions}' containment reference list. + * + * + * @see #getTransitions() + * @generated + * @ordered + */ + protected EList transitions; + + /** + * + * + * @generated + */ + protected ScenarioFSMImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.SCENARIO_FSM; + } + + /** + * + * + * @generated + */ + public EList getStates() { + if (states == null) { + states = new EObjectContainmentEList(ScenarioFSMState.class, this, ScenarioPackage.SCENARIO_FSM__STATES); + } + return states; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public S getInitialState() { + if (initialState != null && initialState.eIsProxy()) { + InternalEObject oldInitialState = (InternalEObject)initialState; + initialState = (S)eResolveProxy(oldInitialState); + if (initialState != oldInitialState) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScenarioPackage.SCENARIO_FSM__INITIAL_STATE, oldInitialState, initialState)); + } + } + return initialState; + } + + /** + * + * + * @generated + */ + public S basicGetInitialState() { + return initialState; + } + + /** + * + * + * @generated + */ + public void setInitialState(S newInitialState) { + S oldInitialState = initialState; + initialState = newInitialState; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM__INITIAL_STATE, oldInitialState, initialState)); + } + + /** + * + * + * @generated + */ + public EList getAcceptingStates() { + if (acceptingStates == null) { + acceptingStates = new EObjectResolvingEList(ScenarioFSMState.class, this, ScenarioPackage.SCENARIO_FSM__ACCEPTING_STATES); + } + return acceptingStates; + } + + /** + * + * + * @generated + */ + public EList getTransitions() { + if (transitions == null) { + transitions = new EObjectContainmentEList(ScenarioFSMTransition.class, this, ScenarioPackage.SCENARIO_FSM__TRANSITIONS); + } + return transitions; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM__STATES: + return ((InternalEList)getStates()).basicRemove(otherEnd, msgs); + case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: + return ((InternalEList)getTransitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM__STATES: + return getStates(); + case ScenarioPackage.SCENARIO_FSM__INITIAL_STATE: + if (resolve) return getInitialState(); + return basicGetInitialState(); + case ScenarioPackage.SCENARIO_FSM__ACCEPTING_STATES: + return getAcceptingStates(); + case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: + return getTransitions(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM__STATES: + getStates().clear(); + getStates().addAll((Collection)newValue); + return; + case ScenarioPackage.SCENARIO_FSM__INITIAL_STATE: + setInitialState((S)newValue); + return; + case ScenarioPackage.SCENARIO_FSM__ACCEPTING_STATES: + getAcceptingStates().clear(); + getAcceptingStates().addAll((Collection)newValue); + return; + case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: + getTransitions().clear(); + getTransitions().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM__STATES: + getStates().clear(); + return; + case ScenarioPackage.SCENARIO_FSM__INITIAL_STATE: + setInitialState((S)null); + return; + case ScenarioPackage.SCENARIO_FSM__ACCEPTING_STATES: + getAcceptingStates().clear(); + return; + case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: + getTransitions().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM__STATES: + return states != null && !states.isEmpty(); + case ScenarioPackage.SCENARIO_FSM__INITIAL_STATE: + return initialState != null; + case ScenarioPackage.SCENARIO_FSM__ACCEPTING_STATES: + return acceptingStates != null && !acceptingStates.isEmpty(); + case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: + return transitions != null && !transitions.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ScenarioFSMImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java new file mode 100644 index 000000000..4146f2da3 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java @@ -0,0 +1,273 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'FSM State'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl#getEvent Event}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl#getOutgoingTransitions Outgoing Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl#getIncomingTransitions Incoming Transitions}
    • + *
    + * + * @generated + */ +public abstract class ScenarioFSMStateImpl, T extends ScenarioFSMTransition> extends MinimalEObjectImpl.Container implements ScenarioFSMState { + /** + * The cached value of the '{@link #getEvent() Event}' containment reference. + * + * + * @see #getEvent() + * @generated + * @ordered + */ + protected E event; + + /** + * The cached value of the '{@link #getOutgoingTransitions() Outgoing Transitions}' reference list. + * + * + * @see #getOutgoingTransitions() + * @generated + * @ordered + */ + protected EList outgoingTransitions; + + /** + * The cached value of the '{@link #getIncomingTransitions() Incoming Transitions}' reference list. + * + * + * @see #getIncomingTransitions() + * @generated + * @ordered + */ + protected EList incomingTransitions; + + /** + * + * + * @generated + */ + protected ScenarioFSMStateImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.SCENARIO_FSM_STATE; + } + + /** + * + * + * @generated + */ + public E getEvent() { + return event; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEvent(E newEvent, NotificationChain msgs) { + E oldEvent = event; + event = newEvent; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_STATE__EVENT, oldEvent, newEvent); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setEvent(E newEvent) { + if (newEvent != event) { + NotificationChain msgs = null; + if (event != null) + msgs = ((InternalEObject)event).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.SCENARIO_FSM_STATE__EVENT, null, msgs); + if (newEvent != null) + msgs = ((InternalEObject)newEvent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.SCENARIO_FSM_STATE__EVENT, null, msgs); + msgs = basicSetEvent(newEvent, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_STATE__EVENT, newEvent, newEvent)); + } + + /** + * + * + * @generated + */ + public EList getOutgoingTransitions() { + if (outgoingTransitions == null) { + outgoingTransitions = new EObjectWithInverseResolvingEList(ScenarioFSMTransition.class, this, ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS, ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE); + } + return outgoingTransitions; + } + + /** + * + * + * @generated + */ + public EList getIncomingTransitions() { + if (incomingTransitions == null) { + incomingTransitions = new EObjectWithInverseResolvingEList(ScenarioFSMTransition.class, this, ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS, ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET); + } + return incomingTransitions; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS: + return ((InternalEList)(InternalEList)getOutgoingTransitions()).basicAdd(otherEnd, msgs); + case ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS: + return ((InternalEList)(InternalEList)getIncomingTransitions()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_STATE__EVENT: + return basicSetEvent(null, msgs); + case ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS: + return ((InternalEList)getOutgoingTransitions()).basicRemove(otherEnd, msgs); + case ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS: + return ((InternalEList)getIncomingTransitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_STATE__EVENT: + return getEvent(); + case ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS: + return getOutgoingTransitions(); + case ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS: + return getIncomingTransitions(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_STATE__EVENT: + setEvent((E)newValue); + return; + case ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS: + getOutgoingTransitions().clear(); + getOutgoingTransitions().addAll((Collection)newValue); + return; + case ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS: + getIncomingTransitions().clear(); + getIncomingTransitions().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_STATE__EVENT: + setEvent((E)null); + return; + case ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS: + getOutgoingTransitions().clear(); + return; + case ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS: + getIncomingTransitions().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_STATE__EVENT: + return event != null; + case ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS: + return outgoingTransitions != null && !outgoingTransitions.isEmpty(); + case ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS: + return incomingTransitions != null && !incomingTransitions.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ScenarioFSMStateImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMTransitionImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMTransitionImpl.java new file mode 100644 index 000000000..89d853c76 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMTransitionImpl.java @@ -0,0 +1,368 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.impl; + +import fr.inria.diverse.event.commons.model.property.StateProperty; + +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +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.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'FSM Transition'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl#getGuard Guard}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl#getSource Source}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl#getTarget Target}
    • + *
    + * + * @generated + */ +public abstract class ScenarioFSMTransitionImpl

    , S extends ScenarioFSMState> extends MinimalEObjectImpl.Container implements ScenarioFSMTransition { + /** + * The cached value of the '{@link #getGuard() Guard}' containment reference. + * + * + * @see #getGuard() + * @generated + * @ordered + */ + protected P guard; + + /** + * The cached value of the '{@link #getSource() Source}' reference. + * + * + * @see #getSource() + * @generated + * @ordered + */ + protected S source; + + /** + * The cached value of the '{@link #getTarget() Target}' reference. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected S target; + + /** + * + * + * @generated + */ + protected ScenarioFSMTransitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION; + } + + /** + * + * + * @generated + */ + public P getGuard() { + return guard; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGuard(P newGuard, NotificationChain msgs) { + P oldGuard = guard; + guard = newGuard; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD, oldGuard, newGuard); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setGuard(P newGuard) { + if (newGuard != guard) { + NotificationChain msgs = null; + if (guard != null) + msgs = ((InternalEObject)guard).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD, null, msgs); + if (newGuard != null) + msgs = ((InternalEObject)newGuard).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD, null, msgs); + msgs = basicSetGuard(newGuard, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD, newGuard, newGuard)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public S getSource() { + if (source != null && source.eIsProxy()) { + InternalEObject oldSource = (InternalEObject)source; + source = (S)eResolveProxy(oldSource); + if (source != oldSource) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE, oldSource, source)); + } + } + return source; + } + + /** + * + * + * @generated + */ + public S basicGetSource() { + return source; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSource(S newSource, NotificationChain msgs) { + S oldSource = source; + source = newSource; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE, oldSource, newSource); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setSource(S newSource) { + if (newSource != source) { + NotificationChain msgs = null; + if (source != null) + msgs = ((InternalEObject)source).eInverseRemove(this, ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS, ScenarioFSMState.class, msgs); + if (newSource != null) + msgs = ((InternalEObject)newSource).eInverseAdd(this, ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS, ScenarioFSMState.class, msgs); + msgs = basicSetSource(newSource, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE, newSource, newSource)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public S getTarget() { + if (target != null && target.eIsProxy()) { + InternalEObject oldTarget = (InternalEObject)target; + target = (S)eResolveProxy(oldTarget); + if (target != oldTarget) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET, oldTarget, target)); + } + } + return target; + } + + /** + * + * + * @generated + */ + public S basicGetTarget() { + return target; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTarget(S newTarget, NotificationChain msgs) { + S oldTarget = target; + target = newTarget; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET, oldTarget, newTarget); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setTarget(S newTarget) { + if (newTarget != target) { + NotificationChain msgs = null; + if (target != null) + msgs = ((InternalEObject)target).eInverseRemove(this, ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS, ScenarioFSMState.class, msgs); + if (newTarget != null) + msgs = ((InternalEObject)newTarget).eInverseAdd(this, ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS, ScenarioFSMState.class, msgs); + msgs = basicSetTarget(newTarget, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET, newTarget, newTarget)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE: + if (source != null) + msgs = ((InternalEObject)source).eInverseRemove(this, ScenarioPackage.SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS, ScenarioFSMState.class, msgs); + return basicSetSource((S)otherEnd, msgs); + case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: + if (target != null) + msgs = ((InternalEObject)target).eInverseRemove(this, ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS, ScenarioFSMState.class, msgs); + return basicSetTarget((S)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD: + return basicSetGuard(null, msgs); + case ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE: + return basicSetSource(null, msgs); + case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: + return basicSetTarget(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD: + return getGuard(); + case ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE: + if (resolve) return getSource(); + return basicGetSource(); + case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: + if (resolve) return getTarget(); + return basicGetTarget(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD: + setGuard((P)newValue); + return; + case ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE: + setSource((S)newValue); + return; + case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: + setTarget((S)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD: + setGuard((P)null); + return; + case ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE: + setSource((S)null); + return; + case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: + setTarget((S)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD: + return guard != null; + case ScenarioPackage.SCENARIO_FSM_TRANSITION__SOURCE: + return source != null; + case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: + return target != null; + } + return super.eIsSet(featureID); + } + +} //ScenarioFSMTransitionImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java index 1e1cc99eb..174cc538e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioImpl.java @@ -2,8 +2,8 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; -import fr.inria.diverse.event.commons.model.scenario.Phase; import fr.inria.diverse.event.commons.model.scenario.Scenario; +import fr.inria.diverse.event.commons.model.scenario.ScenarioElement; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import java.util.Collection; @@ -28,21 +28,21 @@ * The following features are implemented: *

    *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioImpl#getPhases Phases}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioImpl#getElements Elements}
    • *
    * * @generated */ -public abstract class ScenarioImpl

    > extends MinimalEObjectImpl.Container implements Scenario

    { +public abstract class ScenarioImpl> extends MinimalEObjectImpl.Container implements Scenario { /** - * The cached value of the '{@link #getPhases() Phases}' containment reference list. + * The cached value of the '{@link #getElements() Elements}' containment reference list. * * - * @see #getPhases() + * @see #getElements() * @generated * @ordered */ - protected EList

    phases; + protected EList elements; /** * @@ -68,11 +68,11 @@ protected EClass eStaticClass() { * * @generated */ - public EList

    getPhases() { - if (phases == null) { - phases = new EObjectContainmentEList

    (Phase.class, this, ScenarioPackage.SCENARIO__PHASES); + public EList getElements() { + if (elements == null) { + elements = new EObjectContainmentEList(ScenarioElement.class, this, ScenarioPackage.SCENARIO__ELEMENTS); } - return phases; + return elements; } /** @@ -83,8 +83,8 @@ public EList

    getPhases() { @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case ScenarioPackage.SCENARIO__PHASES: - return ((InternalEList)getPhases()).basicRemove(otherEnd, msgs); + case ScenarioPackage.SCENARIO__ELEMENTS: + return ((InternalEList)getElements()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -97,8 +97,8 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case ScenarioPackage.SCENARIO__PHASES: - return getPhases(); + case ScenarioPackage.SCENARIO__ELEMENTS: + return getElements(); } return super.eGet(featureID, resolve, coreType); } @@ -112,9 +112,9 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case ScenarioPackage.SCENARIO__PHASES: - getPhases().clear(); - getPhases().addAll((Collection)newValue); + case ScenarioPackage.SCENARIO__ELEMENTS: + getElements().clear(); + getElements().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); @@ -128,8 +128,8 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case ScenarioPackage.SCENARIO__PHASES: - getPhases().clear(); + case ScenarioPackage.SCENARIO__ELEMENTS: + getElements().clear(); return; } super.eUnset(featureID); @@ -143,8 +143,8 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case ScenarioPackage.SCENARIO__PHASES: - return phases != null && !phases.isEmpty(); + case ScenarioPackage.SCENARIO__ELEMENTS: + return elements != null && !elements.isEmpty(); } return super.eIsSet(featureID); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java index e44e9999e..4303f1a06 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java @@ -4,17 +4,18 @@ import fr.inria.diverse.event.commons.model.property.PropertyPackage; -import fr.inria.diverse.event.commons.model.scenario.Date; import fr.inria.diverse.event.commons.model.scenario.ElementProvider; import fr.inria.diverse.event.commons.model.scenario.ElementQuery; import fr.inria.diverse.event.commons.model.scenario.ElementReference; import fr.inria.diverse.event.commons.model.scenario.Event; -import fr.inria.diverse.event.commons.model.scenario.Phase; +import fr.inria.diverse.event.commons.model.scenario.EventOccurrence; import fr.inria.diverse.event.commons.model.scenario.Scenario; +import fr.inria.diverse.event.commons.model.scenario.ScenarioElement; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSM; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition; import fr.inria.diverse.event.commons.model.scenario.ScenarioFactory; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; -import fr.inria.diverse.event.commons.model.scenario.Stage; -import fr.inria.diverse.event.commons.model.scenario.TestSuite; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; @@ -51,49 +52,56 @@ public class ScenarioPackageImpl extends EPackageImpl implements ScenarioPackage * * @generated */ - private EClass stageEClass = null; + private EClass elementProviderEClass = null; /** * * * @generated */ - private EClass elementProviderEClass = null; + private EClass elementReferenceEClass = null; /** * * * @generated */ - private EClass elementReferenceEClass = null; + private EClass elementQueryEClass = null; /** * * * @generated */ - private EClass elementQueryEClass = null; + private EClass eventOccurrenceEClass = null; + + /** + * + * + * @generated + */ + private EClass scenarioElementEClass = null; /** * * * @generated */ - private EClass testSuiteEClass = null; + private EClass scenarioFSMEClass = null; /** * * * @generated */ - private EClass dateEClass = null; + private EClass scenarioFSMStateEClass = null; /** * * * @generated */ - private EClass phaseEClass = null; + private EClass scenarioFSMTransitionEClass = null; /** * Creates an instance of the model Package, registered with @@ -173,7 +181,7 @@ public EClass getScenario() { * * @generated */ - public EReference getScenario_Phases() { + public EReference getScenario_Elements() { return (EReference)scenarioEClass.getEStructuralFeatures().get(0); } @@ -200,8 +208,8 @@ public EReference getEvent_TargetProvider() { * * @generated */ - public EClass getStage() { - return stageEClass; + public EClass getElementProvider() { + return elementProviderEClass; } /** @@ -209,8 +217,8 @@ public EClass getStage() { * * @generated */ - public EReference getStage_Property() { - return (EReference)stageEClass.getEStructuralFeatures().get(0); + public EClass getElementReference() { + return elementReferenceEClass; } /** @@ -218,8 +226,8 @@ public EReference getStage_Property() { * * @generated */ - public EClass getElementProvider() { - return elementProviderEClass; + public EReference getElementReference_Element() { + return (EReference)elementReferenceEClass.getEStructuralFeatures().get(0); } /** @@ -227,8 +235,8 @@ public EClass getElementProvider() { * * @generated */ - public EClass getElementReference() { - return elementReferenceEClass; + public EClass getElementQuery() { + return elementQueryEClass; } /** @@ -236,8 +244,8 @@ public EClass getElementReference() { * * @generated */ - public EReference getElementReference_Element() { - return (EReference)elementReferenceEClass.getEStructuralFeatures().get(0); + public EReference getElementQuery_Query() { + return (EReference)elementQueryEClass.getEStructuralFeatures().get(0); } /** @@ -245,8 +253,8 @@ public EReference getElementReference_Element() { * * @generated */ - public EClass getElementQuery() { - return elementQueryEClass; + public EClass getEventOccurrence() { + return eventOccurrenceEClass; } /** @@ -254,8 +262,107 @@ public EClass getElementQuery() { * * @generated */ - public EReference getElementQuery_Query() { - return (EReference)elementQueryEClass.getEStructuralFeatures().get(0); + public EReference getEventOccurrence_Event() { + return (EReference)eventOccurrenceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getEventOccurrence_Time() { + return (EAttribute)eventOccurrenceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getScenarioElement() { + return scenarioElementEClass; + } + + /** + * + * + * @generated + */ + public EReference getScenarioElement_NextElements() { + return (EReference)scenarioElementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getScenarioElement_Guard() { + return (EReference)scenarioElementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getScenarioFSM() { + return scenarioFSMEClass; + } + + /** + * + * + * @generated + */ + public EReference getScenarioFSM_States() { + return (EReference)scenarioFSMEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getScenarioFSM_InitialState() { + return (EReference)scenarioFSMEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getScenarioFSM_AcceptingStates() { + return (EReference)scenarioFSMEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EReference getScenarioFSM_Transitions() { + return (EReference)scenarioFSMEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + public EClass getScenarioFSMState() { + return scenarioFSMStateEClass; + } + + /** + * + * + * @generated + */ + public EReference getScenarioFSMState_Event() { + return (EReference)scenarioFSMStateEClass.getEStructuralFeatures().get(0); } /** @@ -263,8 +370,8 @@ public EReference getElementQuery_Query() { * * @generated */ - public EClass getTestSuite() { - return testSuiteEClass; + public EReference getScenarioFSMState_OutgoingTransitions() { + return (EReference)scenarioFSMStateEClass.getEStructuralFeatures().get(1); } /** @@ -272,8 +379,8 @@ public EClass getTestSuite() { * * @generated */ - public EReference getTestSuite_Tests() { - return (EReference)testSuiteEClass.getEStructuralFeatures().get(0); + public EReference getScenarioFSMState_IncomingTransitions() { + return (EReference)scenarioFSMStateEClass.getEStructuralFeatures().get(2); } /** @@ -281,8 +388,8 @@ public EReference getTestSuite_Tests() { * * @generated */ - public EClass getDate() { - return dateEClass; + public EClass getScenarioFSMTransition() { + return scenarioFSMTransitionEClass; } /** @@ -290,8 +397,8 @@ public EClass getDate() { * * @generated */ - public EAttribute getDate_Time() { - return (EAttribute)dateEClass.getEStructuralFeatures().get(0); + public EReference getScenarioFSMTransition_Guard() { + return (EReference)scenarioFSMTransitionEClass.getEStructuralFeatures().get(0); } /** @@ -299,8 +406,8 @@ public EAttribute getDate_Time() { * * @generated */ - public EClass getPhase() { - return phaseEClass; + public EReference getScenarioFSMTransition_Source() { + return (EReference)scenarioFSMTransitionEClass.getEStructuralFeatures().get(1); } /** @@ -308,8 +415,8 @@ public EClass getPhase() { * * @generated */ - public EReference getPhase_Event() { - return (EReference)phaseEClass.getEStructuralFeatures().get(0); + public EReference getScenarioFSMTransition_Target() { + return (EReference)scenarioFSMTransitionEClass.getEStructuralFeatures().get(2); } /** @@ -341,14 +448,11 @@ public void createPackageContents() { // Create classes and their features scenarioEClass = createEClass(SCENARIO); - createEReference(scenarioEClass, SCENARIO__PHASES); + createEReference(scenarioEClass, SCENARIO__ELEMENTS); eventEClass = createEClass(EVENT); createEReference(eventEClass, EVENT__TARGET_PROVIDER); - stageEClass = createEClass(STAGE); - createEReference(stageEClass, STAGE__PROPERTY); - elementProviderEClass = createEClass(ELEMENT_PROVIDER); elementReferenceEClass = createEClass(ELEMENT_REFERENCE); @@ -357,14 +461,29 @@ public void createPackageContents() { elementQueryEClass = createEClass(ELEMENT_QUERY); createEReference(elementQueryEClass, ELEMENT_QUERY__QUERY); - testSuiteEClass = createEClass(TEST_SUITE); - createEReference(testSuiteEClass, TEST_SUITE__TESTS); - - dateEClass = createEClass(DATE); - createEAttribute(dateEClass, DATE__TIME); - - phaseEClass = createEClass(PHASE); - createEReference(phaseEClass, PHASE__EVENT); + eventOccurrenceEClass = createEClass(EVENT_OCCURRENCE); + createEReference(eventOccurrenceEClass, EVENT_OCCURRENCE__EVENT); + createEAttribute(eventOccurrenceEClass, EVENT_OCCURRENCE__TIME); + + scenarioElementEClass = createEClass(SCENARIO_ELEMENT); + createEReference(scenarioElementEClass, SCENARIO_ELEMENT__NEXT_ELEMENTS); + createEReference(scenarioElementEClass, SCENARIO_ELEMENT__GUARD); + + scenarioFSMEClass = createEClass(SCENARIO_FSM); + createEReference(scenarioFSMEClass, SCENARIO_FSM__STATES); + createEReference(scenarioFSMEClass, SCENARIO_FSM__INITIAL_STATE); + createEReference(scenarioFSMEClass, SCENARIO_FSM__ACCEPTING_STATES); + createEReference(scenarioFSMEClass, SCENARIO_FSM__TRANSITIONS); + + scenarioFSMStateEClass = createEClass(SCENARIO_FSM_STATE); + createEReference(scenarioFSMStateEClass, SCENARIO_FSM_STATE__EVENT); + createEReference(scenarioFSMStateEClass, SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS); + createEReference(scenarioFSMStateEClass, SCENARIO_FSM_STATE__INCOMING_TRANSITIONS); + + scenarioFSMTransitionEClass = createEClass(SCENARIO_FSM_TRANSITION); + createEReference(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__GUARD); + createEReference(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__SOURCE); + createEReference(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__TARGET); } /** @@ -394,53 +513,87 @@ public void initializePackageContents() { PropertyPackage thePropertyPackage = (PropertyPackage)EPackage.Registry.INSTANCE.getEPackage(PropertyPackage.eNS_URI); // Create type parameters - ETypeParameter scenarioEClass_P = addETypeParameter(scenarioEClass, "P"); + ETypeParameter scenarioEClass_T = addETypeParameter(scenarioEClass, "T"); ETypeParameter eventEClass_T = addETypeParameter(eventEClass, "T"); - ETypeParameter stageEClass_E = addETypeParameter(stageEClass, "E"); - ETypeParameter stageEClass_P = addETypeParameter(stageEClass, "P"); addETypeParameter(elementProviderEClass, "T"); ETypeParameter elementReferenceEClass_T = addETypeParameter(elementReferenceEClass, "T"); ETypeParameter elementQueryEClass_T = addETypeParameter(elementQueryEClass, "T"); ETypeParameter elementQueryEClass_P = addETypeParameter(elementQueryEClass, "P"); - ETypeParameter testSuiteEClass_T = addETypeParameter(testSuiteEClass, "T"); - ETypeParameter dateEClass_E = addETypeParameter(dateEClass, "E"); - ETypeParameter phaseEClass_E = addETypeParameter(phaseEClass, "E"); + ETypeParameter eventOccurrenceEClass_E = addETypeParameter(eventOccurrenceEClass, "E"); + ETypeParameter eventOccurrenceEClass_P = addETypeParameter(eventOccurrenceEClass, "P"); + ETypeParameter scenarioElementEClass_P = addETypeParameter(scenarioElementEClass, "P"); + ETypeParameter scenarioFSMEClass_P = addETypeParameter(scenarioFSMEClass, "P"); + ETypeParameter scenarioFSMEClass_E = addETypeParameter(scenarioFSMEClass, "E"); + ETypeParameter scenarioFSMEClass_S = addETypeParameter(scenarioFSMEClass, "S"); + ETypeParameter scenarioFSMEClass_T = addETypeParameter(scenarioFSMEClass, "T"); + ETypeParameter scenarioFSMStateEClass_E = addETypeParameter(scenarioFSMStateEClass, "E"); + ETypeParameter scenarioFSMStateEClass_T = addETypeParameter(scenarioFSMStateEClass, "T"); + ETypeParameter scenarioFSMTransitionEClass_P = addETypeParameter(scenarioFSMTransitionEClass, "P"); + ETypeParameter scenarioFSMTransitionEClass_S = addETypeParameter(scenarioFSMTransitionEClass, "S"); // Set bounds for type parameters - EGenericType g1 = createEGenericType(this.getPhase()); + EGenericType g1 = createEGenericType(this.getScenarioElement()); EGenericType g2 = createEGenericType(); g1.getETypeArguments().add(g2); - scenarioEClass_P.getEBounds().add(g1); + scenarioEClass_T.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getStateProperty()); + g2 = createEGenericType(elementQueryEClass_T); + g1.getETypeArguments().add(g2); + elementQueryEClass_P.getEBounds().add(g1); g1 = createEGenericType(this.getEvent()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); - stageEClass_E.getEBounds().add(g1); + eventOccurrenceEClass_E.getEBounds().add(g1); g1 = createEGenericType(thePropertyPackage.getStateProperty()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); - stageEClass_P.getEBounds().add(g1); + eventOccurrenceEClass_P.getEBounds().add(g1); g1 = createEGenericType(thePropertyPackage.getStateProperty()); - g2 = createEGenericType(elementQueryEClass_T); + g2 = createEGenericType(); g1.getETypeArguments().add(g2); - elementQueryEClass_P.getEBounds().add(g1); - g1 = createEGenericType(this.getScenario()); + scenarioElementEClass_P.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getStateProperty()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); - testSuiteEClass_T.getEBounds().add(g1); + scenarioFSMEClass_P.getEBounds().add(g1); g1 = createEGenericType(this.getEvent()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); - dateEClass_E.getEBounds().add(g1); + scenarioFSMEClass_E.getEBounds().add(g1); + g1 = createEGenericType(this.getScenarioFSMState()); + g2 = createEGenericType(scenarioFSMEClass_E); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(scenarioFSMEClass_T); + g1.getETypeArguments().add(g2); + scenarioFSMEClass_S.getEBounds().add(g1); + g1 = createEGenericType(this.getScenarioFSMTransition()); + g2 = createEGenericType(scenarioFSMEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(scenarioFSMEClass_S); + g1.getETypeArguments().add(g2); + scenarioFSMEClass_T.getEBounds().add(g1); g1 = createEGenericType(this.getEvent()); g2 = createEGenericType(); g1.getETypeArguments().add(g2); - phaseEClass_E.getEBounds().add(g1); + scenarioFSMStateEClass_E.getEBounds().add(g1); + g1 = createEGenericType(this.getScenarioFSMTransition()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + scenarioFSMStateEClass_T.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getStateProperty()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + scenarioFSMTransitionEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getScenarioFSMState()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + scenarioFSMTransitionEClass_S.getEBounds().add(g1); // Add supertypes to classes - g1 = createEGenericType(this.getPhase()); - g2 = createEGenericType(stageEClass_E); - g1.getETypeArguments().add(g2); - stageEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(this.getElementProvider()); g2 = createEGenericType(elementReferenceEClass_T); g1.getETypeArguments().add(g2); @@ -449,15 +602,19 @@ public void initializePackageContents() { g2 = createEGenericType(elementQueryEClass_T); g1.getETypeArguments().add(g2); elementQueryEClass.getEGenericSuperTypes().add(g1); - g1 = createEGenericType(this.getPhase()); - g2 = createEGenericType(dateEClass_E); + g1 = createEGenericType(this.getScenarioElement()); + g2 = createEGenericType(eventOccurrenceEClass_P); g1.getETypeArguments().add(g2); - dateEClass.getEGenericSuperTypes().add(g1); + eventOccurrenceEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getScenarioElement()); + g2 = createEGenericType(scenarioFSMEClass_P); + g1.getETypeArguments().add(g2); + scenarioFSMEClass.getEGenericSuperTypes().add(g1); // Initialize classes, features, and operations; add parameters initEClass(scenarioEClass, Scenario.class, "Scenario", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(scenarioEClass_P); - initEReference(getScenario_Phases(), g1, null, "phases", null, 0, -1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioEClass_T); + initEReference(getScenario_Elements(), g1, null, "elements", null, 0, -1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(eventEClass, Event.class, "Event", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(this.getElementProvider()); @@ -465,10 +622,6 @@ public void initializePackageContents() { g1.getETypeArguments().add(g2); initEReference(getEvent_TargetProvider(), g1, null, "targetProvider", null, 1, 1, Event.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(stageEClass, Stage.class, "Stage", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(stageEClass_P); - initEReference(getStage_Property(), g1, null, "property", null, 0, 1, Stage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(elementProviderEClass, ElementProvider.class, "ElementProvider", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(elementReferenceEClass, ElementReference.class, "ElementReference", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -479,16 +632,44 @@ public void initializePackageContents() { g1 = createEGenericType(elementQueryEClass_P); initEReference(getElementQuery_Query(), g1, null, "query", null, 0, 1, ElementQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(testSuiteEClass, TestSuite.class, "TestSuite", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(testSuiteEClass_T); - initEReference(getTestSuite_Tests(), g1, null, "tests", null, 0, -1, TestSuite.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(eventOccurrenceEClass, EventOccurrence.class, "EventOccurrence", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(eventOccurrenceEClass_E); + initEReference(getEventOccurrence_Event(), g1, null, "event", null, 0, 1, EventOccurrence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getEventOccurrence_Time(), ecorePackage.getEInt(), "time", null, 0, 1, EventOccurrence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(dateEClass, Date.class, "Date", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getDate_Time(), ecorePackage.getEInt(), "time", null, 0, 1, Date.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(phaseEClass, Phase.class, "Phase", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(phaseEClass_E); - initEReference(getPhase_Event(), g1, null, "event", null, 0, 1, Phase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(scenarioElementEClass, ScenarioElement.class, "ScenarioElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(this.getScenarioElement()); + g2 = createEGenericType(scenarioElementEClass_P); + g1.getETypeArguments().add(g2); + initEReference(getScenarioElement_NextElements(), g1, null, "nextElements", null, 0, -1, ScenarioElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioElementEClass_P); + initEReference(getScenarioElement_Guard(), g1, null, "guard", null, 0, 1, ScenarioElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(scenarioFSMEClass, ScenarioFSM.class, "ScenarioFSM", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(scenarioFSMEClass_S); + initEReference(getScenarioFSM_States(), g1, null, "states", null, 0, -1, ScenarioFSM.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioFSMEClass_S); + initEReference(getScenarioFSM_InitialState(), g1, null, "initialState", null, 1, 1, ScenarioFSM.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioFSMEClass_S); + initEReference(getScenarioFSM_AcceptingStates(), g1, null, "acceptingStates", null, 0, -1, ScenarioFSM.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioFSMEClass_T); + initEReference(getScenarioFSM_Transitions(), g1, null, "transitions", null, 0, -1, ScenarioFSM.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(scenarioFSMStateEClass, ScenarioFSMState.class, "ScenarioFSMState", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(scenarioFSMStateEClass_E); + initEReference(getScenarioFSMState_Event(), g1, null, "event", null, 0, 1, ScenarioFSMState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioFSMStateEClass_T); + initEReference(getScenarioFSMState_OutgoingTransitions(), g1, this.getScenarioFSMTransition_Source(), "outgoingTransitions", null, 0, -1, ScenarioFSMState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioFSMStateEClass_T); + initEReference(getScenarioFSMState_IncomingTransitions(), g1, this.getScenarioFSMTransition_Target(), "incomingTransitions", null, 0, -1, ScenarioFSMState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(scenarioFSMTransitionEClass, ScenarioFSMTransition.class, "ScenarioFSMTransition", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(scenarioFSMTransitionEClass_P); + initEReference(getScenarioFSMTransition_Guard(), g1, null, "guard", null, 0, 1, ScenarioFSMTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioFSMTransitionEClass_S); + initEReference(getScenarioFSMTransition_Source(), g1, this.getScenarioFSMState_OutgoingTransitions(), "source", null, 1, 1, ScenarioFSMTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(scenarioFSMTransitionEClass_S); + initEReference(getScenarioFSMTransition_Target(), g1, this.getScenarioFSMState_IncomingTransitions(), "target", null, 1, 1, ScenarioFSMTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Create resource createResource(eNS_URI); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java deleted file mode 100644 index 11de31e51..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/StageImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.scenario.impl; - -import fr.inria.diverse.event.commons.model.property.StateProperty; - -import fr.inria.diverse.event.commons.model.scenario.Event; -import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; -import fr.inria.diverse.event.commons.model.scenario.Stage; - -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; - -/** - * - * An implementation of the model object 'Stage'. - * - *

    - * The following features are implemented: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.StageImpl#getProperty Property}
    • - *
    - * - * @generated - */ -public abstract class StageImpl, P extends StateProperty> extends PhaseImpl implements Stage { - /** - * The cached value of the '{@link #getProperty() Property}' containment reference. - * - * - * @see #getProperty() - * @generated - * @ordered - */ - protected P property; - - /** - * - * - * @generated - */ - protected StageImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ScenarioPackage.Literals.STAGE; - } - - /** - * - * - * @generated - */ - public P getProperty() { - return property; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetProperty(P newProperty, NotificationChain msgs) { - P oldProperty = property; - property = newProperty; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.STAGE__PROPERTY, oldProperty, newProperty); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setProperty(P newProperty) { - if (newProperty != property) { - NotificationChain msgs = null; - if (property != null) - msgs = ((InternalEObject)property).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.STAGE__PROPERTY, null, msgs); - if (newProperty != null) - msgs = ((InternalEObject)newProperty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.STAGE__PROPERTY, null, msgs); - msgs = basicSetProperty(newProperty, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.STAGE__PROPERTY, newProperty, newProperty)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ScenarioPackage.STAGE__PROPERTY: - return basicSetProperty(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ScenarioPackage.STAGE__PROPERTY: - return getProperty(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ScenarioPackage.STAGE__PROPERTY: - setProperty((P)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ScenarioPackage.STAGE__PROPERTY: - setProperty((P)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ScenarioPackage.STAGE__PROPERTY: - return property != null; - } - return super.eIsSet(featureID); - } - -} //StageImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/TestSuiteImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/TestSuiteImpl.java deleted file mode 100644 index 260651a12..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/TestSuiteImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.scenario.impl; - -import fr.inria.diverse.event.commons.model.scenario.Scenario; -import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; -import fr.inria.diverse.event.commons.model.scenario.TestSuite; - -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.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Test Suite'. - * - *

    - * The following features are implemented: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.TestSuiteImpl#getTests Tests}
    • - *
    - * - * @generated - */ -public abstract class TestSuiteImpl> extends MinimalEObjectImpl.Container implements TestSuite { - /** - * The cached value of the '{@link #getTests() Tests}' containment reference list. - * - * - * @see #getTests() - * @generated - * @ordered - */ - protected EList tests; - - /** - * - * - * @generated - */ - protected TestSuiteImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ScenarioPackage.Literals.TEST_SUITE; - } - - /** - * - * - * @generated - */ - public EList getTests() { - if (tests == null) { - tests = new EObjectContainmentEList(Scenario.class, this, ScenarioPackage.TEST_SUITE__TESTS); - } - return tests; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ScenarioPackage.TEST_SUITE__TESTS: - return ((InternalEList)getTests()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ScenarioPackage.TEST_SUITE__TESTS: - return getTests(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ScenarioPackage.TEST_SUITE__TESTS: - getTests().clear(); - getTests().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ScenarioPackage.TEST_SUITE__TESTS: - getTests().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ScenarioPackage.TEST_SUITE__TESTS: - return tests != null && !tests.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //TestSuiteImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java index 11c09547c..1eaf88c4b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java @@ -70,7 +70,7 @@ public boolean isFactoryForType(Object object) { protected ScenarioSwitch modelSwitch = new ScenarioSwitch() { @Override - public

    > Adapter caseScenario(Scenario

    object) { + public > Adapter caseScenario(Scenario object) { return createScenarioAdapter(); } @Override @@ -78,10 +78,6 @@ public Adapter caseEvent(Event object) { return createEventAdapter(); } @Override - public , P extends StateProperty> Adapter caseStage(Stage object) { - return createStageAdapter(); - } - @Override public Adapter caseElementProvider(ElementProvider object) { return createElementProviderAdapter(); } @@ -94,16 +90,24 @@ public > Adapter caseElementQuery(ElementQuery> Adapter caseTestSuite(TestSuite object) { - return createTestSuiteAdapter(); + public , P extends StateProperty> Adapter caseEventOccurrence(EventOccurrence object) { + return createEventOccurrenceAdapter(); } @Override - public > Adapter caseDate(Date object) { - return createDateAdapter(); + public

    > Adapter caseScenarioElement(ScenarioElement

    object) { + return createScenarioElementAdapter(); } @Override - public > Adapter casePhase(Phase object) { - return createPhaseAdapter(); + public

    , E extends Event, S extends ScenarioFSMState, T extends ScenarioFSMTransition> Adapter caseScenarioFSM(ScenarioFSM object) { + return createScenarioFSMAdapter(); + } + @Override + public , T extends ScenarioFSMTransition> Adapter caseScenarioFSMState(ScenarioFSMState object) { + return createScenarioFSMStateAdapter(); + } + @Override + public

    , S extends ScenarioFSMState> Adapter caseScenarioFSMTransition(ScenarioFSMTransition object) { + return createScenarioFSMTransitionAdapter(); } @Override public Adapter defaultCase(EObject object) { @@ -154,100 +158,114 @@ public Adapter createEventAdapter() { } /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.Stage Stage}'. + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ElementProvider Element Provider}'. * * 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 fr.inria.diverse.event.commons.model.scenario.Stage + * @see fr.inria.diverse.event.commons.model.scenario.ElementProvider * @generated */ - public Adapter createStageAdapter() { + public Adapter createElementProviderAdapter() { return null; } /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ElementProvider Element Provider}'. + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ElementReference Element Reference}'. * * 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 fr.inria.diverse.event.commons.model.scenario.ElementProvider + * @see fr.inria.diverse.event.commons.model.scenario.ElementReference * @generated */ - public Adapter createElementProviderAdapter() { + public Adapter createElementReferenceAdapter() { return null; } /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ElementReference Element Reference}'. + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ElementQuery Element Query}'. * * 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 fr.inria.diverse.event.commons.model.scenario.ElementReference + * @see fr.inria.diverse.event.commons.model.scenario.ElementQuery * @generated */ - public Adapter createElementReferenceAdapter() { + public Adapter createElementQueryAdapter() { return null; } /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ElementQuery Element Query}'. + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.EventOccurrence Event Occurrence}'. * * 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 fr.inria.diverse.event.commons.model.scenario.ElementQuery + * @see fr.inria.diverse.event.commons.model.scenario.EventOccurrence * @generated */ - public Adapter createElementQueryAdapter() { + public Adapter createEventOccurrenceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement 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 fr.inria.diverse.event.commons.model.scenario.ScenarioElement + * @generated + */ + public Adapter createScenarioElementAdapter() { return null; } /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.TestSuite Test Suite}'. + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM FSM}'. * * 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 fr.inria.diverse.event.commons.model.scenario.TestSuite + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSM * @generated */ - public Adapter createTestSuiteAdapter() { + public Adapter createScenarioFSMAdapter() { return null; } /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.Date Date}'. + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState FSM State}'. * * 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 fr.inria.diverse.event.commons.model.scenario.Date + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState * @generated */ - public Adapter createDateAdapter() { + public Adapter createScenarioFSMStateAdapter() { return null; } /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.Phase Phase}'. + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition FSM Transition}'. * * 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 fr.inria.diverse.event.commons.model.scenario.Phase + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition * @generated */ - public Adapter createPhaseAdapter() { + public Adapter createScenarioFSMTransitionAdapter() { return null; } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java index 7ea1f2eb8..25bc4c313 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java @@ -80,13 +80,6 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } - case ScenarioPackage.STAGE: { - Stage stage = (Stage)theEObject; - T1 result = caseStage(stage); - if (result == null) result = casePhase(stage); - if (result == null) result = defaultCase(theEObject); - return result; - } case ScenarioPackage.ELEMENT_PROVIDER: { ElementProvider elementProvider = (ElementProvider)theEObject; T1 result = caseElementProvider(elementProvider); @@ -107,22 +100,35 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } - case ScenarioPackage.TEST_SUITE: { - TestSuite testSuite = (TestSuite)theEObject; - T1 result = caseTestSuite(testSuite); + case ScenarioPackage.EVENT_OCCURRENCE: { + EventOccurrence eventOccurrence = (EventOccurrence)theEObject; + T1 result = caseEventOccurrence(eventOccurrence); + if (result == null) result = caseScenarioElement(eventOccurrence); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.SCENARIO_ELEMENT: { + ScenarioElement scenarioElement = (ScenarioElement)theEObject; + T1 result = caseScenarioElement(scenarioElement); if (result == null) result = defaultCase(theEObject); return result; } - case ScenarioPackage.DATE: { - Date date = (Date)theEObject; - T1 result = caseDate(date); - if (result == null) result = casePhase(date); + case ScenarioPackage.SCENARIO_FSM: { + ScenarioFSM scenarioFSM = (ScenarioFSM)theEObject; + T1 result = caseScenarioFSM(scenarioFSM); + if (result == null) result = caseScenarioElement(scenarioFSM); if (result == null) result = defaultCase(theEObject); return result; } - case ScenarioPackage.PHASE: { - Phase phase = (Phase)theEObject; - T1 result = casePhase(phase); + case ScenarioPackage.SCENARIO_FSM_STATE: { + ScenarioFSMState scenarioFSMState = (ScenarioFSMState)theEObject; + T1 result = caseScenarioFSMState(scenarioFSMState); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.SCENARIO_FSM_TRANSITION: { + ScenarioFSMTransition scenarioFSMTransition = (ScenarioFSMTransition)theEObject; + T1 result = caseScenarioFSMTransition(scenarioFSMTransition); if (result == null) result = defaultCase(theEObject); return result; } @@ -141,7 +147,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public

    > T1 caseScenario(Scenario

    object) { + public > T1 caseScenario(Scenario object) { return null; } @@ -161,107 +167,122 @@ public T1 caseEvent(Event object) { } /** - * Returns the result of interpreting the object as an instance of 'Stage'. + * Returns the result of interpreting the object as an instance of 'Element Provider'. * * 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 'Stage'. + * @return the result of interpreting the object as an instance of 'Element Provider'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public , P extends StateProperty> T1 caseStage(Stage object) { + public T1 caseElementProvider(ElementProvider object) { return null; } /** - * Returns the result of interpreting the object as an instance of 'Element Provider'. + * Returns the result of interpreting the object as an instance of 'Element Reference'. * * 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 'Element Provider'. + * @return the result of interpreting the object as an instance of 'Element Reference'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public T1 caseElementProvider(ElementProvider object) { + public T1 caseElementReference(ElementReference object) { return null; } /** - * Returns the result of interpreting the object as an instance of 'Element Reference'. + * Returns the result of interpreting the object as an instance of 'Element Query'. * * 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 'Element Reference'. + * @return the result of interpreting the object as an instance of 'Element Query'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public T1 caseElementReference(ElementReference object) { + public > T1 caseElementQuery(ElementQuery object) { return null; } /** - * Returns the result of interpreting the object as an instance of 'Element Query'. + * Returns the result of interpreting the object as an instance of 'Event Occurrence'. * * 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 'Element Query'. + * @return the result of interpreting the object as an instance of 'Event Occurrence'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public > T1 caseElementQuery(ElementQuery object) { + public , P extends StateProperty> T1 caseEventOccurrence(EventOccurrence object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '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 'Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    > T1 caseScenarioElement(ScenarioElement

    object) { return null; } /** - * Returns the result of interpreting the object as an instance of 'Test Suite'. + * Returns the result of interpreting the object as an instance of 'FSM'. * * 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 'Test Suite'. + * @return the result of interpreting the object as an instance of 'FSM'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public > T1 caseTestSuite(TestSuite object) { + public

    , E extends Event, S extends ScenarioFSMState, T extends ScenarioFSMTransition> T1 caseScenarioFSM(ScenarioFSM object) { return null; } /** - * Returns the result of interpreting the object as an instance of 'Date'. + * Returns the result of interpreting the object as an instance of 'FSM State'. * * 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 'Date'. + * @return the result of interpreting the object as an instance of 'FSM State'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public > T1 caseDate(Date object) { + public , T extends ScenarioFSMTransition> T1 caseScenarioFSMState(ScenarioFSMState object) { return null; } /** - * Returns the result of interpreting the object as an instance of 'Phase'. + * Returns the result of interpreting the object as an instance of 'FSM Transition'. * * 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 'Phase'. + * @return the result of interpreting the object as an instance of 'FSM Transition'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public > T1 casePhase(Phase object) { + public

    , S extends ScenarioFSMState> T1 caseScenarioFSMTransition(ScenarioFSMTransition object) { return null; } From e088d39e7a9d4aca64b90111de83e4afa37f315d Mon Sep 17 00:00:00 2001 From: d-leroy Date: Tue, 23 May 2017 16:54:44 +0200 Subject: [PATCH 04/31] Refactoring, ScenarioManager now deleguates everything to IPropertyListeners and add PropertyMonitor support in launch configuration wizard --- .../event/AbstractEventManager.java | 40 ++- .../property/IPropertyMonitor.java | 4 - ...pertyMonitor.java => PropertyMonitor.java} | 65 ++--- .../property/propertyAspects.xtend | 22 +- .../interpreter/scenario/ArbiterManager.java | 59 +++++ .../scenario/IScenarioManager.java | 8 +- .../interpreter/scenario/ScenarioManager.java | 236 +++++------------- .../scenario/scenarioAspects.xtend | 4 +- .../model/property.ecore | 17 +- .../model/report.ecore | 16 +- .../model/scenario.ecore | 140 ++++++++--- .../model/property/CompositeProperty.java | 40 +++ .../model/property/PropertyFactory.java | 9 + .../model/property/PropertyPackage.java | 108 ++++++-- .../property/impl/CompositePropertyImpl.java | 150 +++++++++++ .../property/impl/PropertyFactoryImpl.java | 11 + .../property/impl/PropertyPackageImpl.java | 33 +++ .../property/util/PropertyAdapterFactory.java | 18 ++ .../model/property/util/PropertySwitch.java | 22 ++ .../model/scenario/ScenarioElement.java | 6 +- .../model/scenario/ScenarioPackage.java | 12 +- .../scenario/impl/ScenarioElementImpl.java | 9 +- .../scenario/impl/ScenarioPackageImpl.java | 2 +- .../debug/GenericSequentialModelDebugger.java | 4 +- .../tabs/LaunchConfigurationMainTab.java | 6 + 25 files changed, 716 insertions(+), 325 deletions(-) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/{AbstractPropertyMonitor.java => PropertyMonitor.java} (80%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/CompositeProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/CompositePropertyImpl.java diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java index 3ebbf95f8..f23846b11 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java @@ -16,6 +16,7 @@ import org.gemoc.xdsmlframework.api.core.IExecutionEngine; import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; +import fr.inria.diverse.event.commons.interpreter.property.PropertyMonitor; import fr.inria.diverse.event.commons.interpreter.scenario.ScenarioManager; import fr.inria.diverse.event.commons.model.EventInstance; import fr.inria.diverse.event.commons.model.EventManagerRegistry; @@ -37,7 +38,7 @@ public abstract class AbstractEventManager implements IEventManager { private Thread t = null; protected ScenarioManager scenarioManager; - + @Override public void sendEvent(Object input) { if (scenarioManager == null) { @@ -52,7 +53,7 @@ public void sendEvent(Object input) { } } } - + @Override public void receiveEvent(Object result, Object caller, String className, String methodName) { final EventInstance event = rebuildEvent(result, caller, className, methodName); @@ -60,19 +61,19 @@ public void receiveEvent(Object result, Object caller, String className, String listeners.forEach(l -> l.eventReceived(event)); } } - + private List listeners = new ArrayList<>(); - + @Override public void addListener(IEventManagerListener listener) { listeners.add(listener); } - + @Override public void removeListener(IEventManagerListener listener) { listeners.remove(listener); } - + protected abstract EventInstance rebuildEvent(Object result, Object caller, String className, String methodName); @Override @@ -80,7 +81,6 @@ public void manageEvents() { if (canManageEvents) { canManageEvents = false; if (scenarioManager != null && !scenarioManager.isScenarioComplete()) { - eventQueue.addAll(scenarioManager.getEvents()); if (waitForEvents && eventQueue.isEmpty()) { throw new IllegalStateException("Event manager asked to wait for events while playing a scenario"); } @@ -109,19 +109,17 @@ public void waitForEvents() { waitForEvents = true; } - @SuppressWarnings("rawtypes") - private Scenario pendingScenario; + private Scenario pendingScenario; - @SuppressWarnings("rawtypes") @Override public void loadScenario(URI uri, ResourceSet resourceSet) { Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); Resource resource = resourceSet.getResource(uri.trimFragment(), true); EcoreUtil.resolveAll(resource); if (uri.hasFragment()) { - pendingScenario = (Scenario) resource.getEObject(uri.fragment()); + pendingScenario = (Scenario) resource.getEObject(uri.fragment()); } else { - pendingScenario = (Scenario) resource.getContents().get(0); + pendingScenario = (Scenario) resource.getContents().get(0); } } @@ -131,24 +129,28 @@ public void loadScenario(URI uri, ResourceSet resourceSet) { public void engineAboutToStart(IExecutionEngine engine) { executedModel = engine.getExecutionContext().getResourceModel(); if (pendingScenario != null) { - scenarioManager = new ScenarioManager(pendingScenario, executedModel, () -> engine.getCurrentStack()); - pendingScenario = null; + PropertyMonitor monitor = engine.getAddon(PropertyMonitor.class); + if (monitor != null) { + scenarioManager = new ScenarioManager(executedModel, this, monitor); + } else { + + } } } @Override public void engineInitialized(IExecutionEngine executionEngine) { - } @Override public void engineStarted(IExecutionEngine executionEngine) { EventManagerRegistry.getInstance().registerManager(this); + scenarioManager.loadScenario(pendingScenario); + pendingScenario = null; } @Override public void engineAboutToStop(IExecutionEngine engine) { - } @Override @@ -161,7 +163,6 @@ public void engineStopped(IExecutionEngine engine) { @Override public void engineAboutToDispose(IExecutionEngine engine) { - } @SuppressWarnings("rawtypes") @@ -173,27 +174,22 @@ public void aboutToSelectStep(IExecutionEngine engine, Collection steps) { @SuppressWarnings("rawtypes") @Override public void proposedStepsChanged(IExecutionEngine engine, Collection steps) { - } @Override public void stepSelected(IExecutionEngine engine, Step selectedStep) { - } @Override public void aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute) { - } @Override public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { - } @Override public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { - } @Override diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java index 26ce07b48..133f0d5b5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java @@ -3,10 +3,6 @@ import fr.inria.diverse.event.commons.model.property.Property; public interface IPropertyMonitor { - - boolean monitor(Property property); - - void unmonitor(Property property); void addListener(Property property, IPropertyListener listener); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/AbstractPropertyMonitor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java similarity index 80% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/AbstractPropertyMonitor.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java index dd44af0c0..4c1efa482 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/AbstractPropertyMonitor.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java @@ -18,48 +18,41 @@ import org.gemoc.xdsmlframework.api.core.IExecutionEngine; import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; +import fr.inria.diverse.event.commons.model.property.CompositeProperty; import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.property.StepProperty; import fr.inria.diverse.event.commons.model.property.Stepping; import fr.inria.diverse.trace.commons.model.trace.Step; -public abstract class AbstractPropertyMonitor implements IEngineAddon, IPropertyMonitor { +public class PropertyMonitor implements IEngineAddon, IPropertyMonitor { private Resource executedModel; - + private final Map monitoredProperties = new HashMap<>(); - + private final Map> propertyListeners = new HashMap<>(); - + private final Set ongoingSteps = new HashSet<>(); - + private final Set endedSteps = new HashSet<>(); - + private final Set endingSteps = new HashSet<>(); - - @Override - public boolean monitor(Property property) { + + private boolean monitor(Property property) { + if (property == null) { + return true; + } boolean result = false; if (property instanceof StepProperty) { - final StepProperty stepProperty = (StepProperty) property; - final EOperation operation = stepProperty.getOperation(); - final Stepping stepping = stepProperty.getStepping(); - result = ongoingSteps.contains(operation) && stepping == Stepping.ONGOING || - endedSteps.contains(operation) && stepping == Stepping.ENDED || - endingSteps.contains(operation) && stepping == Stepping.ENDING; + result = evaluateStepProperty((StepProperty) property); } else { result = evaluateStateProperty((StateProperty) property); } monitoredProperties.put(property, result); return result; } - - @Override - public void unmonitor(Property property) { - monitoredProperties.remove(property); - } - + private void updateProperties() { propertyListeners.entrySet().stream().forEach(e -> { final Property p = e.getKey(); @@ -87,7 +80,19 @@ public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { endingSteps.add(operation); updateProperties(); } - + + private boolean evaluateCompositeProperty(CompositeProperty property) { + return property.getProperties().stream().map(p -> monitor(p)).allMatch(b -> b); + } + + private boolean evaluateStepProperty(StepProperty property) { + final EOperation operation = property.getOperation(); + final Stepping stepping = property.getStepping(); + return ongoingSteps.contains(operation) && stepping == Stepping.ONGOING + || endedSteps.contains(operation) && stepping == Stepping.ENDED + || endingSteps.contains(operation) && stepping == Stepping.ENDING; + } + private boolean evaluateStateProperty(StateProperty property) { final List eventReceivers = new ArrayList<>(); final Object target = property.getTarget(); @@ -98,19 +103,19 @@ private boolean evaluateStateProperty(StateProperty property) { final Iterator it = executedModel.getAllContents(); while (it.hasNext()) { EObject o = it.next(); - if (eClasses.contains(o.eClass()) && ClassPropertyAspect.evaluate(property, o)) { + if (eClasses.contains(o.eClass()) && StatePropertyAspect.evaluate(property, o)) { eventReceivers.add(o); } } } else { final EObject target_cast = (EObject) target; - if (ClassPropertyAspect.evaluate(property, target_cast)) { + if (StatePropertyAspect.evaluate(property, target_cast)) { eventReceivers.add(target_cast); } } return !eventReceivers.isEmpty(); } - + @Override public void addListener(Property property, IPropertyListener listener) { List listeners = propertyListeners.get(property); @@ -119,9 +124,9 @@ public void addListener(Property property, IPropertyListener listener) { propertyListeners.put(property, listeners); } listeners.add(listener); - listener.update(monitor(property)); + monitoredProperties.put(property, false); } - + @Override public void removeListener(Property property, IPropertyListener listener) { List listeners = propertyListeners.get(property); @@ -131,8 +136,12 @@ public void removeListener(Property property, IPropertyListener listener) { propertyListeners.remove(property); } } + monitoredProperties.remove(property); + if (property instanceof CompositeProperty) { + ((CompositeProperty) property).getProperties().forEach(p -> monitoredProperties.remove(p)); + } } - + @Override public void engineAboutToStart(IExecutionEngine engine) { executedModel = engine.getExecutionContext().getResourceModel(); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend index 4e952c1db..cec495101 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend @@ -20,7 +20,7 @@ import java.util.HashSet import fr.inria.diverse.event.commons.model.property.StateProperty @Aspect(className=StateProperty) -class ClassPropertyAspect { +class StatePropertyAspect { public def boolean evaluate(EObject o) { false } @@ -31,7 +31,7 @@ class ClassPropertyAspect { } @Aspect(className=SingleReferenceProperty) -class SingleReferencePropertyAspect extends ClassPropertyAspect { +class SingleReferencePropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { val eObject = o.eGet(_self.feature) as EObject @@ -45,7 +45,7 @@ class SingleReferencePropertyAspect extends ClassPropertyAspect { } @Aspect(className=ContainerReferenceProperty) -class ContainerReferencePropertyAspect extends ClassPropertyAspect { +class ContainerReferencePropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { val eObject = o.eContainer @@ -59,7 +59,7 @@ class ContainerReferencePropertyAspect extends ClassPropertyAspect { } @Aspect(className=BinaryProperty) -class BinaryPropertyAspect extends ClassPropertyAspect { +class BinaryPropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { var result = false @@ -84,7 +84,7 @@ class BinaryPropertyAspect extends ClassPropertyAspect { } @Aspect(className=ManyReferenceProperty) -class ManyPropertyAspect extends ClassPropertyAspect { +class ManyPropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { val l = o.eGet(_self.feature) as List @@ -109,7 +109,7 @@ class ManyPropertyAspect extends ClassPropertyAspect { } @Aspect(className=BooleanAttributeProperty) -class BooleanAttributePropertyAspect extends ClassPropertyAspect { +class BooleanAttributePropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { val i = o.eGet(_self.feature) as Integer @@ -133,7 +133,7 @@ class BooleanAttributePropertyAspect extends ClassPropertyAspect { } @Aspect(className=IntegerAttributeProperty) -class IntegerAttributePropertyAspect extends ClassPropertyAspect { +class IntegerAttributePropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { val i = o.eGet(_self.feature) as Integer @@ -157,7 +157,7 @@ class IntegerAttributePropertyAspect extends ClassPropertyAspect { } @Aspect(className=StringAttributeProperty) -class StringAttributePropertyAspect extends ClassPropertyAspect { +class StringAttributePropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { val i = o.eGet(_self.feature) as String @@ -181,7 +181,7 @@ class StringAttributePropertyAspect extends ClassPropertyAspect { } @Aspect(className=ManyBooleanAttributeProperty) -class ManyBooleanAttributePropertyAspect extends ClassPropertyAspect { +class ManyBooleanAttributePropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { val l = o.eGet(_self.feature) as List @@ -212,7 +212,7 @@ class ManyBooleanAttributePropertyAspect extends ClassPropertyAspect { } @Aspect(className=ManyIntegerAttributeProperty) -class ManyIntegerAttributePropertyAspect extends ClassPropertyAspect { +class ManyIntegerAttributePropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { val l = o.eGet(_self.feature) as List @@ -243,7 +243,7 @@ class ManyIntegerAttributePropertyAspect extends ClassPropertyAspect { } @Aspect(className=ManyStringAttributeProperty) -class ManyStringAttributePropertyAspect extends ClassPropertyAspect { +class ManyStringAttributePropertyAspect extends StatePropertyAspect { @OverrideAspectMethod public def boolean evaluate(EObject o) { val l = o.eGet(_self.feature) as List diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java new file mode 100644 index 000000000..bb4c5a635 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java @@ -0,0 +1,59 @@ +package fr.inria.diverse.event.commons.interpreter.scenario; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; + +import fr.inria.diverse.event.commons.interpreter.property.StatePropertyAspect; +import fr.inria.diverse.event.commons.model.arbiter.Arbiter; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.TruthValue; +import fr.inria.diverse.event.commons.model.property.StateProperty; + +public class ArbiterManager { + + private final Resource executedModel; + private State currentState; + + public ArbiterManager(Arbiter arbiter, Resource executedModel) { + this.executedModel = executedModel; + currentState = arbiter.getInitialState(); + } + + public TruthValue getTruthValue() { + currentState = currentState.getOutgoingTransitions().stream() + .filter(t -> evaluateStateProperty(t.getGuard())) + .findFirst().map(t -> t.getTarget()) + .orElse(currentState); + return currentState.getTruthValue(); + } + + private boolean evaluateStateProperty(StateProperty property) { + final List eventReceivers = new ArrayList<>(); + final Object target = property.getTarget(); + if (target == null) { + Set eClasses = new HashSet<>(); + property.eClass().getEAllGenericSuperTypes().stream() + .forEach(t -> t.getETypeArguments().stream().forEach(a -> eClasses.add(a.getEClassifier()))); + final Iterator it = executedModel.getAllContents(); + while (it.hasNext()) { + EObject o = it.next(); + if (eClasses.contains(o.eClass()) && StatePropertyAspect.evaluate(property, o)) { + eventReceivers.add(o); + } + } + } else { + final EObject target_cast = (EObject) target; + if (StatePropertyAspect.evaluate(property, target_cast)) { + eventReceivers.add(target_cast); + } + } + return !eventReceivers.isEmpty(); + } +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java index b8d6ec57b..267043210 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/IScenarioManager.java @@ -1,14 +1,12 @@ package fr.inria.diverse.event.commons.interpreter.scenario; -import java.util.List; - -import fr.inria.diverse.event.commons.model.EventInstance; +import fr.inria.diverse.event.commons.model.scenario.Scenario; public interface IScenarioManager { - List getEvents(); - boolean isScenarioComplete(); + void loadScenario(Scenario scenario); + void saveScenarioReport(); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java index d4301dd56..6be2380b8 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java @@ -4,16 +4,11 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.stream.Stream; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.resource.Resource; @@ -25,13 +20,11 @@ import org.eclipse.emf.transaction.impl.EMFCommandTransaction; import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; -import fr.inria.diverse.event.commons.interpreter.property.ClassPropertyAspect; import fr.inria.diverse.event.commons.interpreter.property.IPropertyListener; import fr.inria.diverse.event.commons.interpreter.property.IPropertyMonitor; import fr.inria.diverse.event.commons.model.EventInstance; import fr.inria.diverse.event.commons.model.IEventManager; import fr.inria.diverse.event.commons.model.property.Property; -import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.Report; import fr.inria.diverse.event.commons.model.report.ReportFactory; @@ -42,68 +35,30 @@ import fr.inria.diverse.event.commons.model.scenario.ScenarioElement; import fr.inria.diverse.event.commons.model.scenario.ScenarioFSM; import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState; -import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; public class ScenarioManager implements IScenarioManager { - private final Scenario scenario; + private Scenario scenario; private final Resource executedModel; private final IEventManager eventManager; private final IPropertyMonitor propertyMonitor; private final List> currentElements = new ArrayList<>(); - private final Map, ScenarioFSMState> currentFSMStates = new HashMap<>(); - private final Report report; + private final Report report = ReportFactory.eINSTANCE.createReport(); - public ScenarioManager(Scenario scenario, Resource executedModel, IEventManager eventManager, - IPropertyMonitor propertyMonitor) { - this.scenario = scenario; + public ScenarioManager(Resource executedModel, IEventManager eventManager, IPropertyMonitor propertyMonitor) { this.executedModel = executedModel; this.eventManager = eventManager; this.propertyMonitor = propertyMonitor; - scenario.getElements().forEach(element -> { + } + + public void loadScenario(Scenario scenario) { + this.scenario = scenario; + this.scenario.getElements().forEach(element -> { + currentElements.add(element); final Property property = element.getGuard(); propertyMonitor.addListener(property, new ScenarioGuardListener(element, property)); }); - this.report = ReportFactory.eINSTANCE.createReport(); - } - - @Override - public List getEvents() { - if (currentElements.isEmpty()) { - return Collections.emptyList(); - } else { - final List events = new ArrayList<>(); - while (events.addAll(gatherEventInstances())); - return events; - } - } - - private List gatherEventInstances() { - final List result = new ArrayList<>(); - final Stream> reachedSet = currentElements.stream().filter(e -> { - if (e.getGuard() == null || evaluateStateProperty(e.getGuard())) { - if (e instanceof ScenarioFSM) { - return getEventInstances((ScenarioFSM) e, result); - } else { - final EventOccurrence eventOccurrence = (EventOccurrence) e; - final EventInstance eventInstance = createEvent(eventOccurrence.getEvent()); - if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { - result.add(eventInstance); - return true; - } else { - return false; - } - } - } else { - return false; - } - }); - reachedSet.forEach(e -> { - currentElements.remove(e); - currentElements.addAll(e.getNextElements()); - }); - return result; } private void handleFSM(ScenarioFSM fsm) { @@ -127,55 +82,6 @@ private void handleFSM(ScenarioFSM fsm) { } } - private boolean getEventInstances(ScenarioFSM fsm, List result) { - ScenarioFSMState currentState = currentFSMStates.get(fsm); - boolean canProgress = true; - if (currentState == null) { - currentState = fsm.getInitialState(); - if (currentState.getEvent() != null) { - final EventInstance eventInstance = createEvent(currentState.getEvent()); - if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { - result.add(eventInstance); - currentFSMStates.put(fsm, currentState); - } else { - // The FSM is stuck as it is supposed to send an event is - // invalid or cannot be received, - // thus we 'rollback' to the previous state by not saving - // the current state. - canProgress = false; - } - } - } - if (canProgress) { - ScenarioFSMTransition fireableTransition = currentState.getOutgoingTransitions().stream() - .filter(t -> t.getGuard() == null || evaluateStateProperty(t.getGuard())).findFirst().orElse(null); - while (fireableTransition != null && canProgress) { - currentState = fireableTransition.getTarget(); - final EventInstance eventInstance = createEvent(currentState.getEvent()); - if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { - result.add(eventInstance); - currentFSMStates.put(fsm, currentState); - fireableTransition = currentState.getOutgoingTransitions().stream() - .filter(t -> t.getGuard() == null || evaluateStateProperty(t.getGuard())).findFirst() - .orElse(null); - } else { - // The FSM is stuck as it is supposed to send an event is - // invalid or cannot be received, - // thus we 'rollback' to the previous state by not saving - // the current state. - canProgress = false; - } - } - } - if (fsm.getAcceptingStates().contains(currentState)) { - // The FSM reached an accepting state, it will not be used again for - // this execution of the scenario - currentFSMStates.remove(fsm); - return true; - } - return false; - } - private EventInstance createEvent(Event originalEvent) { final ElementProvider targetProvider = originalEvent.getTargetProvider(); final List eventParameterMatches = new ArrayList<>(); @@ -209,29 +115,6 @@ private EventInstance createEvent(Event originalEvent) { return null; } - private boolean evaluateStateProperty(StateProperty property) { - final List eventReceivers = new ArrayList<>(); - final Object target = property.getTarget(); - if (target == null) { - Set eClasses = new HashSet<>(); - property.eClass().getEAllGenericSuperTypes().stream() - .forEach(t -> t.getETypeArguments().stream().forEach(a -> eClasses.add(a.getEClassifier()))); - final Iterator it = executedModel.getAllContents(); - while (it.hasNext()) { - EObject o = it.next(); - if (eClasses.contains(o.eClass()) && ClassPropertyAspect.evaluate(property, o)) { - eventReceivers.add(o); - } - } - } else { - final EObject target_cast = (EObject) target; - if (ClassPropertyAspect.evaluate(property, target_cast)) { - eventReceivers.add(target_cast); - } - } - return !eventReceivers.isEmpty(); - } - @Override public boolean isScenarioComplete() { return currentElements.isEmpty(); @@ -280,23 +163,28 @@ public ScenarioGuardListener(ScenarioElement element, Property property) { @Override public void update(boolean propertyValue) { - if (element instanceof ScenarioFSM) { - // FSM elements - handleFSM((ScenarioFSM) element); - } else { - final EventOccurrence eventOccurrence = (EventOccurrence) element; - final EventInstance eventInstance = createEvent(eventOccurrence.getEvent()); - if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { - eventManager.sendEvent(eventInstance); + if (propertyValue) { + currentElements.remove(element); + currentElements.addAll(element.getNextElements()); + // We stop monitoring the guard of this scenario element. + propertyMonitor.removeListener(property, this); + if (element instanceof EventOccurrence) { + final EventOccurrence eventOccurrence = (EventOccurrence) element; + final EventInstance eventInstance = createEvent(eventOccurrence.getEvent()); + if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { + eventManager.sendEvent(eventInstance); + } + // We start monitoring the guards of the next elements in the scenario tree. + eventOccurrence.getNextElements().stream().forEach(e -> { + final Property property = e.getGuard(); + propertyMonitor.addListener(property, new ScenarioGuardListener(e, property)); + }); + } else { + // We do not monitor the guards of the next elements in the scenario tree + // because they are only evaluated when the FSM reaches an accepting state. + handleFSM((ScenarioFSM) element); } } - currentElements.remove(element); - currentElements.addAll(element.getNextElements()); - propertyMonitor.removeListener(property, this); - element.getNextElements().stream().filter(e -> e instanceof EventOccurrence).forEach(e -> { - final Property property = e.getGuard(); - propertyMonitor.addListener(property, new ScenarioGuardListener(e, property)); - }); } } @@ -317,39 +205,41 @@ public FSMGuardListener(ScenarioFSM fsm, ScenarioFSMState stat @Override public void update(boolean propertyValue) { - // We send the event associated to the newly reached state of the FSM, if any. - final EventInstance eventInstance = createEvent(state.getEvent()); - if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { - eventManager.sendEvent(eventInstance); - } - // We stop monitoring the current guard as well as the guards of the - // other outgoing transitions of the previous state of the FSM. - propertyMonitor.removeListener(property, this); - fsmGuards.forEach((p, l) -> propertyMonitor.removeListener(p, l)); - fsmGuards.clear(); - if (fsm.getAcceptingStates().contains(state)) { - // The FSM has reached an accepting state, thus we start monitoring - // the guards of the next elements in the scenario tree. - currentElements.remove(fsm); - currentElements.addAll(fsm.getNextElements()); + if (propertyValue) { + // We send the event associated to the newly reached state of the FSM, if any. + final EventInstance eventInstance = createEvent(state.getEvent()); + if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { + eventManager.sendEvent(eventInstance); + } + // We stop monitoring the current guard as well as the guards of the + // other outgoing transitions of the previous state of the FSM. propertyMonitor.removeListener(property, this); - fsm.getNextElements().stream().filter(e -> e instanceof EventOccurrence).forEach(e -> { - final Property property = e.getGuard(); - propertyMonitor.addListener(property, new ScenarioGuardListener(e, property)); - }); - } else { - // Otherwise we start monitoring the guards of the outgoing transitions. - final Map fsmGuards = new HashMap<>(); - state.getOutgoingTransitions().forEach(t -> { - final Property property = t.getGuard(); - if (property != null) { - IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), property, fsmGuards); - fsmGuards.put(property, listener); - } - }); - fsmGuards.forEach((p, l) -> { - propertyMonitor.addListener(p, l); - }); + fsmGuards.forEach((p, l) -> propertyMonitor.removeListener(p, l)); + fsmGuards.clear(); + if (fsm.getAcceptingStates().contains(state)) { + // The FSM has reached an accepting state, thus we start monitoring + // the guards of the next elements in the scenario tree. + currentElements.remove(fsm); + currentElements.addAll(fsm.getNextElements()); + propertyMonitor.removeListener(property, this); + fsm.getNextElements().stream().filter(e -> e instanceof EventOccurrence).forEach(e -> { + final Property property = e.getGuard(); + propertyMonitor.addListener(property, new ScenarioGuardListener(e, property)); + }); + } else { + // Otherwise we start monitoring the guards of the outgoing transitions. + final Map fsmGuards = new HashMap<>(); + state.getOutgoingTransitions().forEach(t -> { + final Property property = t.getGuard(); + if (property != null) { + IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), property, fsmGuards); + fsmGuards.put(property, listener); + } + }); + fsmGuards.forEach((p, l) -> { + propertyMonitor.addListener(p, l); + }); + } } } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/scenarioAspects.xtend b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/scenarioAspects.xtend index dcbaccf73..f07265df7 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/scenarioAspects.xtend +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/scenarioAspects.xtend @@ -1,6 +1,5 @@ package fr.inria.diverse.event.commons.interpreter.scenario -import fr.inria.diverse.event.commons.interpreter.property.ClassPropertyAspect import fr.inria.diverse.event.commons.model.scenario.ElementProvider import fr.inria.diverse.event.commons.model.scenario.ElementQuery import fr.inria.diverse.event.commons.model.scenario.ElementReference @@ -8,6 +7,7 @@ import fr.inria.diverse.k3.al.annotationprocessor.Aspect import org.eclipse.emf.ecore.resource.Resource import org.eclipse.emf.ecore.EObject import fr.inria.diverse.k3.al.annotationprocessor.OverrideAspectMethod +import fr.inria.diverse.event.commons.interpreter.property.StatePropertyAspect @Aspect(className=ElementProvider) class ElementProviderAspect { @@ -30,7 +30,7 @@ class ElementQueryAspect extends ElementProviderAspect { public def EObject resolve(Resource r) { val queriedType = _self.eClass.EGenericSuperTypes.head.ETypeArguments.head.EClassifier return r.allContents.filter[o|(o.eClass == queriedType || o.eClass.EAllSuperTypes.contains(queriedType)) - && ClassPropertyAspect.evaluate(_self.query, o) + && StatePropertyAspect.evaluate(_self.query, o) ].head } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore index 05c0b8272..e33bf638a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore @@ -1,7 +1,12 @@ - + + + + + @@ -122,6 +127,10 @@ + + + + @@ -134,5 +143,9 @@ - + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore index abd8d115e..b90c7e3e5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/report.ecore @@ -2,18 +2,6 @@ - - - - - - - - - - @@ -24,8 +12,8 @@ + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/> + - diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore index d69bc09a8..d5b7db8c7 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore @@ -2,14 +2,14 @@ - - + + - - + @@ -21,24 +21,6 @@ - - - - - - - - - - - - - - - - - - @@ -65,36 +47,128 @@ - - - + + + - + + + + + + + + + + + + + + + + + + + - + + + + + + - + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/CompositeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/CompositeProperty.java new file mode 100644 index 000000000..383a64ef7 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/CompositeProperty.java @@ -0,0 +1,40 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Composite Property'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.CompositeProperty#getProperties Properties}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getCompositeProperty() + * @model + * @generated + */ +public interface CompositeProperty extends Property { + /** + * Returns the value of the 'Properties' containment reference list. + * The list contents are of type {@link fr.inria.diverse.event.commons.model.property.Property}. + * + *

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

    + * + * @return the value of the 'Properties' containment reference list. + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getCompositeProperty_Properties() + * @model containment="true" + * @generated + */ + EList getProperties(); + +} // CompositeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java index 82a467c1b..a5cce62f7 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java @@ -21,6 +21,15 @@ public interface PropertyFactory extends EFactory { */ PropertyFactory eINSTANCE = fr.inria.diverse.event.commons.model.property.impl.PropertyFactoryImpl.init(); + /** + * Returns a new object of class 'Composite Property'. + * + * + * @return a new object of class 'Composite Property'. + * @generated + */ + CompositeProperty createCompositeProperty(); + /** * Returns a new object of class 'Container Reference Property'. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java index 2cb494925..1f4fe131a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java @@ -86,6 +86,43 @@ public interface PropertyPackage extends EPackage { */ int PROPERTY_OPERATION_COUNT = 0; + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.CompositePropertyImpl Composite Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.CompositePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getCompositeProperty() + * @generated + */ + int COMPOSITE_PROPERTY = 1; + + /** + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPOSITE_PROPERTY__PROPERTIES = PROPERTY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Composite Property' class. + * + * + * @generated + * @ordered + */ + int COMPOSITE_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Composite Property' class. + * + * + * @generated + * @ordered + */ + int COMPOSITE_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl State Property}' class. * @@ -94,7 +131,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStateProperty() * @generated */ - int STATE_PROPERTY = 1; + int STATE_PROPERTY = 2; /** * The feature id for the 'Target' reference. @@ -140,7 +177,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBinaryProperty() * @generated */ - int BINARY_PROPERTY = 2; + int BINARY_PROPERTY = 3; /** * The feature id for the 'Target' reference. @@ -213,7 +250,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyReferenceProperty() * @generated */ - int MANY_REFERENCE_PROPERTY = 3; + int MANY_REFERENCE_PROPERTY = 4; /** * The feature id for the 'Target' reference. @@ -277,7 +314,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getSingleReferenceProperty() * @generated */ - int SINGLE_REFERENCE_PROPERTY = 4; + int SINGLE_REFERENCE_PROPERTY = 5; /** * The feature id for the 'Target' reference. @@ -332,7 +369,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getContainerReferenceProperty() * @generated */ - int CONTAINER_REFERENCE_PROPERTY = 5; + int CONTAINER_REFERENCE_PROPERTY = 6; /** * The feature id for the 'Target' reference. @@ -387,7 +424,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyBooleanAttributeProperty() * @generated */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY = 6; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY = 7; /** * The feature id for the 'Target' reference. @@ -460,7 +497,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyIntegerAttributeProperty() * @generated */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY = 7; + int MANY_INTEGER_ATTRIBUTE_PROPERTY = 8; /** * The feature id for the 'Target' reference. @@ -533,7 +570,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyStringAttributeProperty() * @generated */ - int MANY_STRING_ATTRIBUTE_PROPERTY = 8; + int MANY_STRING_ATTRIBUTE_PROPERTY = 9; /** * The feature id for the 'Target' reference. @@ -606,7 +643,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanAttributeProperty() * @generated */ - int BOOLEAN_ATTRIBUTE_PROPERTY = 9; + int BOOLEAN_ATTRIBUTE_PROPERTY = 10; /** * The feature id for the 'Target' reference. @@ -670,7 +707,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getIntegerAttributeProperty() * @generated */ - int INTEGER_ATTRIBUTE_PROPERTY = 10; + int INTEGER_ATTRIBUTE_PROPERTY = 11; /** * The feature id for the 'Target' reference. @@ -734,7 +771,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStringAttributeProperty() * @generated */ - int STRING_ATTRIBUTE_PROPERTY = 11; + int STRING_ATTRIBUTE_PROPERTY = 12; /** * The feature id for the 'Target' reference. @@ -798,7 +835,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepProperty() * @generated */ - int STEP_PROPERTY = 12; + int STEP_PROPERTY = 13; /** * The feature id for the 'Stepping' attribute. @@ -844,7 +881,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getOperator() * @generated */ - int OPERATOR = 13; + int OPERATOR = 14; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}' enum. @@ -854,7 +891,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanOperator() * @generated */ - int BOOLEAN_OPERATOR = 14; + int BOOLEAN_OPERATOR = 15; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Quantifier Quantifier}' enum. @@ -864,7 +901,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getQuantifier() * @generated */ - int QUANTIFIER = 15; + int QUANTIFIER = 16; /** @@ -875,7 +912,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepping() * @generated */ - int STEPPING = 16; + int STEPPING = 17; /** @@ -1292,6 +1329,27 @@ public interface PropertyPackage extends EPackage { */ EClass getProperty(); + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.CompositeProperty Composite Property}'. + * + * + * @return the meta object for class 'Composite Property'. + * @see fr.inria.diverse.event.commons.model.property.CompositeProperty + * @generated + */ + EClass getCompositeProperty(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.property.CompositeProperty#getProperties Properties}'. + * + * + * @return the meta object for the containment reference list 'Properties'. + * @see fr.inria.diverse.event.commons.model.property.CompositeProperty#getProperties() + * @see #getCompositeProperty() + * @generated + */ + EReference getCompositeProperty_Properties(); + /** * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}'. * @@ -1693,6 +1751,24 @@ interface Literals { */ EClass PROPERTY = eINSTANCE.getProperty(); + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.CompositePropertyImpl Composite Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.CompositePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getCompositeProperty() + * @generated + */ + EClass COMPOSITE_PROPERTY = eINSTANCE.getCompositeProperty(); + + /** + * The meta object literal for the 'Properties' containment reference list feature. + * + * + * @generated + */ + EReference COMPOSITE_PROPERTY__PROPERTIES = eINSTANCE.getCompositeProperty_Properties(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/CompositePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/CompositePropertyImpl.java new file mode 100644 index 000000000..a13c2a11f --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/CompositePropertyImpl.java @@ -0,0 +1,150 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.CompositeProperty; +import fr.inria.diverse.event.commons.model.property.Property; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Composite Property'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.CompositePropertyImpl#getProperties Properties}
    • + *
    + * + * @generated + */ +public class CompositePropertyImpl extends PropertyImpl implements CompositeProperty { + /** + * The cached value of the '{@link #getProperties() Properties}' containment reference list. + * + * + * @see #getProperties() + * @generated + * @ordered + */ + protected EList properties; + + /** + * + * + * @generated + */ + protected CompositePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.COMPOSITE_PROPERTY; + } + + /** + * + * + * @generated + */ + public EList getProperties() { + if (properties == null) { + properties = new EObjectContainmentEList(Property.class, this, PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES); + } + return properties; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: + return ((InternalEList)getProperties()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: + return getProperties(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: + getProperties().clear(); + getProperties().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: + getProperties().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: + return properties != null && !properties.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //CompositePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java index bf69d4180..c36186b0e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java @@ -57,6 +57,7 @@ public PropertyFactoryImpl() { @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { + case PropertyPackage.COMPOSITE_PROPERTY: return createCompositeProperty(); case PropertyPackage.CONTAINER_REFERENCE_PROPERTY: return createContainerReferenceProperty(); case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY: return createManyBooleanAttributeProperty(); case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY: return createManyIntegerAttributeProperty(); @@ -108,6 +109,16 @@ public String convertToString(EDataType eDataType, Object instanceValue) { } } + /** + * + * + * @generated + */ + public CompositeProperty createCompositeProperty() { + CompositePropertyImpl compositeProperty = new CompositePropertyImpl(); + return compositeProperty; + } + /** * * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java index e8d6f5a1b..396af5e55 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java @@ -5,6 +5,7 @@ import fr.inria.diverse.event.commons.model.property.BinaryProperty; import fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty; import fr.inria.diverse.event.commons.model.property.BooleanOperator; +import fr.inria.diverse.event.commons.model.property.CompositeProperty; import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty; import fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty; import fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty; @@ -132,6 +133,13 @@ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage */ private EClass propertyEClass = null; + /** + * + * + * @generated + */ + private EClass compositePropertyEClass = null; + /** * * @@ -575,6 +583,24 @@ public EClass getProperty() { return propertyEClass; } + /** + * + * + * @generated + */ + public EClass getCompositeProperty() { + return compositePropertyEClass; + } + + /** + * + * + * @generated + */ + public EReference getCompositeProperty_Properties() { + return (EReference)compositePropertyEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -641,6 +667,9 @@ public void createPackageContents() { // Create classes and their features propertyEClass = createEClass(PROPERTY); + compositePropertyEClass = createEClass(COMPOSITE_PROPERTY); + createEReference(compositePropertyEClass, COMPOSITE_PROPERTY__PROPERTIES); + statePropertyEClass = createEClass(STATE_PROPERTY); createEReference(statePropertyEClass, STATE_PROPERTY__TARGET); createEOperation(statePropertyEClass, STATE_PROPERTY___GET_FEATURE); @@ -760,6 +789,7 @@ public void initializePackageContents() { containerReferencePropertyEClass_P.getEBounds().add(g1); // Add supertypes to classes + compositePropertyEClass.getESuperTypes().add(this.getProperty()); statePropertyEClass.getESuperTypes().add(this.getProperty()); g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(binaryPropertyEClass_T); @@ -806,6 +836,9 @@ public void initializePackageContents() { // Initialize classes, features, and operations; add parameters initEClass(propertyEClass, Property.class, "Property", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(compositePropertyEClass, CompositeProperty.class, "CompositeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCompositeProperty_Properties(), this.getProperty(), null, "properties", null, 0, -1, CompositeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(statePropertyEClass, StateProperty.class, "StateProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(statePropertyEClass_T); initEReference(getStateProperty_Target(), g1, null, "target", null, 0, 1, StateProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java index 7ec8ebe9c..a79ce9f69 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java @@ -72,6 +72,10 @@ public Adapter caseProperty(Property object) { return createPropertyAdapter(); } @Override + public Adapter caseCompositeProperty(CompositeProperty object) { + return createCompositePropertyAdapter(); + } + @Override public Adapter caseStateProperty(StateProperty object) { return createStatePropertyAdapter(); } @@ -321,6 +325,20 @@ public Adapter createPropertyAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.CompositeProperty Composite 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 fr.inria.diverse.event.commons.model.property.CompositeProperty + * @generated + */ + public Adapter createCompositePropertyAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java index b89b87d43..bb6927f48 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java @@ -72,6 +72,13 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } + case PropertyPackage.COMPOSITE_PROPERTY: { + CompositeProperty compositeProperty = (CompositeProperty)theEObject; + T1 result = caseCompositeProperty(compositeProperty); + if (result == null) result = caseProperty(compositeProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } case PropertyPackage.STATE_PROPERTY: { StateProperty stateProperty = (StateProperty)theEObject; T1 result = caseStateProperty(stateProperty); @@ -365,6 +372,21 @@ public T1 caseProperty(Property object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Composite 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 'Composite Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseCompositeProperty(CompositeProperty object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java index 1202d06ed..3759f78b0 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java @@ -27,7 +27,7 @@ */ public interface ScenarioElement

    > extends EObject { /** - * Returns the value of the 'Next Elements' reference list. + * Returns the value of the 'Next Elements' containment reference list. * The list contents are of type {@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement}<P>. * *

    @@ -35,9 +35,9 @@ public interface ScenarioElement

    > extends EObject { * there really should be more of a description here... *

    * - * @return the value of the 'Next Elements' reference list. + * @return the value of the 'Next Elements' containment reference list. * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioElement_NextElements() - * @model + * @model containment="true" * @generated */ EList> getNextElements(); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java index 28efbfa2b..6db6403d0 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java @@ -243,7 +243,7 @@ public interface ScenarioPackage extends EPackage { int SCENARIO_ELEMENT = 6; /** - * The feature id for the 'Next Elements' reference list. + * The feature id for the 'Next Elements' containment reference list. * * * @generated @@ -289,7 +289,7 @@ public interface ScenarioPackage extends EPackage { int EVENT_OCCURRENCE = 5; /** - * The feature id for the 'Next Elements' reference list. + * The feature id for the 'Next Elements' containment reference list. * * * @generated @@ -353,7 +353,7 @@ public interface ScenarioPackage extends EPackage { int SCENARIO_FSM = 7; /** - * The feature id for the 'Next Elements' reference list. + * The feature id for the 'Next Elements' containment reference list. * * * @generated @@ -672,10 +672,10 @@ public interface ScenarioPackage extends EPackage { EClass getScenarioElement(); /** - * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getNextElements Next Elements}'. + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getNextElements Next Elements}'. * * - * @return the meta object for the reference list 'Next Elements'. + * @return the meta object for the containment reference list 'Next Elements'. * @see fr.inria.diverse.event.commons.model.scenario.ScenarioElement#getNextElements() * @see #getScenarioElement() * @generated @@ -975,7 +975,7 @@ interface Literals { EClass SCENARIO_ELEMENT = eINSTANCE.getScenarioElement(); /** - * The meta object literal for the 'Next Elements' reference list feature. + * The meta object literal for the 'Next Elements' containment reference list feature. * * * @generated diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java index 2f57e1545..5bcc0139f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java @@ -20,7 +20,8 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; /** * @@ -38,7 +39,7 @@ */ public abstract class ScenarioElementImpl

    > extends MinimalEObjectImpl.Container implements ScenarioElement

    { /** - * The cached value of the '{@link #getNextElements() Next Elements}' reference list. + * The cached value of the '{@link #getNextElements() Next Elements}' containment reference list. * * * @see #getNextElements() @@ -83,7 +84,7 @@ protected EClass eStaticClass() { */ public EList> getNextElements() { if (nextElements == null) { - nextElements = new EObjectResolvingEList>(ScenarioElement.class, this, ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS); + nextElements = new EObjectContainmentEList>(ScenarioElement.class, this, ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS); } return nextElements; } @@ -139,6 +140,8 @@ else if (eNotificationRequired()) @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: + return ((InternalEList)getNextElements()).basicRemove(otherEnd, msgs); case ScenarioPackage.SCENARIO_ELEMENT__GUARD: return basicSetGuard(null, msgs); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java index 4303f1a06..49b9789ab 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java @@ -641,7 +641,7 @@ public void initializePackageContents() { g1 = createEGenericType(this.getScenarioElement()); g2 = createEGenericType(scenarioElementEClass_P); g1.getETypeArguments().add(g2); - initEReference(getScenarioElement_NextElements(), g1, null, "nextElements", null, 0, -1, ScenarioElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getScenarioElement_NextElements(), g1, null, "nextElements", null, 0, -1, ScenarioElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(scenarioElementEClass_P); initEReference(getScenarioElement_Guard(), g1, null, "guard", null, 0, 1, ScenarioElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java index b08828d9e..61c664b13 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/debug/GenericSequentialModelDebugger.java @@ -33,7 +33,7 @@ import org.gemoc.executionframework.engine.ui.debug.breakpoint.GemocBreakpoint; import org.gemoc.xdsmlframework.api.core.IExecutionEngine; -import fr.inria.diverse.event.commons.interpreter.property.ClassPropertyAspect; +import fr.inria.diverse.event.commons.interpreter.property.StatePropertyAspect; import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.melange.resource.MelangeResourceImpl; import fr.inria.diverse.trace.commons.model.trace.MSE; @@ -252,7 +252,7 @@ private boolean checkBreakpointProperty(EObject originalObject, EObject actualOb return null; }); if (property != null) { - propertyResult = ClassPropertyAspect.evaluate(property, actualObject); + propertyResult = StatePropertyAspect.evaluate(property, actualObject); } } return propertyResult; diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java index f3442f55d..f91e4df6f 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java @@ -192,6 +192,12 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) { _modelInitializationArgumentsText.getText()); configuration.setAttribute(RunConfiguration.LAUNCH_SCENARIO_URI, _scenarioLocationText.getText()); + try { + configuration.setAttribute("Property Monitor", + !configuration.getAttribute(RunConfiguration.LAUNCH_SCENARIO_URI, "").equals("")); + } catch (CoreException e) { + e.printStackTrace(); + } configuration.setAttribute(RunConfiguration.LAUNCH_BREAK_START, _animationFirstBreak.getSelection()); // DebugModelID for sequential engine From 8812025cd9ee66727d73382f58c9a1a40742009e Mon Sep 17 00:00:00 2001 From: d-leroy Date: Wed, 31 May 2017 10:44:01 +0200 Subject: [PATCH 05/31] [Scenario metamodel & Property monitor] Updated scenario metamodel, added property monitor engine addon --- .../META-INF/MANIFEST.MF | 2 +- .../plugin.xml | 3 + .../event/AbstractEventManager.java | 51 +- .../interpreter/property/PropertyMonitor.java | 84 +- .../interpreter/scenario/ArbiterManager.java | 96 +- .../interpreter/scenario/ScenarioManager.java | 186 +- .../META-INF/MANIFEST.MF | 4 +- ...Property_properties_CompositeProperty.gif} | Bin 223 -> 223 bytes ...properties_ContainerReferenceProperty.gif} | Bin 223 -> 223 bytes ...Property_properties_EventPrecondition.gif} | Bin 223 -> 223 bytes ...operties_ManyBooleanAttributeProperty.gif} | Bin 223 -> 223 bytes ...roperties_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...properties_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...eProperty_properties_PropertyReference.gif | Bin 0 -> 223 bytes ...enarioElement_guard_CompositeProperty.gif} | Bin ...ement_guard_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...cenarioElement_guard_EventPrecondition.gif | Bin 0 -> 223 bytes ...ent_guard_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...ent_guard_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...ment_guard_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...cenarioElement_guard_PropertyReference.gif | Bin 0 -> 223 bytes ...oFSMTransition_guard_CompositeProperty.gif | Bin 0 -> 223 bytes ...ition_guard_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...oFSMTransition_guard_EventPrecondition.gif | Bin 0 -> 223 bytes ...ion_guard_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...ion_guard_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...tion_guard_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...oFSMTransition_guard_PropertyReference.gif | Bin 0 -> 223 bytes ...e_property_ManyStringAttributeProperty.gif | Bin 223 -> 0 bytes .../obj16/{EventParameter.gif => Arbiter.gif} | Bin 129 -> 129 bytes ...{StageReport.gif => CompositeProperty.gif} | Bin ...{EventReport.gif => EventPrecondition.gif} | Bin 129 -> 129 bytes ...buteProperty.gif => PropertyReference.gif} | Bin 129 -> 129 bytes .../full/obj16/{Report.gif => State.gif} | Bin 129 -> 129 bytes .../icons/full/obj16/StepProperty.gif | Bin 129 -> 0 bytes .../icons/full/obj16/Transition.gif | Bin 0 -> 129 bytes .../plugin.properties | 69 +- .../plugin.xml | 6 +- .../provider/ArbiterEditPlugin.java} | 10 +- .../provider/ArbiterItemProvider.java} | 58 +- .../ArbiterItemProviderAdapterFactory.java} | 56 +- .../provider/StateItemProvider.java} | 93 +- .../provider/TransitionItemProvider.java | 192 ++ .../CompositePropertyItemProvider.java | 172 ++ .../EventPreconditionItemProvider.java | 120 ++ .../IntegerAttributePropertyItemProvider.java | 11 - .../property/provider/PropertyEditPlugin.java | 3 + .../provider/PropertyItemProvider.java | 11 - .../PropertyItemProviderAdapterFactory.java | 72 + .../PropertyReferenceItemProvider.java | 120 ++ .../provider/StepPropertyItemProvider.java | 1 + .../provider/ScenarioElementItemProvider.java | 41 +- .../provider/ScenarioFSMItemProvider.java | 32 +- .../ScenarioFSMStateItemProvider.java | 32 +- .../ScenarioFSMTransitionItemProvider.java | 47 +- .../META-INF/MANIFEST.MF | 4 +- .../icons/full/obj16/ReportModelFile.gif | Bin 346 -> 0 bytes .../icons/full/wizban/NewReport.gif | Bin 2462 -> 0 bytes .../plugin.properties | 12 +- .../plugin.xml | 27 - .../presentation/ArbiterEditorPlugin.java} | 10 +- .../property/presentation/PropertyEditor.java | 3 + .../presentation/PropertyEditorPlugin.java | 3 + .../presentation/PropertyModelWizard.java | 3 +- .../ReportActionBarContributor.java | 423 ---- .../report/presentation/ReportEditor.java | 1828 ----------------- .../presentation/ReportModelWizard.java | 628 ------ .../META-INF/MANIFEST.MF | 5 +- .../model/arbiter.ecore | 80 + .../model/arbiter.genmodel | 35 + .../model/property.ecore | 10 + .../model/property.genmodel | 137 +- .../model/scenario.ecore | 21 +- .../plugin.xml | 16 + .../event/commons/model/IEventManager.java | 2 + .../event/commons/model/arbiter/Arbiter.java | 85 + .../commons/model/arbiter/ArbiterFactory.java | 33 + .../commons/model/arbiter/ArbiterPackage.java | 512 +++++ .../event/commons/model/arbiter/State.java | 92 + .../commons/model/arbiter/Transition.java | 109 + .../commons/model/arbiter/TruthValue.java | 241 +++ .../arbiter/impl/ArbiterFactoryImpl.java | 134 ++ .../model/arbiter/impl/ArbiterImpl.java | 253 +++ .../arbiter/impl/ArbiterPackageImpl.java | 387 ++++ .../commons/model/arbiter/impl/StateImpl.java | 277 +++ .../model/arbiter/impl/TransitionImpl.java | 370 ++++ .../arbiter/util/ArbiterAdapterFactory.java | 157 ++ .../model/arbiter/util/ArbiterSwitch.java | 153 ++ .../model/property/EventPrecondition.java | 50 + .../model/property/PropertyFactory.java | 18 + .../model/property/PropertyPackage.java | 184 +- .../model/property/PropertyReference.java | 49 + .../property/impl/EventPreconditionImpl.java | 156 ++ .../property/impl/PropertyFactoryImpl.java | 22 + .../property/impl/PropertyPackageImpl.java | 78 +- .../property/impl/PropertyReferenceImpl.java | 156 ++ .../property/util/PropertyAdapterFactory.java | 36 + .../model/property/util/PropertySwitch.java | 44 + .../model/report/impl/ReportPackageImpl.java | 3 - .../model/scenario/EventOccurrence.java | 4 +- .../model/scenario/ScenarioElement.java | 7 +- .../commons/model/scenario/ScenarioFSM.java | 32 +- .../model/scenario/ScenarioFSMState.java | 27 + .../model/scenario/ScenarioFSMTransition.java | 33 +- .../model/scenario/ScenarioPackage.java | 90 +- .../scenario/impl/EventOccurrenceImpl.java | 5 +- .../scenario/impl/ScenarioElementImpl.java | 5 +- .../model/scenario/impl/ScenarioFSMImpl.java | 73 +- .../scenario/impl/ScenarioFSMStateImpl.java | 68 + .../impl/ScenarioFSMTransitionImpl.java | 73 +- .../scenario/impl/ScenarioPackageImpl.java | 56 +- .../scenario/util/ScenarioAdapterFactory.java | 9 +- .../model/scenario/util/ScenarioSwitch.java | 9 +- .../engine/ui/commons/RunConfiguration.java | 7 + .../AbstractSequentialExecutionEngine.java | 4 + .../api/core/IRunConfiguration.java | 3 + .../tabs/LaunchConfigurationMainTab.java | 25 + 117 files changed, 5584 insertions(+), 3364 deletions(-) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/{CreateStageReport_events_EventReport.gif => CreateCompositeProperty_properties_CompositeProperty.gif} (71%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/{CreateStage_property_ContainerReferenceProperty.gif => CreateCompositeProperty_properties_ContainerReferenceProperty.gif} (71%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/{CreateStage_property_ManyBooleanAttributeProperty.gif => CreateCompositeProperty_properties_EventPrecondition.gif} (71%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/{CreateStage_property_ManyIntegerAttributeProperty.gif => CreateCompositeProperty_properties_ManyBooleanAttributeProperty.gif} (71%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_PropertyReference.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/{CreateReport_stages_StageReport.gif => CreateScenarioElement_guard_CompositeProperty.gif} (100%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_EventPrecondition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_PropertyReference.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_CompositeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_EventPrecondition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_PropertyReference.gif delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyStringAttributeProperty.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{EventParameter.gif => Arbiter.gif} (50%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{StageReport.gif => CompositeProperty.gif} (100%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{EventReport.gif => EventPrecondition.gif} (50%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{IntegerAttributeProperty.gif => PropertyReference.gif} (50%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{Report.gif => State.gif} (50%) delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/StepProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Transition.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/ReportEditPlugin.java => arbiter/provider/ArbiterEditPlugin.java} (86%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/ReportItemProvider.java => arbiter/provider/ArbiterItemProvider.java} (72%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/ReportItemProviderAdapterFactory.java => arbiter/provider/ArbiterItemProviderAdapterFactory.java} (73%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/EventReportItemProvider.java => arbiter/provider/StateItemProvider.java} (62%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/TransitionItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/CompositePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/EventPreconditionItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyReferenceItemProvider.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/{report/presentation/ReportEditorPlugin.java => arbiter/presentation/ArbiterEditorPlugin.java} (86%) delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/arbiter.ecore create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/arbiter.genmodel create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/EventPrecondition.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyReference.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/EventPreconditionImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyReferenceImpl.java diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/META-INF/MANIFEST.MF index 05195b5d1..2ce45cd0f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/META-INF/MANIFEST.MF @@ -1,3 +1,4 @@ +Manifest-Version: 1.0 Bundle-SymbolicName: fr.inria.diverse.event.commons.interpreter; singleton:=true Export-Package: fr.inria.diverse.event.commons.interpreter.property, fr.inria.diverse.event.commons.interpreter.scenario, @@ -18,4 +19,3 @@ Require-Bundle: fr.inria.diverse.k3.al.annotationprocessor.plugin;bundle-version fr.inria.diverse.trace.commons.model Bundle-ManifestVersion: 2 Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Manifest-Version: 1.0 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/plugin.xml index ae5e481b5..ed8a9a889 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/plugin.xml +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/plugin.xml @@ -1,4 +1,7 @@ + + + \ No newline at end of file diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java index f23846b11..a3cc4b202 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java @@ -17,11 +17,13 @@ import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; import fr.inria.diverse.event.commons.interpreter.property.PropertyMonitor; +import fr.inria.diverse.event.commons.interpreter.scenario.ArbiterManager; import fr.inria.diverse.event.commons.interpreter.scenario.ScenarioManager; import fr.inria.diverse.event.commons.model.EventInstance; import fr.inria.diverse.event.commons.model.EventManagerRegistry; import fr.inria.diverse.event.commons.model.IEventManager; import fr.inria.diverse.event.commons.model.IEventManagerListener; +import fr.inria.diverse.event.commons.model.arbiter.Arbiter; import fr.inria.diverse.event.commons.model.scenario.Scenario; import fr.inria.diverse.trace.commons.model.trace.Step; @@ -38,18 +40,18 @@ public abstract class AbstractEventManager implements IEventManager { private Thread t = null; protected ScenarioManager scenarioManager; + + protected ArbiterManager arbiterManager; @Override public void sendEvent(Object input) { - if (scenarioManager == null) { - if (input instanceof EventInstance) { - eventQueue.add((EventInstance) input); - if (t != null) { - synchronized (t) { - t.notify(); - } - t = null; + if (input instanceof EventInstance) { + eventQueue.add((EventInstance) input); + if (t != null) { + synchronized (t) { + t.notify(); } + t = null; } } } @@ -110,6 +112,8 @@ public void waitForEvents() { } private Scenario pendingScenario; + + private Arbiter pendingArbiter; @Override public void loadScenario(URI uri, ResourceSet resourceSet) { @@ -122,6 +126,18 @@ public void loadScenario(URI uri, ResourceSet resourceSet) { pendingScenario = (Scenario) resource.getContents().get(0); } } + + @Override + public void loadArbiter(URI uri, ResourceSet resourceSet) { + Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); + Resource resource = resourceSet.getResource(uri.trimFragment(), true); + EcoreUtil.resolveAll(resource); + if (uri.hasFragment()) { + pendingArbiter = (Arbiter) resource.getEObject(uri.fragment()); + } else { + pendingArbiter = (Arbiter) resource.getContents().get(0); + } + } protected abstract void dispatchEvent(EventInstance event); @@ -134,6 +150,14 @@ public void engineAboutToStart(IExecutionEngine engine) { scenarioManager = new ScenarioManager(executedModel, this, monitor); } else { + } + } + if (pendingArbiter != null) { + PropertyMonitor monitor = engine.getAddon(PropertyMonitor.class); + if (monitor != null) { + arbiterManager = new ArbiterManager(monitor); + } else { + } } } @@ -145,8 +169,14 @@ public void engineInitialized(IExecutionEngine executionEngine) { @Override public void engineStarted(IExecutionEngine executionEngine) { EventManagerRegistry.getInstance().registerManager(this); - scenarioManager.loadScenario(pendingScenario); - pendingScenario = null; + if (pendingScenario != null) { + scenarioManager.loadScenario(pendingScenario); + pendingScenario = null; + } + if (pendingArbiter != null) { + arbiterManager.loadArbiter(pendingArbiter); + pendingArbiter= null; + } } @Override @@ -168,7 +198,6 @@ public void engineAboutToDispose(IExecutionEngine engine) { @SuppressWarnings("rawtypes") @Override public void aboutToSelectStep(IExecutionEngine engine, Collection steps) { - } @SuppressWarnings("rawtypes") diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java index 4c1efa482..aaf08355e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java @@ -9,20 +9,31 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.resource.Resource; import org.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; import org.gemoc.xdsmlframework.api.core.IExecutionEngine; import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; +import fr.inria.diverse.event.commons.interpreter.scenario.ElementProviderAspect; +import fr.inria.diverse.event.commons.model.EventInstance; +import fr.inria.diverse.event.commons.model.IEventManager; import fr.inria.diverse.event.commons.model.property.CompositeProperty; +import fr.inria.diverse.event.commons.model.property.EventPrecondition; import fr.inria.diverse.event.commons.model.property.Property; +import fr.inria.diverse.event.commons.model.property.PropertyReference; import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.property.StepProperty; import fr.inria.diverse.event.commons.model.property.Stepping; +import fr.inria.diverse.event.commons.model.scenario.ElementProvider; +import fr.inria.diverse.event.commons.model.scenario.Event; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import fr.inria.diverse.trace.commons.model.trace.Step; public class PropertyMonitor implements IEngineAddon, IPropertyMonitor { @@ -38,27 +49,42 @@ public class PropertyMonitor implements IEngineAddon, IPropertyMonitor { private final Set endedSteps = new HashSet<>(); private final Set endingSteps = new HashSet<>(); - + + private IEventManager eventManager; + + private boolean eventManagerAvailable = false; + private boolean monitor(Property property) { if (property == null) { return true; } + boolean result = evaluateProperty(property); + monitoredProperties.put(property, result); + return result; + } + + private boolean evaluateProperty(Property property) { boolean result = false; if (property instanceof StepProperty) { result = evaluateStepProperty((StepProperty) property); - } else { + } else if (property instanceof StateProperty) { result = evaluateStateProperty((StateProperty) property); + } else if (property instanceof CompositeProperty) { + result = evaluateCompositeProperty((CompositeProperty) property); + } else if (property instanceof EventPrecondition) { + result = evaluateEventPrecondition((EventPrecondition) property); + } else { + result = evaluateProperty(((PropertyReference) property).getReferencedProperty()); } - monitoredProperties.put(property, result); return result; } private void updateProperties() { - propertyListeners.entrySet().stream().forEach(e -> { + new HashSet<>(propertyListeners.entrySet()).stream().forEach(e -> { final Property p = e.getKey(); if (monitoredProperties.get(p) != monitor(p)) { final boolean newValue = monitoredProperties.get(p); - e.getValue().forEach(l -> l.update(newValue)); + new ArrayList<>(e.getValue()).forEach(l -> l.update(newValue)); } }); } @@ -80,9 +106,18 @@ public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { endingSteps.add(operation); updateProperties(); } + + private boolean evaluateEventPrecondition(EventPrecondition property) { + if (eventManagerAvailable) { + final EventInstance eventInstance = createEvent(property.getEvent()); + return eventInstance != null && eventManager.canSendEvent(eventInstance); + } + return false; + } private boolean evaluateCompositeProperty(CompositeProperty property) { - return property.getProperties().stream().map(p -> monitor(p)).allMatch(b -> b); + final List list = property.getProperties().stream().map(p -> evaluateProperty(p)).collect(Collectors.toList()); + return list.stream().allMatch(b -> b); } private boolean evaluateStepProperty(StepProperty property) { @@ -125,6 +160,10 @@ public void addListener(Property property, IPropertyListener listener) { } listeners.add(listener); monitoredProperties.put(property, false); + // Should the property be evaluated immediately? + if (monitor(property)) { + listener.update(true); + } } @Override @@ -145,14 +184,16 @@ public void removeListener(Property property, IPropertyListener listener) { @Override public void engineAboutToStart(IExecutionEngine engine) { executedModel = engine.getExecutionContext().getResourceModel(); + eventManager = engine.getAddonsTypedBy(IEventManager.class).stream().findFirst().orElse(null); + eventManagerAvailable = eventManager != null; } @Override - public void engineInitialized(IExecutionEngine executionEngine) { + public void engineInitialized(IExecutionEngine engine) { } @Override - public void engineStarted(IExecutionEngine executionEngine) { + public void engineStarted(IExecutionEngine engine) { } @Override @@ -189,4 +230,31 @@ public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { public List validate(List otherAddons) { return Collections.emptyList(); } + + private EventInstance createEvent(Event originalEvent) { + final ElementProvider targetProvider = originalEvent.getTargetProvider(); + final List eventParameterMatches = new ArrayList<>(); + if (targetProvider != null) { + final EObject target = ElementProviderAspect.resolve(targetProvider, executedModel); + if (target != null) { + eventParameterMatches.add(target); + final Map parameters = new HashMap<>(); + parameters.put(ScenarioPackage.Literals.EVENT__TARGET_PROVIDER, target); + for (EStructuralFeature f : originalEvent.eClass().getEStructuralFeatures()) { + if (f instanceof EAttribute) { + parameters.put(f, originalEvent.eGet(f)); + } else { + final ElementProvider paramProvider = (ElementProvider) originalEvent.eGet(f); + final EObject parameter = ElementProviderAspect.resolve(paramProvider, executedModel); + if (parameter != null) { + parameters.put(f, parameter); + eventParameterMatches.add(parameter); + } + } + } + return new EventInstance(originalEvent, parameters); + } + } + return null; + } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java index bb4c5a635..b2fbb54cf 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java @@ -1,59 +1,79 @@ package fr.inria.diverse.event.commons.interpreter.scenario; -import java.util.ArrayList; +import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; +import java.util.Map; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; - -import fr.inria.diverse.event.commons.interpreter.property.StatePropertyAspect; +import fr.inria.diverse.event.commons.interpreter.property.IPropertyListener; +import fr.inria.diverse.event.commons.interpreter.property.IPropertyMonitor; import fr.inria.diverse.event.commons.model.arbiter.Arbiter; import fr.inria.diverse.event.commons.model.arbiter.State; import fr.inria.diverse.event.commons.model.arbiter.TruthValue; -import fr.inria.diverse.event.commons.model.property.StateProperty; +import fr.inria.diverse.event.commons.model.property.Property; public class ArbiterManager { - private final Resource executedModel; - private State currentState; + private State currentState; + private final IPropertyMonitor propertyMonitor; - public ArbiterManager(Arbiter arbiter, Resource executedModel) { - this.executedModel = executedModel; - currentState = arbiter.getInitialState(); + public ArbiterManager(IPropertyMonitor propertyMonitor) { + this.propertyMonitor = propertyMonitor; } public TruthValue getTruthValue() { - currentState = currentState.getOutgoingTransitions().stream() - .filter(t -> evaluateStateProperty(t.getGuard())) - .findFirst().map(t -> t.getTarget()) - .orElse(currentState); return currentState.getTruthValue(); } - - private boolean evaluateStateProperty(StateProperty property) { - final List eventReceivers = new ArrayList<>(); - final Object target = property.getTarget(); - if (target == null) { - Set eClasses = new HashSet<>(); - property.eClass().getEAllGenericSuperTypes().stream() - .forEach(t -> t.getETypeArguments().stream().forEach(a -> eClasses.add(a.getEClassifier()))); - final Iterator it = executedModel.getAllContents(); - while (it.hasNext()) { - EObject o = it.next(); - if (eClasses.contains(o.eClass()) && StatePropertyAspect.evaluate(property, o)) { - eventReceivers.add(o); - } + + private void setupArbiterStatePropertyListeners(Arbiter arbiter, State state) { + final Map guards = new HashMap<>(); + state.getOutgoingTransitions().forEach(t -> { + final Property property = t.getGuard(); + IPropertyListener listener = new ArbiterTransitionGuardListener(arbiter, t.getTarget(), property, guards); + guards.put(property, listener); + }); + new HashSet<>(guards.keySet()).forEach(p -> { + IPropertyListener l = guards.get(p); + if (l != null) { + propertyMonitor.addListener(p, l); } - } else { - final EObject target_cast = (EObject) target; - if (StatePropertyAspect.evaluate(property, target_cast)) { - eventReceivers.add(target_cast); + }); + } + + public void loadArbiter(Arbiter arbiter) { + currentState = arbiter.getInitialState(); + } + + private class ArbiterTransitionGuardListener implements IPropertyListener { + + private final Arbiter arbiter; + private final State state; + private final Property property; + private Map guards = new HashMap<>(); + + public ArbiterTransitionGuardListener(Arbiter arbiter, State state, Property property, Map guards) { + this.arbiter = arbiter; + this.state = state; + this.property = property; + this.guards = guards; + } + + @Override + public void update(boolean propertyValue) { + if (propertyValue) { + // We stop monitoring the current guard as well as + // the guards of the other outgoing transitions of + // the previous state of the FSM. + propertyMonitor.removeListener(property, this); + currentState = state; + //----------------------- + System.out.println(currentState.getTruthValue()); + //----------------------- + guards.forEach((p, l) -> propertyMonitor.removeListener(p, l)); + guards.clear(); + // Otherwise we start monitoring the guards of the outgoing + // transitions. + setupArbiterStatePropertyListeners(arbiter, state); } } - return !eventReceivers.isEmpty(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java index 6be2380b8..a6f97ad55 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; @@ -24,7 +25,11 @@ import fr.inria.diverse.event.commons.interpreter.property.IPropertyMonitor; import fr.inria.diverse.event.commons.model.EventInstance; import fr.inria.diverse.event.commons.model.IEventManager; +import fr.inria.diverse.event.commons.model.property.CompositeProperty; +import fr.inria.diverse.event.commons.model.property.EventPrecondition; import fr.inria.diverse.event.commons.model.property.Property; +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyReference; import fr.inria.diverse.event.commons.model.report.EventReport; import fr.inria.diverse.event.commons.model.report.Report; import fr.inria.diverse.event.commons.model.report.ReportFactory; @@ -45,40 +50,113 @@ public class ScenarioManager implements IScenarioManager { private final IPropertyMonitor propertyMonitor; private final List> currentElements = new ArrayList<>(); private final Report report = ReportFactory.eINSTANCE.createReport(); + private final PropertyFactory propertyFactory = PropertyFactory.eINSTANCE; public ScenarioManager(Resource executedModel, IEventManager eventManager, IPropertyMonitor propertyMonitor) { this.executedModel = executedModel; this.eventManager = eventManager; this.propertyMonitor = propertyMonitor; } - + public void loadScenario(Scenario scenario) { this.scenario = scenario; this.scenario.getElements().forEach(element -> { - currentElements.add(element); - final Property property = element.getGuard(); - propertyMonitor.addListener(property, new ScenarioGuardListener(element, property)); + setupScenarioElementPropertyListeners(element); }); } - private void handleFSM(ScenarioFSM fsm) { - final ScenarioFSMState initialState = fsm.getInitialState(); - if (initialState.getEvent() != null) { - final EventInstance eventInstance = createEvent(initialState.getEvent()); - if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { - eventManager.sendEvent(eventInstance); + private void setupScenarioElementPropertyListeners(ScenarioElement element) { + currentElements.add(element); + final boolean isEvent = element instanceof EventOccurrence; + if (isEvent) { + handleEventOccurrence((EventOccurrence) element); + } else { + handleFSM((ScenarioFSM) element); + } + } + + private void setupFSMStatePropertyListeners(ScenarioFSM fsm, ScenarioFSMState state) { + final Map fsmGuards = new HashMap<>(); + state.getOutgoingTransitions().forEach(t -> { + final Property property = t.getGuard(); + final Event event = t.getTarget().getEvent(); + if (property != null && event != null) { + // If the FSM state sends an event, we add the event + // precondition to the guard of the transition by + // using a composite property. + final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); + final PropertyReference propertyReference = propertyFactory.createPropertyReference(); + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + propertyReference.setReferencedProperty(property); + precondition.setEvent(event); + compositeProperty.getProperties().add(propertyReference); + compositeProperty.getProperties().add(precondition); + IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), compositeProperty, fsmGuards); + fsmGuards.put(compositeProperty, listener); + } else if (property != null) { + IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), property, fsmGuards); + fsmGuards.put(property, listener); + } else if (event != null) { + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + precondition.setEvent(event); + IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), precondition, fsmGuards); + fsmGuards.put(precondition, listener); + } else { + // Degenerate case: no guard, no event precondition. + // Go directly to the target state? + fsmGuards.clear(); + setupFSMStatePropertyListeners(fsm, t.getTarget()); } - final Map fsmGuards = new HashMap<>(); - initialState.getOutgoingTransitions().forEach(t -> { - final Property property = t.getGuard(); - if (property != null) { - IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), property, fsmGuards); - fsmGuards.put(property, listener); - } - }); - fsmGuards.forEach((p, l) -> { + }); + new HashSet<>(fsmGuards.keySet()).forEach(p -> { + IPropertyListener l = fsmGuards.get(p); + if (l != null) { propertyMonitor.addListener(p, l); - }); + } + }); + } + + private void handleEventOccurrence(EventOccurrence eventOccurrence) { + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + precondition.setEvent((eventOccurrence).getEvent()); + final Property property = eventOccurrence.getGuard(); + if (property != null) { + // We create a composite property containing + // both the guard of the event and the event precondition. + final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); + final PropertyReference propertyReference = propertyFactory.createPropertyReference(); + propertyReference.setReferencedProperty(property); + compositeProperty.getProperties().add(propertyReference); + compositeProperty.getProperties().add(precondition); + propertyMonitor.addListener(compositeProperty, new ScenarioGuardListener(eventOccurrence, compositeProperty)); + } else { + propertyMonitor.addListener(precondition, new ScenarioGuardListener(eventOccurrence, precondition)); + } + } + + private void handleFSM(ScenarioFSM fsm) { + final ScenarioFSMState initialState = fsm.getInitialState(); + final Property property = fsm.getGuard(); + final Event event = initialState.getEvent(); + if (event != null && property != null) { + // We create a composite property containing + // both the guard of the fsm and the event precondition + final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); + final PropertyReference propertyReference = propertyFactory.createPropertyReference(); + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + propertyReference.setReferencedProperty(property); + precondition.setEvent(event); + compositeProperty.getProperties().add(propertyReference); + compositeProperty.getProperties().add(precondition); + propertyMonitor.addListener(compositeProperty, new ScenarioGuardListener(fsm, compositeProperty)); + } else if (event != null) { + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + precondition.setEvent(event); + propertyMonitor.addListener(precondition, new ScenarioGuardListener(fsm, precondition)); + } else if (property != null) { + propertyMonitor.addListener(property, new ScenarioGuardListener(fsm, property)); + } else { + setupFSMStatePropertyListeners(fsm, initialState); } } @@ -164,25 +242,28 @@ public ScenarioGuardListener(ScenarioElement element, Property property) { @Override public void update(boolean propertyValue) { if (propertyValue) { - currentElements.remove(element); - currentElements.addAll(element.getNextElements()); // We stop monitoring the guard of this scenario element. propertyMonitor.removeListener(property, this); if (element instanceof EventOccurrence) { + currentElements.remove(element); + currentElements.addAll(element.getNextElements()); final EventOccurrence eventOccurrence = (EventOccurrence) element; - final EventInstance eventInstance = createEvent(eventOccurrence.getEvent()); - if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { - eventManager.sendEvent(eventInstance); - } - // We start monitoring the guards of the next elements in the scenario tree. + eventManager.sendEvent(createEvent(eventOccurrence.getEvent())); + // We start monitoring the guards of the next elements in + // the scenario tree. eventOccurrence.getNextElements().stream().forEach(e -> { - final Property property = e.getGuard(); - propertyMonitor.addListener(property, new ScenarioGuardListener(e, property)); + setupScenarioElementPropertyListeners(e); }); } else { - // We do not monitor the guards of the next elements in the scenario tree - // because they are only evaluated when the FSM reaches an accepting state. - handleFSM((ScenarioFSM) element); + // We do not monitor the guards of the next elements in the + // scenario tree yet because they must only be evaluated once the + // FSM reaches an accepting state. + final ScenarioFSM fsm = (ScenarioFSM) element; + final Event event = fsm.getInitialState().getEvent(); + if (event != null) { + eventManager.sendEvent(createEvent(event)); + } + setupFSMStatePropertyListeners(fsm, fsm.getInitialState()); } } } @@ -206,39 +287,32 @@ public FSMGuardListener(ScenarioFSM fsm, ScenarioFSMState stat @Override public void update(boolean propertyValue) { if (propertyValue) { - // We send the event associated to the newly reached state of the FSM, if any. - final EventInstance eventInstance = createEvent(state.getEvent()); - if (eventInstance != null && eventManager.canSendEvent(eventInstance)) { - eventManager.sendEvent(eventInstance); + // We send the event associated to the newly reached state of + // the FSM, if any. We do not have to check if it can be sent + // as this check is part of the guard of the incoming transition. + final Event event = state.getEvent(); + if (event != null) { + eventManager.sendEvent(createEvent(event)); } - // We stop monitoring the current guard as well as the guards of the - // other outgoing transitions of the previous state of the FSM. + // We stop monitoring the current guard as well as + // the guards of the other outgoing transitions of + // the previous state of the FSM. propertyMonitor.removeListener(property, this); fsmGuards.forEach((p, l) -> propertyMonitor.removeListener(p, l)); fsmGuards.clear(); if (fsm.getAcceptingStates().contains(state)) { - // The FSM has reached an accepting state, thus we start monitoring - // the guards of the next elements in the scenario tree. + // The FSM has reached an accepting state, thus we start + // monitoring the guards of the next elements in the + // scenario tree. currentElements.remove(fsm); currentElements.addAll(fsm.getNextElements()); - propertyMonitor.removeListener(property, this); - fsm.getNextElements().stream().filter(e -> e instanceof EventOccurrence).forEach(e -> { - final Property property = e.getGuard(); - propertyMonitor.addListener(property, new ScenarioGuardListener(e, property)); + fsm.getNextElements().stream().forEach(e -> { + setupScenarioElementPropertyListeners(e); }); } else { - // Otherwise we start monitoring the guards of the outgoing transitions. - final Map fsmGuards = new HashMap<>(); - state.getOutgoingTransitions().forEach(t -> { - final Property property = t.getGuard(); - if (property != null) { - IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), property, fsmGuards); - fsmGuards.put(property, listener); - } - }); - fsmGuards.forEach((p, l) -> { - propertyMonitor.addListener(p, l); - }); + // Otherwise we start monitoring the guards of the outgoing + // transitions. + setupFSMStatePropertyListeners(fsm, state); } } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF index 58cf93d95..c119eff3f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF @@ -4,13 +4,13 @@ Bundle-Name: %pluginName Bundle-SymbolicName: fr.inria.diverse.event.commons.model.edit;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: fr.inria.diverse.event.commons.model.scenario.provider.ScenarioEditPlugin$Implementation +Bundle-Activator: fr.inria.diverse.event.commons.model.arbiter.provider.ArbiterEditPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: fr.inria.diverse.event.commons.model.property.provider, fr.inria.diverse.event.commons.model.scenario.provider, - fr.inria.diverse.event.commons.model.report.provider + fr.inria.diverse.event.commons.model.arbiter.provider Require-Bundle: org.eclipse.core.runtime, fr.inria.diverse.event.commons.model;visibility:=reexport, org.eclipse.emf.edit;visibility:=reexport, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStageReport_events_EventReport.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_CompositeProperty.gif similarity index 71% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStageReport_events_EventReport.gif rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_CompositeProperty.gif index b3aa68896f4ec7cacaea452a8f2b4377834d89ff..cb3d509b1b9253d44e3ad8b6dd020ff614cc5d8c 100644 GIT binary patch delta 22 ecmcc5c%N~CB+r2Z2j>u=#1IfX3We$z`+0iU!Pw;|KC4=fPnk;_3XvP-=Ck-d3ljN EqLBz3`2YX_ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_ManyBooleanAttributeProperty.gif similarity index 71% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyIntegerAttributeProperty.gif rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_ManyBooleanAttributeProperty.gif index 9a2424e4ee9ccfda799455e1f82167eb536f8123..457a698268ff8fedecd1d404ccc56aa649f027d5 100644 GIT binary patch delta 46 zcmV+}0MY;70p9_T86>>u=#1IfX3We$z`+0iU!Pw;|KC4=fPlcjz?__%d8X1pKtPc_ EqIr25f&c&j delta 46 zcmV+}0MY;70p9_T86@@l^~LPPpWmN((s}>?U!Pw;|KC4=fPnk;_3XvP-=Ck-d3ljN EqN|x5tpET3 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_ManyIntegerAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..40c20f76ec84dfe60d012d4f592db82211461721 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6eEt3P=$oVS@6WHiRQdmZ{QP+P|M%@1 z8X689I520Um4mOV*ROub(! zIny~%WA^eB>>_$UdnNzv!5>R~CbTuH_I!Sq5m;BNusd<%RGfRa3{e2Hae?OlGqCd|U|GwJ{Gz|h2 zf3h%wSUMmAWG4e_jDkX6N~E0{!_2dXr(D=NslT~zQi-SWXOo_5*^@NI)cd89Go1r9 zW-mX%F4Ctp=hR6zD+V34``#`V0znP4UnG23bh4dkVS=0djh33*xmu@Rrsp%{)HJ0w LHf5_SGFSru1iE0s literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_PropertyReference.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateCompositeProperty_properties_PropertyReference.gif new file mode 100644 index 0000000000000000000000000000000000000000..20e5447502097db2434aafbe6de1971925b56902 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?78%!XVcBJnP(gt4*dTgKR@37|9$(0 zhK2(N4$PS|r*hdP2M32;)75}z>m=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2giC>8X>ZF?$gO1vLZx;)JpoZBm5+YZ#L@u~AUhdYV-ytnQX=it7-pV5JmtdHN&U@zlS({|Kb!Pi%buhurrs}= zoar2>F?;z5c9A}8}5D03R{UYJRqLb}R3lrSrZ?x3h&eb~oGCiLm Pr=}^ju_;?sk--`OEHY!> literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_ManyBooleanAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..a47b32b7d9b44ea2d815901ae43becbeeedfca1e GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?0NB`=jP3{GiMwQ9Qgk~etx|D|NHh0 z4GqZRyQZrF(bh@I>$>EZHc8E^6q{Kh{O|93Ao~0HJP`ePzWDduW}s;hp!k!85ya8~ z5g+&ksNMH=u@DGqnEfK*!=jVzObZj-6>ylsEBsH&6Y-Wk@zrXK+=Y&-2B!EQ}zQ4u}BR$-o+;pwO2RX{W|8^X%a%7q(97Z|<8^;%WTZq~}`pBuz2(eyQY4 z=Rl3w%TKV2^l8mGb<)j>K}YSrw~K{9P{ZsO2_F`nY-d`S;3j{grRH|7*6Ek&`3yNV NO{tAd*{X^R)&ME~VuSzy literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_PropertyReference.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioElement_guard_PropertyReference.gif new file mode 100644 index 0000000000000000000000000000000000000000..69741809155a26ab2733c0ba1d924a9492ed5376 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?78%!XVcBJnP(gt4*dTgKR@37|9$(0 zhK4;aUi93&nRe!k!+`_4rmF$b)=A3iy5yHONzJPin^_|K@9%pc`uq7j5dC?+`1jpr zplJ}G_>+YZ#L@u~AUhdYV-ytnQX=it7-pV5JmtdHN&U@zlS({|Kb!Pi%buhurrs}= zoar2>F?;z5c9A}8}5D03R{UYJRqLb}R3lrSrZ?x3h&eb~oGCiLm Pr=}^ju_;?sk--`ODkEdw literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_CompositeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_CompositeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..8cd9cfa90b9033e3f6cda28795dddee7b369e97f GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b&YU@w%Pu)MIQ;(~KR@37|9$(0 zh6ac@kYPMCZP#=)Alf=fd0m(M(k7{Sm0~kXg#Z104@7@Ip9i8p&lmr`+YB@f0u+C; zFoIY*AOd7318aB0{}QvVF>^L literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..9dc67ff8bac2a856a54290e5c1b17d5c303f09ad GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ z1&Ys^GY7~po|(35x*8B|ous_3OMYpS)VxZunI*#i{=NsIzn{+o(Vypwf8T8eng#)i zKUo+-EFBO5vXg-|MnR!3CDKlfVdmMxQ!Z?s)Zg4Usl?Oxvq{gj>`9tp>its5na+V4 zvzMP>7wOZQbLym<6@!l2eQy^FfuM%jFA_d1I@!*&Fu_g!MoZ1@T&>eD)AJc}YMN3T Ko3d3E8LRC>8X>ZF?$gO1vLZx;)JpoZBm5JIv@gMCj)DYfrlb&nYlQhND`=ydI zodY#yFF(O9(x)}&)JZoh1|7Bg-YymbK@GECBz#zOvYlyRf}8w}mYUnSTBl#8=QHHg OG^I8+WvePOSOWlu-(t)F literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ManyIntegerAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..7f8e88eb17bf19f5e72e4529486af5078cdb0068 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6eEt3P=$oVS@6WHiRQdmZ{QP+P|M%@1 z8X689I520<93aDZX4MmLCOy}(CuxeQ_e&*b zItOaZUVegIq)%(ksgrJ23_5D}yf*NMONcgbmWINNs1ULB`Ej71uwNAfG&u7S~ OX-aKu%2rimum%7UOJjfl literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_ManyStringAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..84d142daee98162d18444e4238b4b0a5fcec9dd1 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`Oxl@-h6V=*hyVZM=f~Uszi$uZ z0>$UdnFC}P&rI7jT@8q~PEuaiCBL*uYF?$-%o5>$f8PVq-_PfP=+E=Tzwb5!O@jc% zpDc_ZmJWyj*~!2fqoB~25^1N#F!Su;DHpa*>Tm9wRN`s;*`()M_9RU)^?s@3Oy@w2 z*~?F`i}Y#DId#&_ia|&1zPF2oKv2W%7YQF0oor`XnBXRVqow9{uGZ<7>G=#fHBG6F KP1&l74AuYyF<`;~ literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_PropertyReference.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateScenarioFSMTransition_guard_PropertyReference.gif new file mode 100644 index 0000000000000000000000000000000000000000..d8233b0ffd42e8dc2a3681451b171eefbd4be8cc GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?78%!XVcBJnP(gt4*dTgKR@37|9$(0 zhK2(N4$PS|2gopC>8X>ZF?$gO1vLZx;)JpoZBm5C>8X>ZF?$gO1vLZx;)JpoZBm5kc+ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventParameter.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Arbiter.gif similarity index 50% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventParameter.gif rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Arbiter.gif index 8a5c70cbd74c87cb3b1df383e0c242ede4660c3b..83afb9b3c9a3c3e261dd043d2232d39254ac8e4a 100644 GIT binary patch delta 22 ecmZo9kF>bpZftvkAHY delta 22 ecmZo)rJFsQ&ZNye;LtG9)&&4{^9sBG delta 22 ecmZojD66B?;sJ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Report.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/State.gif similarity index 50% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Report.gif rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/State.gif index 33854e98c25a13543eb9477dc67b0baf87fc81aa..cb1755a712505aeaaa447d9b1cc5940e602f87b6 100644 GIT binary patch delta 22 ecmZojD672?`wm delta 22 ecmZo2)>|nFUJDj}wbA=HP3@{#dCy8s Se%p3@myECp}m1wRrvIn+pHKLf7r4thZ7UycR6{YNPjYn%Y&f W@}8BN{JP5-JKc^<6cT1+um%9tY%ntb literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties index 98dc5a6f3..219afec4b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties @@ -12,6 +12,9 @@ _UI_CreateSibling_description = Create a new sibling of type {0} for the selecte _UI_PropertyDescriptor_description = The {0} of the {1} +_UI_Property_type = Property +_UI_CompositeProperty_type = Composite Property +_UI_EventPrecondition_type = Event Precondition _UI_StateProperty_type = State Property _UI_BinaryProperty_type = Binary Property _UI_ManyReferenceProperty_type = Many Reference Property @@ -24,10 +27,13 @@ _UI_BooleanAttributeProperty_type = Boolean Attribute Property _UI_IntegerAttributeProperty_type = Integer Attribute Property _UI_StringAttributeProperty_type = String Attribute Property _UI_StepProperty_type = Step Property +_UI_PropertyReference_type = Reference _UI_Unknown_type = Object _UI_Unknown_datatype= Value +_UI_CompositeProperty_properties_feature = Properties +_UI_EventPrecondition_event_feature = Event _UI_StateProperty_target_feature = Target _UI_BinaryProperty_operator_feature = Operator _UI_BinaryProperty_left_feature = Left @@ -51,6 +57,8 @@ _UI_IntegerAttributeProperty_value_feature = Value _UI_IntegerAttributeProperty_operator_feature = Operator _UI_StringAttributeProperty_value_feature = Value _UI_StringAttributeProperty_operator_feature = Operator +_UI_StepProperty_stepping_feature = Stepping +_UI_PropertyReference_referencedProperty_feature = Referenced Property _UI_Unknown_feature = Unspecified _UI_Operator_EQUAL_literal = EQUAL @@ -59,31 +67,52 @@ _UI_BooleanOperator_OR_literal = OR _UI_BooleanOperator_IMPLIES_literal = IMPLIES _UI_Quantifier_EXISTS_literal = EXISTS _UI_Quantifier_FORALL_literal = FORALL +_UI_Stepping_ONGOING_literal = ONGOING +_UI_Stepping_ENDED_literal = ENDED +_UI_Stepping_ENDING_literal = ENDING _UI_Scenario_type = Scenario _UI_Event_type = Event -_UI_Stage_type = Stage _UI_ElementProvider_type = Element Provider _UI_ElementReference_type = Element Reference _UI_ElementQuery_type = Element Query -_UI_TestSuite_type = Test Suite -_UI_Date_type = Date -_UI_Phase_type = Phase -_UI_Scenario_phases_feature = Phases +_UI_EventOccurrence_type = Event Occurrence +_UI_ScenarioElement_type = Element +_UI_ScenarioFSM_type = FSM +_UI_ScenarioFSMState_type = FSM State +_UI_ScenarioFSMTransition_type = FSM Transition +_UI_Scenario_elements_feature = Elements _UI_Event_targetProvider_feature = Target Provider -_UI_Stage_property_feature = Property _UI_ElementReference_element_feature = Element _UI_ElementQuery_query_feature = Query -_UI_TestSuite_tests_feature = Tests -_UI_Date_time_feature = Time -_UI_Phase_event_feature = Event -_UI_Report_type = Report -_UI_StageReport_type = Stage Report -_UI_EventReport_type = Event Report -_UI_EventParameter_type = Event Parameter -_UI_Report_stages_feature = Stages -_UI_StageReport_stage_feature = Stage -_UI_StageReport_matches_feature = Matches -_UI_StageReport_events_feature = Events -_UI_EventReport_event_feature = Event -_UI_EventReport_matches_feature = Matches -_UI_EventReport_target_feature = Target +_UI_EventOccurrence_event_feature = Event +_UI_EventOccurrence_time_feature = Time +_UI_ScenarioElement_nextElements_feature = Next Elements +_UI_ScenarioElement_guard_feature = Guard +_UI_ScenarioFSM_states_feature = States +_UI_ScenarioFSM_initialState_feature = Initial State +_UI_ScenarioFSM_acceptingStates_feature = Accepting States +_UI_ScenarioFSM_transitions_feature = Transitions +_UI_ScenarioFSM_name_feature = Name +_UI_ScenarioFSMState_event_feature = Event +_UI_ScenarioFSMState_outgoingTransitions_feature = Outgoing Transitions +_UI_ScenarioFSMState_incomingTransitions_feature = Incoming Transitions +_UI_ScenarioFSMState_name_feature = Name +_UI_ScenarioFSMTransition_guard_feature = Guard +_UI_ScenarioFSMTransition_source_feature = Source +_UI_ScenarioFSMTransition_target_feature = Target +_UI_ScenarioFSMTransition_name_feature = Name +_UI_Arbiter_type = Arbiter +_UI_State_type = State +_UI_Transition_type = Transition +_UI_Arbiter_states_feature = States +_UI_Arbiter_transitions_feature = Transitions +_UI_Arbiter_initialState_feature = Initial State +_UI_State_truthValue_feature = Truth Value +_UI_State_outgoingTransitions_feature = Outgoing Transitions +_UI_State_incomingTransitions_feature = Incoming Transitions +_UI_Transition_source_feature = Source +_UI_Transition_target_feature = Target +_UI_Transition_guard_feature = Guard +_UI_TruthValue_TRUE_literal = TRUE +_UI_TruthValue_FALSE_literal = FALSE +_UI_TruthValue_INCONCLUSIVE_literal = INCONCLUSIVE diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml index c69b5dc22..11b1c4f72 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml @@ -33,10 +33,10 @@ - + getPropertyDescriptors(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ReportPackage.Literals.REPORT__EVENTS); + childrenFeatures.add(ArbiterPackage.Literals.ARBITER__STATES); + childrenFeatures.add(ArbiterPackage.Literals.ARBITER__TRANSITIONS); } return childrenFeatures; } @@ -96,14 +120,14 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { } /** - * This returns Report.gif. + * This returns Arbiter.gif. * * * @generated */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Report")); + return overlayImage(object, getResourceLocator().getImage("full/obj16/Arbiter")); } /** @@ -114,7 +138,7 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - return getString("_UI_Report_type"); + return getString("_UI_Arbiter_type"); } @@ -129,8 +153,9 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(Report.class)) { - case ReportPackage.REPORT__EVENTS: + switch (notification.getFeatureID(Arbiter.class)) { + case ArbiterPackage.ARBITER__STATES: + case ArbiterPackage.ARBITER__TRANSITIONS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -147,11 +172,6 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (ReportPackage.Literals.REPORT__EVENTS, - ReportFactory.eINSTANCE.createEventReport())); } /** @@ -162,7 +182,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors */ @Override public ResourceLocator getResourceLocator() { - return ReportEditPlugin.INSTANCE; + return ArbiterEditPlugin.INSTANCE; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProviderAdapterFactory.java similarity index 73% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProviderAdapterFactory.java index 9e8b1855f..b3270e17c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProviderAdapterFactory.java @@ -1,8 +1,8 @@ /** */ -package fr.inria.diverse.event.commons.model.report.provider; +package fr.inria.diverse.event.commons.model.arbiter.provider; -import fr.inria.diverse.event.commons.model.report.util.ReportAdapterFactory; +import fr.inria.diverse.event.commons.model.arbiter.util.ArbiterAdapterFactory; import java.util.ArrayList; import java.util.Collection; @@ -32,7 +32,7 @@ * * @generated */ -public class ReportItemProviderAdapterFactory extends ReportAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { +public class ArbiterItemProviderAdapterFactory extends ArbiterAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { /** * This keeps track of the root adapter factory that delegates to this adapter factory. * @@ -63,7 +63,7 @@ public class ReportItemProviderAdapterFactory extends ReportAdapterFactory imple * * @generated */ - public ReportItemProviderAdapterFactory() { + public ArbiterItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); @@ -71,52 +71,6 @@ public ReportItemProviderAdapterFactory() { supportedTypes.add(IItemPropertySource.class); } - /** - * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.Report} instances. - * - * - * @generated - */ - protected ReportItemProvider reportItemProvider; - - /** - * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.Report}. - * - * - * @generated - */ - @Override - public Adapter createReportAdapter() { - if (reportItemProvider == null) { - reportItemProvider = new ReportItemProvider(this); - } - - return reportItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.EventReport} instances. - * - * - * @generated - */ - protected EventReportItemProvider eventReportItemProvider; - - /** - * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.EventReport}. - * - * - * @generated - */ - @Override - public Adapter createEventReportAdapter() { - if (eventReportItemProvider == null) { - eventReportItemProvider = new EventReportItemProvider(this); - } - - return eventReportItemProvider; - } - /** * This returns the root adapter factory that contains this factory. * @@ -216,8 +170,6 @@ public void fireNotifyChanged(Notification notification) { * @generated */ public void dispose() { - if (reportItemProvider != null) reportItemProvider.dispose(); - if (eventReportItemProvider != null) eventReportItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/StateItemProvider.java similarity index 62% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/StateItemProvider.java index 1c0236fcc..9689a5101 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/StateItemProvider.java @@ -1,10 +1,11 @@ /** */ -package fr.inria.diverse.event.commons.model.report.provider; +package fr.inria.diverse.event.commons.model.arbiter.provider; -import fr.inria.diverse.event.commons.model.report.EventReport; -import fr.inria.diverse.event.commons.model.report.ReportPackage; +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.TruthValue; import java.util.Collection; import java.util.List; @@ -26,12 +27,12 @@ import org.eclipse.emf.edit.provider.ViewerNotification; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.EventReport} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.arbiter.State} object. * * * @generated */ -public class EventReportItemProvider +public class StateItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, @@ -45,7 +46,7 @@ public class EventReportItemProvider * * @generated */ - public EventReportItemProvider(AdapterFactory adapterFactory) { + public StateItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -60,50 +61,49 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - addEventPropertyDescriptor(object); - addMatchesPropertyDescriptor(object); - addTargetPropertyDescriptor(object); - addTimePropertyDescriptor(object); + addTruthValuePropertyDescriptor(object); + addOutgoingTransitionsPropertyDescriptor(object); + addIncomingTransitionsPropertyDescriptor(object); } return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Event feature. + * This adds a property descriptor for the Truth Value feature. * * * @generated */ - protected void addEventPropertyDescriptor(Object object) { + protected void addTruthValuePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_EventReport_event_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_EventReport_event_feature", "_UI_EventReport_type"), - ReportPackage.Literals.EVENT_REPORT__EVENT, + getString("_UI_State_truthValue_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_State_truthValue_feature", "_UI_State_type"), + ArbiterPackage.Literals.STATE__TRUTH_VALUE, true, false, - true, - null, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Matches feature. + * This adds a property descriptor for the Outgoing Transitions feature. * * * @generated */ - protected void addMatchesPropertyDescriptor(Object object) { + protected void addOutgoingTransitionsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_EventReport_matches_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_EventReport_matches_feature", "_UI_EventReport_type"), - ReportPackage.Literals.EVENT_REPORT__MATCHES, + getString("_UI_State_outgoingTransitions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_State_outgoingTransitions_feature", "_UI_State_type"), + ArbiterPackage.Literals.STATE__OUTGOING_TRANSITIONS, true, false, true, @@ -113,19 +113,19 @@ protected void addMatchesPropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Target feature. + * This adds a property descriptor for the Incoming Transitions feature. * * * @generated */ - protected void addTargetPropertyDescriptor(Object object) { + protected void addIncomingTransitionsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_EventReport_target_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_EventReport_target_feature", "_UI_EventReport_type"), - ReportPackage.Literals.EVENT_REPORT__TARGET, + getString("_UI_State_incomingTransitions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_State_incomingTransitions_feature", "_UI_State_type"), + ArbiterPackage.Literals.STATE__INCOMING_TRANSITIONS, true, false, true, @@ -135,36 +135,14 @@ protected void addTargetPropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Time feature. - * - * - * @generated - */ - protected void addTimePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_EventReport_time_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_EventReport_time_feature", "_UI_EventReport_type"), - ReportPackage.Literals.EVENT_REPORT__TIME, - true, - false, - false, - ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns EventReport.gif. + * This returns State.gif. * * * @generated */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/EventReport")); + return overlayImage(object, getResourceLocator().getImage("full/obj16/State")); } /** @@ -175,8 +153,11 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - EventReport eventReport = (EventReport)object; - return getString("_UI_EventReport_type") + " " + eventReport.getTime(); + TruthValue labelValue = ((State)object).getTruthValue(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_State_type") : + getString("_UI_State_type") + " " + label; } @@ -191,8 +172,8 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(EventReport.class)) { - case ReportPackage.EVENT_REPORT__TIME: + switch (notification.getFeatureID(State.class)) { + case ArbiterPackage.STATE__TRUTH_VALUE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } @@ -219,7 +200,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors */ @Override public ResourceLocator getResourceLocator() { - return ReportEditPlugin.INSTANCE; + return ArbiterEditPlugin.INSTANCE; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/TransitionItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/TransitionItemProvider.java new file mode 100644 index 000000000..9a617ee29 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/TransitionItemProvider.java @@ -0,0 +1,192 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.provider; + + +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; + +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.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.arbiter.Transition} object. + * + * + * @generated + */ +public class TransitionItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public TransitionItemProvider(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); + + addSourcePropertyDescriptor(object); + addTargetPropertyDescriptor(object); + addGuardPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Source feature. + * + * + * @generated + */ + protected void addSourcePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Transition_source_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Transition_source_feature", "_UI_Transition_type"), + ArbiterPackage.Literals.TRANSITION__SOURCE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Transition_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Transition_target_feature", "_UI_Transition_type"), + ArbiterPackage.Literals.TRANSITION__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Guard feature. + * + * + * @generated + */ + protected void addGuardPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Transition_guard_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Transition_guard_feature", "_UI_Transition_type"), + ArbiterPackage.Literals.TRANSITION__GUARD, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Transition.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Transition")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_Transition_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 ArbiterEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/CompositePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/CompositePropertyItemProvider.java new file mode 100644 index 000000000..f5c603b70 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/CompositePropertyItemProvider.java @@ -0,0 +1,172 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.CompositeProperty; +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.CompositeProperty} object. + * + * + * @generated + */ +public class CompositePropertyItemProvider extends PropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public CompositePropertyItemProvider(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(PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES); + } + 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 CompositeProperty.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/CompositeProperty")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_CompositeProperty_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); + + switch (notification.getFeatureID(CompositeProperty.class)) { + case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: + 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 + (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, + PropertyFactory.eINSTANCE.createCompositeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, + PropertyFactory.eINSTANCE.createEventPrecondition())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, + PropertyFactory.eINSTANCE.createPropertyReference())); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/EventPreconditionItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/EventPreconditionItemProvider.java new file mode 100644 index 000000000..a9f6a67b5 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/EventPreconditionItemProvider.java @@ -0,0 +1,120 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.IItemPropertyDescriptor; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.EventPrecondition} object. + * + * + * @generated + */ +public class EventPreconditionItemProvider extends PropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public EventPreconditionItemProvider(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); + + addEventPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Event feature. + * + * + * @generated + */ + protected void addEventPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_EventPrecondition_event_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventPrecondition_event_feature", "_UI_EventPrecondition_type"), + PropertyPackage.Literals.EVENT_PRECONDITION__EVENT, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns EventPrecondition.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/EventPrecondition")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_EventPrecondition_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); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java index 71f421d4e..5aa220514 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/IntegerAttributePropertyItemProvider.java @@ -95,17 +95,6 @@ protected void addOperatorPropertyDescriptor(Object object) { null)); } - /** - * This returns IntegerAttributeProperty.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/IntegerAttributeProperty")); - } - /** * This returns the label text for the adapted class. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyEditPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyEditPlugin.java index 632e9b436..7bf311045 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyEditPlugin.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyEditPlugin.java @@ -2,6 +2,8 @@ */ package fr.inria.diverse.event.commons.model.property.provider; +import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioEditPlugin; + import org.eclipse.emf.common.EMFPlugin; import org.eclipse.emf.common.util.ResourceLocator; @@ -41,6 +43,7 @@ public PropertyEditPlugin() { super (new ResourceLocator [] { EcoreEditPlugin.INSTANCE, + ScenarioEditPlugin.INSTANCE, }); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java index b8e1d88ee..1bef6a799 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java @@ -58,17 +58,6 @@ public List getPropertyDescriptors(Object object) { return itemPropertyDescriptors; } - /** - * This returns Property.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Property")); - } - /** * This returns the label text for the adapted class. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java index 3f234703d..652edf953 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java @@ -71,6 +71,52 @@ public PropertyItemProviderAdapterFactory() { supportedTypes.add(IItemPropertySource.class); } + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.CompositeProperty} instances. + * + * + * @generated + */ + protected CompositePropertyItemProvider compositePropertyItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.CompositeProperty}. + * + * + * @generated + */ + @Override + public Adapter createCompositePropertyAdapter() { + if (compositePropertyItemProvider == null) { + compositePropertyItemProvider = new CompositePropertyItemProvider(this); + } + + return compositePropertyItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.EventPrecondition} instances. + * + * + * @generated + */ + protected EventPreconditionItemProvider eventPreconditionItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.EventPrecondition}. + * + * + * @generated + */ + @Override + public Adapter createEventPreconditionAdapter() { + if (eventPreconditionItemProvider == null) { + eventPreconditionItemProvider = new EventPreconditionItemProvider(this); + } + + return eventPreconditionItemProvider; + } + /** * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty} instances. * @@ -163,6 +209,29 @@ public Adapter createManyStringAttributePropertyAdapter() { return manyStringAttributePropertyItemProvider; } + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.PropertyReference} instances. + * + * + * @generated + */ + protected PropertyReferenceItemProvider propertyReferenceItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.PropertyReference}. + * + * + * @generated + */ + @Override + public Adapter createPropertyReferenceAdapter() { + if (propertyReferenceItemProvider == null) { + propertyReferenceItemProvider = new PropertyReferenceItemProvider(this); + } + + return propertyReferenceItemProvider; + } + /** * This returns the root adapter factory that contains this factory. * @@ -262,10 +331,13 @@ public void fireNotifyChanged(Notification notification) { * @generated */ public void dispose() { + if (compositePropertyItemProvider != null) compositePropertyItemProvider.dispose(); + if (eventPreconditionItemProvider != null) eventPreconditionItemProvider.dispose(); if (containerReferencePropertyItemProvider != null) containerReferencePropertyItemProvider.dispose(); if (manyBooleanAttributePropertyItemProvider != null) manyBooleanAttributePropertyItemProvider.dispose(); if (manyIntegerAttributePropertyItemProvider != null) manyIntegerAttributePropertyItemProvider.dispose(); if (manyStringAttributePropertyItemProvider != null) manyStringAttributePropertyItemProvider.dispose(); + if (propertyReferenceItemProvider != null) propertyReferenceItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyReferenceItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyReferenceItemProvider.java new file mode 100644 index 000000000..753046a62 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyReferenceItemProvider.java @@ -0,0 +1,120 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.IItemPropertyDescriptor; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.PropertyReference} object. + * + * + * @generated + */ +public class PropertyReferenceItemProvider extends PropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public PropertyReferenceItemProvider(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); + + addReferencedPropertyPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Referenced Property feature. + * + * + * @generated + */ + protected void addReferencedPropertyPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_PropertyReference_referencedProperty_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_PropertyReference_referencedProperty_feature", "_UI_PropertyReference_type"), + PropertyPackage.Literals.PROPERTY_REFERENCE__REFERENCED_PROPERTY, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns PropertyReference.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/PropertyReference")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_PropertyReference_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); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java index b7fd70cce..ebc2bf157 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java @@ -6,6 +6,7 @@ import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.StepProperty; import fr.inria.diverse.event.commons.model.property.Stepping; + import java.util.Collection; import java.util.List; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java index 860d28d58..9f4903ba5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java @@ -18,7 +18,6 @@ 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; @@ -63,33 +62,10 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - addNextElementsPropertyDescriptor(object); } return itemPropertyDescriptors; } - /** - * This adds a property descriptor for the Next Elements feature. - * - * - * @generated - */ - protected void addNextElementsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_ScenarioElement_nextElements_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_ScenarioElement_nextElements_feature", "_UI_ScenarioElement_type"), - ScenarioPackage.Literals.SCENARIO_ELEMENT__NEXT_ELEMENTS, - true, - false, - true, - null, - 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 @@ -102,6 +78,7 @@ protected void addNextElementsPropertyDescriptor(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); + childrenFeatures.add(ScenarioPackage.Literals.SCENARIO_ELEMENT__NEXT_ELEMENTS); childrenFeatures.add(ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD); } return childrenFeatures; @@ -144,6 +121,7 @@ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ScenarioElement.class)) { + case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: case ScenarioPackage.SCENARIO_ELEMENT__GUARD: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; @@ -162,6 +140,16 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, + PropertyFactory.eINSTANCE.createCompositeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, + PropertyFactory.eINSTANCE.createEventPrecondition())); + newChildDescriptors.add (createChildParameter (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, @@ -181,6 +169,11 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors (createChildParameter (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, + PropertyFactory.eINSTANCE.createPropertyReference())); } /** diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMItemProvider.java index 5a84db060..e0682503a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMItemProvider.java @@ -16,6 +16,7 @@ import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; /** @@ -48,6 +49,7 @@ public List getPropertyDescriptors(Object object) { addInitialStatePropertyDescriptor(object); addAcceptingStatesPropertyDescriptor(object); + addNamePropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -96,6 +98,28 @@ protected void addAcceptingStatesPropertyDescriptor(Object object) { null)); } + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioFSM_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioFSM_name_feature", "_UI_ScenarioFSM_type"), + ScenarioPackage.Literals.SCENARIO_FSM__NAME, + 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 @@ -135,7 +159,10 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { */ @Override public String getText(Object object) { - return getString("_UI_ScenarioFSM_type"); + String label = ((ScenarioFSM)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_ScenarioFSM_type") : + getString("_UI_ScenarioFSM_type") + " " + label; } @@ -151,6 +178,9 @@ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ScenarioFSM.class)) { + case ScenarioPackage.SCENARIO_FSM__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; case ScenarioPackage.SCENARIO_FSM__STATES: case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMStateItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMStateItemProvider.java index 868bc10ea..e43ef9c6c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMStateItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMStateItemProvider.java @@ -23,6 +23,7 @@ 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; @@ -63,6 +64,7 @@ public List getPropertyDescriptors(Object object) { addOutgoingTransitionsPropertyDescriptor(object); addIncomingTransitionsPropertyDescriptor(object); + addNamePropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -111,6 +113,28 @@ protected void addIncomingTransitionsPropertyDescriptor(Object object) { null)); } + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioFSMState_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioFSMState_name_feature", "_UI_ScenarioFSMState_type"), + ScenarioPackage.Literals.SCENARIO_FSM_STATE__NAME, + 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 @@ -149,7 +173,10 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { */ @Override public String getText(Object object) { - return getString("_UI_ScenarioFSMState_type"); + String label = ((ScenarioFSMState)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_ScenarioFSMState_type") : + getString("_UI_ScenarioFSMState_type") + " " + label; } @@ -165,6 +192,9 @@ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ScenarioFSMState.class)) { + case ScenarioPackage.SCENARIO_FSM_STATE__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; case ScenarioPackage.SCENARIO_FSM_STATE__EVENT: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java index bfa933f4c..39825d820 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java @@ -25,6 +25,7 @@ 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; @@ -65,6 +66,7 @@ public List getPropertyDescriptors(Object object) { addSourcePropertyDescriptor(object); addTargetPropertyDescriptor(object); + addNamePropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -113,6 +115,28 @@ protected void addTargetPropertyDescriptor(Object object) { null)); } + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioFSMTransition_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioFSMTransition_name_feature", "_UI_ScenarioFSMTransition_type"), + ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__NAME, + 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 @@ -151,7 +175,10 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { */ @Override public String getText(Object object) { - return getString("_UI_ScenarioFSMTransition_type"); + String label = ((ScenarioFSMTransition)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_ScenarioFSMTransition_type") : + getString("_UI_ScenarioFSMTransition_type") + " " + label; } @@ -167,6 +194,9 @@ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ScenarioFSMTransition.class)) { + case ScenarioPackage.SCENARIO_FSM_TRANSITION__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; case ScenarioPackage.SCENARIO_FSM_TRANSITION__GUARD: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; @@ -185,6 +215,16 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createCompositeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createEventPrecondition())); + newChildDescriptors.add (createChildParameter (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, @@ -204,6 +244,11 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors (createChildParameter (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createPropertyReference())); } /** diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF index 912ec20a4..dd211a551 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF @@ -4,13 +4,13 @@ Bundle-Name: %pluginName Bundle-SymbolicName: fr.inria.diverse.event.commons.model.editor;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: fr.inria.diverse.event.commons.model.scenario.presentation.ScenarioEditorPlugin$Implementation +Bundle-Activator: fr.inria.diverse.event.commons.model.arbiter.presentation.ArbiterEditorPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: fr.inria.diverse.event.commons.model.property.presentation, fr.inria.diverse.event.commons.model.scenario.presentation, - fr.inria.diverse.event.commons.model.report.presentation + fr.inria.diverse.event.commons.model.arbiter.presentation Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources;visibility:=reexport, fr.inria.diverse.event.commons.model.edit;visibility:=reexport, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif deleted file mode 100644 index 26ea9421d720270f52a6dc2d5b8a0726aa2351de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 346 zcmZ?wbhEHb6krfwxXQrL(9jScAHRS9{{Q#qA2@IT$YuD?z`*by$o~Hy%=-U-&x;p5 zH*cn$Ipc8Pz?KQNK(wLXZcUHF@@}U^9nN!GU8gs>HJAI=mHJf|2VB{dd24UYgA@Hf zfBpIX^Y_;uzdwEb{o(8Hx1WB!`tbAq%O7{1e+ODXEui?5g^_`QjX?)wAjnS)Y~>Ek z1s*y=iYHVqX|z<#yTIF``7>g@%*sNhS5?+GJtqojwaYydSQ;U?las$GIz%(d?T7or zM)}AtaTOI_))w9-aaX2-R+g4RCRhF{UY2S7{9Qd$`&lNsNT{l|wJwryl~h|*#lK2T W(p74cQ~}FoDIX^${`oGB4AuZ%t9q0G diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif deleted file mode 100644 index 023a6d4bd7b72c780d173567f7e3ce552951c45c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2462 zcmd6m`8OMg8ivzyXM`x-QPZJfTAHHK&QR5AsWql$w2Ic!kg?USY8f{w=)@9er5!BYj=!_Znuek4d&imtcp6{IRvvaUDGxu`>TnBsx>}7X% zcXj>C>iTB}dwftJ85GP)Wg9E&Uo1Q`ExocVy)wHN7qccO5q!QCi)HPXdjpQM@yoS^ z<80wr`+z*>pu(FW#WzEWTpr?GAL8A@pSed8-6IK}F(l8JlKXLGKJgX4dz8Zy$%y32 zpp@#+)Y|a$=Mm|3(Z5q4Wi=#VntsEz{Dy5#Euy1}=;)Hp%#toFnT6ZqML|_BzP1lv z%O=+Mmo{+9_86cv^XeGGw9XMadz{fX(aRTcMrQ<5i(^v@<6@cc-O{vlRU}!Smv2gC z>zD6kUAdoac`x&-cg|Js>}$Rln+N}Hfwc?Bv-QV1{+bU9DsTzIyN2Q2BA&TN5#6H* z9x)`3J^51KgbJVda^HkNIx;ywJRucKExZxS#M0F%$@0wnhiU1`^4h23 zIyRB|s`TH1jRRHfd}`MSy>GmS_qOkkY0m2z-q@@_v^X;Pet2STd|D=5+K?=+Eq(a3 zxUx0ydS+;1P9R!%Gc6O&EWMlmAeOF7N#ydiPfH&@F0O2T*!;4(@p*oEQ@XUixVp8n z@p+5pvo+PcIom(cSJ~E5QbaCFCln?X;9{}4@RT%CQ*#ZywX2u;FZ~1UUCjCl0v=M6=ct7?-u|{y8s0xZTrTum#IpJ4ete-9NX^-(sLx5 zjq28Bsv880&YUkqW@s2kX*=M2AsIT>2ne@%&LQ9Md^@pr%^!dMnebcY(T`kPn2*k^h*qzHBmNX&LLS^Yx*k$~C`&M|yaW#4P zwpXVVDo!~0aeg`$I7Ao2>zT*6$*orQgO3~er<8q*_aXAbjE_E^iH*^`P#OuoVn$FH za<NG<$-i0f=2;479^fm%nqlV1qOp|i=^OqhBUpxs zg$`Q3AFSd62x?y$72v16Pw++^pu;eQZtXl!iBGz%BPo$qA*%w?+OMJQDC82k>A4#(plak`tK^*UGs^qGYI5P28SQsv~s)?1no zM#zskgA6H8@;;YeFAwO1=Kvc>WNuuowDQCl6Y80CzCR?GANk8wF4U2u2Y1`3JYBuqNL4>Bh4vi%gU{k?s)%$m zaBE+uDk=O2&1W3T_>DXv&DFT)Po4;%;BP8!5XfbBV5T11_uAe7L%Kiml9GqWH4pNr z^vO`@?iwzksh%o;gr6n0by-jS8H-Wtt8bl76o?p@hX>t2roSBaZsuOon~oKKd#)S7 zkGDR+oFsekk?%tXY|KO+gF|aPh87qit0W{}TFSE+@i<@Bn!PaPKCl`uxuFJ5_`sA8 z@6eyCDSn+vi@WlZ7^rHkGMD31zw;XRS@ki1?Mup=Z#+>76_n?G2*(PIYR{+iT79EUXyWKy zU}JMbZB4UGxDHygIJ;ZAg9jvb#s-*}G*7aYrLfS(aU;J5rf-<(%Z1%py91Qn82I}b zz@>?segZ1J39IFKlW+wX5t;n}@5DOD3nyzU9ggDyd@2qd8A4Wpv)7cs_vCk0OrIJr zQck)Uw4~2vrkQB4vJfU@;sR{Jd?=m=+W;cb)|?+B%^eLd>SQ}ORy`lb@BSQJ(Lxl! zdM%i?t*FrGLLZsS76@Q-%o*L6-&&JJs{;24JrZ>4<6DNmE~ouBAt1;AQM zG1@gLit4S)d294DjR(=elXy-%fWJj7OFH z0D2-Mx@-JrKPcnJu^;ZJ8qPd9m_?yQ=j7VoCH)y^nQ#<*40reX?KG{|{^;i7{pNKJ z`gqiLuFmx;A$Q$&+;aC(E^2lI(tW>m6836+YD_=+jg>nYO2Lc=` z;10rd$VEf*`oIJ~7}SQK*kAl9zcL#|5*1#VY-+94HZU9(>ghS9rr7|Gr+l|-#OujH znik#PI8OmpeG2jF{C9Yc)q&DyA+ zqB-mOGUlUao^O;hE;99xBU87lLfH=0v&sP-RDF4fpRCY-X@j|3j{Q3(kb$ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties index 51b197608..da329cd52 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties @@ -57,9 +57,9 @@ _UI_ScenarioModelWizard_description = Create a new Scenario model _UI_ScenarioEditor_label = Scenario Model Editor _UI_ScenarioEditorFilenameDefaultBase = My _UI_ScenarioEditorFilenameExtensions = scenario -_UI_ReportEditor_menu = &Report Editor -_UI_ReportModelWizard_label = Report Model -_UI_ReportModelWizard_description = Create a new Report model -_UI_ReportEditor_label = Report Model Editor -_UI_ReportEditorFilenameDefaultBase = My -_UI_ReportEditorFilenameExtensions = report +_UI_ArbiterEditor_menu = &Arbiter Editor +_UI_ArbiterModelWizard_label = Arbiter Model +_UI_ArbiterModelWizard_description = Create a new Arbiter model +_UI_ArbiterEditor_label = Arbiter Model Editor +_UI_ArbiterEditorFilenameDefaultBase = My +_UI_ArbiterEditorFilenameExtensions = arbiter diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml index 4f56b1874..9c1260a55 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml @@ -34,31 +34,4 @@ - - - - - %_UI_ReportModelWizard_description - - - - - - - - - diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/arbiter/presentation/ArbiterEditorPlugin.java similarity index 86% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/arbiter/presentation/ArbiterEditorPlugin.java index 4d1d39678..f13583545 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/arbiter/presentation/ArbiterEditorPlugin.java @@ -1,6 +1,6 @@ /** */ -package fr.inria.diverse.event.commons.model.report.presentation; +package fr.inria.diverse.event.commons.model.arbiter.presentation; import fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin; @@ -15,19 +15,19 @@ import org.eclipse.emf.ecore.provider.EcoreEditPlugin; /** - * This is the central singleton for the Report editor plugin. + * This is the central singleton for the Arbiter editor plugin. * * * @generated */ -public final class ReportEditorPlugin extends EMFPlugin { +public final class ArbiterEditorPlugin extends EMFPlugin { /** * Keep track of the singleton. * * * @generated */ - public static final ReportEditorPlugin INSTANCE = new ReportEditorPlugin(); + public static final ArbiterEditorPlugin INSTANCE = new ArbiterEditorPlugin(); /** * Keep track of the singleton. @@ -43,7 +43,7 @@ public final class ReportEditorPlugin extends EMFPlugin { * * @generated */ - public ReportEditorPlugin() { + public ArbiterEditorPlugin() { super (new ResourceLocator [] { EcoreEditPlugin.INSTANCE, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditor.java index 6f472cd7e..78a47c21c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditor.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditor.java @@ -156,6 +156,8 @@ import fr.inria.diverse.event.commons.model.property.provider.PropertyItemProviderAdapterFactory; +import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioItemProviderAdapterFactory; + import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; import org.eclipse.ui.actions.WorkspaceModifyOperation; @@ -705,6 +707,7 @@ protected void initializeEditingDomain() { adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new PropertyItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new ScenarioItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are executed. diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditorPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditorPlugin.java index 3ccef04c7..064fdb138 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditorPlugin.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyEditorPlugin.java @@ -2,6 +2,8 @@ */ package fr.inria.diverse.event.commons.model.property.presentation; +import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioEditPlugin; + import org.eclipse.emf.common.EMFPlugin; import org.eclipse.emf.common.ui.EclipseUIPlugin; @@ -43,6 +45,7 @@ public PropertyEditorPlugin() { super (new ResourceLocator [] { EcoreEditPlugin.INSTANCE, + ScenarioEditPlugin.INSTANCE, }); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java index 941bf3af3..7f2012397 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java @@ -395,7 +395,8 @@ public PropertyModelWizardInitialObjectCreationPage(String pageId) { * @generated */ public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); { + Composite composite = new Composite(parent, SWT.NONE); + { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java deleted file mode 100644 index 23179e8b8..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report.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 Report model editor. - * - * - * @generated - */ -public class ReportActionBarContributor - 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(ReportEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } - catch (PartInitException exception) { - ReportEditorPlugin.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(ReportEditorPlugin.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 ReportActionBarContributor() { - 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("report-settings")); - toolBarManager.add(new Separator("report-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(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditor_menu"), "fr.inria.diverse.event.commons.model.reportMenuID"); - 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(ReportEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(ReportEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener - (new IMenuListener() { - 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 - */ - 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(ReportEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(ReportEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java deleted file mode 100644 index 0a1092f33..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java +++ /dev/null @@ -1,1828 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report.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.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.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.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.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 fr.inria.diverse.event.commons.model.report.provider.ReportItemProviderAdapterFactory; - -import fr.inria.diverse.event.commons.model.property.provider.PropertyItemProviderAdapterFactory; - -import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioItemProviderAdapterFactory; - -import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; - -import org.eclipse.ui.actions.WorkspaceModifyOperation; - - -/** - * This is an example of a Report model editor. - * - * - * @generated - */ -public class ReportEditor - 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() { - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(ReportEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } - else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(ReportEditor.this); - handleActivate(); - } - } - else if (p == ReportEditor.this) { - handleActivate(); - } - } - public void partBroughtToTop(IWorkbenchPart p) { - // Ignore. - } - public void partClosed(IWorkbenchPart p) { - // Ignore. - } - public void partDeactivated(IWorkbenchPart p) { - // Ignore. - } - 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() { - 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() { - public void run() { - updateProblemIndication(); - } - }); - } - } - }; - - /** - * This listens for workspace changes. - * - * - * @generated - */ - protected IResourceChangeListener resourceChangeListener = - new IResourceChangeListener() { - 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(); - - 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() { - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(ReportEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == ReportEditor.this) { - handleActivate(); - } - } - }); - } - } - catch (CoreException exception) { - ReportEditorPlugin.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(ReportEditor.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, - "fr.inria.diverse.event.commons.model.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) { - ReportEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - markerHelper.deleteMarkers(editingDomain.getResourceSet()); - if (diagnostic.getSeverity() != Diagnostic.OK) { - try { - markerHelper.createMarkers(diagnostic); - } - catch (CoreException exception) { - ReportEditorPlugin.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 ReportEditor() { - 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 ReportItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new PropertyItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new ScenarioItemProviderAdapterFactory()); - 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() { - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec - (new Runnable() { - 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() { - 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 - */ - 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. - // - 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 - */ - 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(), editingDomain.getResourceSet().getURIConverter()); - 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) { - boolean hasErrors = !resource.getErrors().isEmpty(); - if (hasErrors || !resource.getWarnings().isEmpty()) { - BasicDiagnostic basicDiagnostic = - new BasicDiagnostic - (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, - "fr.inria.diverse.event.commons.model.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, - "fr.inria.diverse.event.commons.model.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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() { - 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() { - 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. - // - 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) { - ReportEditor.this.setSelectionToViewer(selection); - ReportEditor.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. - // - ReportEditorPlugin.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 - */ - 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 - */ - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * @generated - */ - 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 - */ - 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 ReportEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return ReportEditorPlugin.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 - */ - 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java deleted file mode 100644 index 9df62a07c..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java +++ /dev/null @@ -1,628 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report.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.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.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; - -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; - -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.emf.ecore.xmi.XMLResource; - -import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; - -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.jface.dialogs.MessageDialog; - -import org.eclipse.jface.viewers.IStructuredSelection; - -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; - -import org.eclipse.swt.SWT; - -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.ModifyEvent; - -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.actions.WorkspaceModifyOperation; - -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; - -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.ISetSelectionTarget; - -import fr.inria.diverse.event.commons.model.report.ReportFactory; -import fr.inria.diverse.event.commons.model.report.ReportPackage; -import fr.inria.diverse.event.commons.model.report.provider.ReportEditPlugin; - - -import org.eclipse.core.runtime.Path; - -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; - -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; - - -/** - * This is a simple wizard for creating a new model file. - * - * - * @generated - */ -public class ReportModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = - ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * @generated - */ - protected ReportPackage reportPackage = ReportPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * @generated - */ - protected ReportFactory reportFactory = reportPackage.getReportFactory(); - - /** - * This is the file creation page. - * - * - * @generated - */ - protected ReportModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * @generated - */ - protected ReportModelWizardInitialObjectCreationPage 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 - */ - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(ReportEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(ReportEditorPlugin.INSTANCE.getImage("full/wizban/NewReport"))); - } - - /** - * 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 : reportPackage.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)reportPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = reportFactory.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) { - ReportEditorPlugin.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() { - 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(), ReportEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } - catch (Exception exception) { - ReportEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * @generated - */ - public class ReportModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * @generated - */ - public ReportModelWizardNewFileCreationPage(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(ReportEditorPlugin.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 ReportModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * @generated - */ - public ReportModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * @generated - */ - 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(ReportEditorPlugin.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(ReportEditorPlugin.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() { - 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 ReportEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } - catch(MissingResourceException mre) { - ReportEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer(ReportEditorPlugin.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 ReportModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_label")); - newFileCreationPage.setDescription(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_description")); - newFileCreationPage.setFileName(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameDefaultBase") + "." + 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 = ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameDefaultBase"); - 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 ReportModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_label")); - initialObjectCreationPage.setDescription(ReportEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF index dd4447134..6fc920320 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF @@ -16,7 +16,10 @@ Export-Package: fr.inria.diverse.event.commons.model, fr.inria.diverse.event.commons.model.property.util, fr.inria.diverse.event.commons.model.report, fr.inria.diverse.event.commons.model.report.impl, - fr.inria.diverse.event.commons.model.report.util + fr.inria.diverse.event.commons.model.report.util, + fr.inria.diverse.event.commons.model.arbiter, + fr.inria.diverse.event.commons.model.arbiter.impl, + fr.inria.diverse.event.commons.model.arbiter.util Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, fr.inria.diverse.event.commons.model;visibility:=reexport, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/arbiter.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/arbiter.ecore new file mode 100644 index 000000000..9f180017b --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/arbiter.ecore @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/arbiter.genmodel b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/arbiter.genmodel new file mode 100644 index 000000000..98f2b3e19 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/arbiter.genmodel @@ -0,0 +1,35 @@ + + + arbiter.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore index e33bf638a..b9b0d40fd 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore @@ -6,6 +6,13 @@ + + + + + + + @@ -148,4 +155,7 @@ + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.genmodel b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.genmodel index 699575879..948b3f9d0 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.genmodel +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.genmodel @@ -1,44 +1,101 @@ - - + + property.ecore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore index d5b7db8c7..1af9727cc 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore @@ -36,7 +36,7 @@ - + @@ -54,9 +54,7 @@ - - - + @@ -68,9 +66,7 @@ - - - + @@ -84,9 +80,7 @@ - - - + @@ -119,6 +113,7 @@ containment="true"> + @@ -146,12 +141,11 @@ eOpposite="#//ScenarioFSMTransition/target"> + - - - + @@ -170,5 +164,6 @@ eOpposite="#//ScenarioFSMState/incomingTransitions"> + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.xml index c16fc064f..a1f492b50 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.xml +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/plugin.xml @@ -30,4 +30,20 @@ genModel="model/report.genmodel"/> + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java index 9b0f7d2b9..3daeb2dc1 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/IEventManager.java @@ -23,6 +23,8 @@ public interface IEventManager extends IEngineAddon { void loadScenario(URI uri, ResourceSet resourceSet); + void loadArbiter(URI arbiterURI, ResourceSet resourceSet); + void addListener(IEventManagerListener listener); void removeListener(IEventManagerListener listener); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java new file mode 100644 index 000000000..3ca0d5a18 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java @@ -0,0 +1,85 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +import fr.inria.diverse.event.commons.model.property.Property; +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Arbiter'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getStates States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getTransitions Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState Initial State}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter() + * @model abstract="true" + * @generated + */ +public interface Arbiter

    , T extends Transition> extends EObject { + /** + * Returns the value of the 'States' containment reference list. + * + *

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

    + * + * @return the value of the 'States' containment reference list. + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter_States() + * @model containment="true" + * @generated + */ + EList getStates(); + + /** + * Returns the value of the 'Transitions' containment reference list. + * + *

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

    + * + * @return the value of the 'Transitions' containment reference list. + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter_Transitions() + * @model containment="true" + * @generated + */ + EList getTransitions(); + + /** + * Returns the value of the 'Initial State' reference. + * + *

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

    + * + * @return the value of the 'Initial State' reference. + * @see #setInitialState(State) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter_InitialState() + * @model + * @generated + */ + S getInitialState(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState Initial State}' reference. + * + * + * @param value the new value of the 'Initial State' reference. + * @see #getInitialState() + * @generated + */ + void setInitialState(S value); + +} // Arbiter diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java new file mode 100644 index 000000000..9c1785570 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java @@ -0,0 +1,33 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +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 fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage + * @generated + */ +public interface ArbiterFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + ArbiterFactory eINSTANCE = fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterFactoryImpl.init(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + ArbiterPackage getArbiterPackage(); + +} //ArbiterFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java new file mode 100644 index 000000000..8bb7615f0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java @@ -0,0 +1,512 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +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 operation of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterFactory + * @model kind="package" + * @generated + */ +public interface ArbiterPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "arbiter"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.gemoc.org/arbiter"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "arbiter"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + ArbiterPackage eINSTANCE = fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl.init(); + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl Arbiter}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getArbiter() + * @generated + */ + int ARBITER = 0; + + /** + * The feature id for the 'States' containment reference list. + * + * + * @generated + * @ordered + */ + int ARBITER__STATES = 0; + + /** + * The feature id for the 'Transitions' containment reference list. + * + * + * @generated + * @ordered + */ + int ARBITER__TRANSITIONS = 1; + + /** + * The feature id for the 'Initial State' reference. + * + * + * @generated + * @ordered + */ + int ARBITER__INITIAL_STATE = 2; + + /** + * The number of structural features of the 'Arbiter' class. + * + * + * @generated + * @ordered + */ + int ARBITER_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Arbiter' class. + * + * + * @generated + * @ordered + */ + int ARBITER_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl State}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getState() + * @generated + */ + int STATE = 1; + + /** + * The feature id for the 'Truth Value' attribute. + * + * + * @generated + * @ordered + */ + int STATE__TRUTH_VALUE = 0; + + /** + * The feature id for the 'Outgoing Transitions' reference list. + * + * + * @generated + * @ordered + */ + int STATE__OUTGOING_TRANSITIONS = 1; + + /** + * The feature id for the 'Incoming Transitions' reference list. + * + * + * @generated + * @ordered + */ + int STATE__INCOMING_TRANSITIONS = 2; + + /** + * The number of structural features of the 'State' class. + * + * + * @generated + * @ordered + */ + int STATE_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'State' class. + * + * + * @generated + * @ordered + */ + int STATE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl Transition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTransition() + * @generated + */ + int TRANSITION = 2; + + /** + * The feature id for the 'Source' reference. + * + * + * @generated + * @ordered + */ + int TRANSITION__SOURCE = 0; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int TRANSITION__TARGET = 1; + + /** + * The feature id for the 'Guard' containment reference. + * + * + * @generated + * @ordered + */ + int TRANSITION__GUARD = 2; + + /** + * The number of structural features of the 'Transition' class. + * + * + * @generated + * @ordered + */ + int TRANSITION_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Transition' class. + * + * + * @generated + * @ordered + */ + int TRANSITION_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.TruthValue Truth Value}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTruthValue() + * @generated + */ + int TRUTH_VALUE = 3; + + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter Arbiter}'. + * + * + * @return the meta object for class 'Arbiter'. + * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter + * @generated + */ + EClass getArbiter(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getStates States}'. + * + * + * @return the meta object for the containment reference list 'States'. + * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter#getStates() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_States(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getTransitions Transitions}'. + * + * + * @return the meta object for the containment reference list 'Transitions'. + * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter#getTransitions() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_Transitions(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState Initial State}'. + * + * + * @return the meta object for the reference 'Initial State'. + * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_InitialState(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.arbiter.State State}'. + * + * + * @return the meta object for class 'State'. + * @see fr.inria.diverse.event.commons.model.arbiter.State + * @generated + */ + EClass getState(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue Truth Value}'. + * + * + * @return the meta object for the attribute 'Truth Value'. + * @see fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue() + * @see #getState() + * @generated + */ + EAttribute getState_TruthValue(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions Outgoing Transitions}'. + * + * + * @return the meta object for the reference list 'Outgoing Transitions'. + * @see fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions() + * @see #getState() + * @generated + */ + EReference getState_OutgoingTransitions(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions Incoming Transitions}'. + * + * + * @return the meta object for the reference list 'Incoming Transitions'. + * @see fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions() + * @see #getState() + * @generated + */ + EReference getState_IncomingTransitions(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.arbiter.Transition Transition}'. + * + * + * @return the meta object for class 'Transition'. + * @see fr.inria.diverse.event.commons.model.arbiter.Transition + * @generated + */ + EClass getTransition(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}'. + * + * + * @return the meta object for the reference 'Source'. + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getSource() + * @see #getTransition() + * @generated + */ + EReference getTransition_Source(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget() + * @see #getTransition() + * @generated + */ + EReference getTransition_Target(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard Guard}'. + * + * + * @return the meta object for the containment reference 'Guard'. + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard() + * @see #getTransition() + * @generated + */ + EReference getTransition_Guard(); + + /** + * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.arbiter.TruthValue Truth Value}'. + * + * + * @return the meta object for enum 'Truth Value'. + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @generated + */ + EEnum getTruthValue(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + ArbiterFactory getArbiterFactory(); + + /** + * + * 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 fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl Arbiter}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getArbiter() + * @generated + */ + EClass ARBITER = eINSTANCE.getArbiter(); + + /** + * The meta object literal for the 'States' containment reference list feature. + * + * + * @generated + */ + EReference ARBITER__STATES = eINSTANCE.getArbiter_States(); + + /** + * The meta object literal for the 'Transitions' containment reference list feature. + * + * + * @generated + */ + EReference ARBITER__TRANSITIONS = eINSTANCE.getArbiter_Transitions(); + + /** + * The meta object literal for the 'Initial State' reference feature. + * + * + * @generated + */ + EReference ARBITER__INITIAL_STATE = eINSTANCE.getArbiter_InitialState(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl State}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getState() + * @generated + */ + EClass STATE = eINSTANCE.getState(); + + /** + * The meta object literal for the 'Truth Value' attribute feature. + * + * + * @generated + */ + EAttribute STATE__TRUTH_VALUE = eINSTANCE.getState_TruthValue(); + + /** + * The meta object literal for the 'Outgoing Transitions' reference list feature. + * + * + * @generated + */ + EReference STATE__OUTGOING_TRANSITIONS = eINSTANCE.getState_OutgoingTransitions(); + + /** + * The meta object literal for the 'Incoming Transitions' reference list feature. + * + * + * @generated + */ + EReference STATE__INCOMING_TRANSITIONS = eINSTANCE.getState_IncomingTransitions(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl Transition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTransition() + * @generated + */ + EClass TRANSITION = eINSTANCE.getTransition(); + + /** + * The meta object literal for the 'Source' reference feature. + * + * + * @generated + */ + EReference TRANSITION__SOURCE = eINSTANCE.getTransition_Source(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference TRANSITION__TARGET = eINSTANCE.getTransition_Target(); + + /** + * The meta object literal for the 'Guard' containment reference feature. + * + * + * @generated + */ + EReference TRANSITION__GUARD = eINSTANCE.getTransition_Guard(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.arbiter.TruthValue Truth Value}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTruthValue() + * @generated + */ + EEnum TRUTH_VALUE = eINSTANCE.getTruthValue(); + + } + +} //ArbiterPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java new file mode 100644 index 000000000..a97cc4f3d --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java @@ -0,0 +1,92 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +import fr.inria.diverse.event.commons.model.property.Property; +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'State'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue Truth Value}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions Outgoing Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions Incoming Transitions}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState() + * @model abstract="true" + * @generated + */ +public interface State

    > extends EObject { + /** + * Returns the value of the 'Truth Value' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.arbiter.TruthValue}. + * + *

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

    + * + * @return the value of the 'Truth Value' attribute. + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @see #setTruthValue(TruthValue) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState_TruthValue() + * @model required="true" + * @generated + */ + TruthValue getTruthValue(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue Truth Value}' attribute. + * + * + * @param value the new value of the 'Truth Value' attribute. + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @see #getTruthValue() + * @generated + */ + void setTruthValue(TruthValue value); + + /** + * Returns the value of the 'Outgoing Transitions' reference list. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}'. + * + *

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

    + * + * @return the value of the 'Outgoing Transitions' reference list. + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState_OutgoingTransitions() + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getSource + * @model opposite="source" + * @generated + */ + EList getOutgoingTransitions(); + + /** + * Returns the value of the 'Incoming Transitions' reference list. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}'. + * + *

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

    + * + * @return the value of the 'Incoming Transitions' reference list. + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState_IncomingTransitions() + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget + * @model opposite="target" + * @generated + */ + EList getIncomingTransitions(); + +} // State diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java new file mode 100644 index 000000000..ddc85c552 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java @@ -0,0 +1,109 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +import fr.inria.diverse.event.commons.model.property.Property; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Transition'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard Guard}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition() + * @model abstract="true" + * @generated + */ +public interface Transition

    > extends EObject { + /** + * Returns the value of the 'Source' reference. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions Outgoing Transitions}'. + * + *

    + * 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(State) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition_Source() + * @see fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions + * @model opposite="outgoingTransitions" required="true" + * @generated + */ + S getSource(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}' reference. + * + * + * @param value the new value of the 'Source' reference. + * @see #getSource() + * @generated + */ + void setSource(S value); + + /** + * Returns the value of the 'Target' reference. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions Incoming Transitions}'. + * + *

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

    + * + * @return the value of the 'Target' reference. + * @see #setTarget(State) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition_Target() + * @see fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions + * @model opposite="incomingTransitions" required="true" + * @generated + */ + S getTarget(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(S value); + + /** + * Returns the value of the 'Guard' containment reference. + * + *

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

    + * + * @return the value of the 'Guard' containment reference. + * @see #setGuard(Property) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition_Guard() + * @model containment="true" + * @generated + */ + P getGuard(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard Guard}' containment reference. + * + * + * @param value the new value of the 'Guard' containment reference. + * @see #getGuard() + * @generated + */ + void setGuard(P value); + +} // Transition diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java new file mode 100644 index 000000000..07ecc3ae0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java @@ -0,0 +1,241 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +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 'Truth Value', + * and utility methods for working with them. + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTruthValue() + * @model + * @generated + */ +public enum TruthValue 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 'INCONCLUSIVE' literal object. + * + * + * @see #INCONCLUSIVE_VALUE + * @generated + * @ordered + */ + INCONCLUSIVE(2, "INCONCLUSIVE", "INCONCLUSIVE"); + + /** + * 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 + * @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 + * @generated + * @ordered + */ + public static final int FALSE_VALUE = 1; + + /** + * The 'INCONCLUSIVE' literal value. + * + *

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

    + * + * @see #INCONCLUSIVE + * @model + * @generated + * @ordered + */ + public static final int INCONCLUSIVE_VALUE = 2; + + /** + * An array of all the 'Truth Value' enumerators. + * + * + * @generated + */ + private static final TruthValue[] VALUES_ARRAY = + new TruthValue[] { + TRUE, + FALSE, + INCONCLUSIVE, + }; + + /** + * A public read-only list of all the 'Truth Value' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Truth Value' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static TruthValue get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TruthValue result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Truth Value' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static TruthValue getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TruthValue result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Truth Value' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static TruthValue get(int value) { + switch (value) { + case TRUE_VALUE: return TRUE; + case FALSE_VALUE: return FALSE; + case INCONCLUSIVE_VALUE: return INCONCLUSIVE; + } + 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 TruthValue(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //TruthValue diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java new file mode 100644 index 000000000..15bdbf8c5 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java @@ -0,0 +1,134 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.*; +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; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class ArbiterFactoryImpl extends EFactoryImpl implements ArbiterFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static ArbiterFactory init() { + try { + ArbiterFactory theArbiterFactory = (ArbiterFactory)EPackage.Registry.INSTANCE.getEFactory(ArbiterPackage.eNS_URI); + if (theArbiterFactory != null) { + return theArbiterFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new ArbiterFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public ArbiterFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + 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 ArbiterPackage.TRUTH_VALUE: + return createTruthValueFromString(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 ArbiterPackage.TRUTH_VALUE: + return convertTruthValueToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public TruthValue createTruthValueFromString(EDataType eDataType, String initialValue) { + TruthValue result = TruthValue.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertTruthValueToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public ArbiterPackage getArbiterPackage() { + return (ArbiterPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static ArbiterPackage getPackage() { + return ArbiterPackage.eINSTANCE; + } + +} //ArbiterFactoryImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java new file mode 100644 index 000000000..924cd6d02 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java @@ -0,0 +1,253 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.Arbiter; +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.Transition; + +import fr.inria.diverse.event.commons.model.property.Property; +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.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Arbiter'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl#getStates States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl#getTransitions Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl#getInitialState Initial State}
    • + *
    + * + * @generated + */ +public abstract class ArbiterImpl

    , T extends Transition> extends MinimalEObjectImpl.Container implements Arbiter { + /** + * The cached value of the '{@link #getStates() States}' containment reference list. + * + * + * @see #getStates() + * @generated + * @ordered + */ + protected EList states; + + /** + * The cached value of the '{@link #getTransitions() Transitions}' containment reference list. + * + * + * @see #getTransitions() + * @generated + * @ordered + */ + protected EList transitions; + + /** + * The cached value of the '{@link #getInitialState() Initial State}' reference. + * + * + * @see #getInitialState() + * @generated + * @ordered + */ + protected S initialState; + + /** + * + * + * @generated + */ + protected ArbiterImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ArbiterPackage.Literals.ARBITER; + } + + /** + * + * + * @generated + */ + public EList getStates() { + if (states == null) { + states = new EObjectContainmentEList(State.class, this, ArbiterPackage.ARBITER__STATES); + } + return states; + } + + /** + * + * + * @generated + */ + public EList getTransitions() { + if (transitions == null) { + transitions = new EObjectContainmentEList(Transition.class, this, ArbiterPackage.ARBITER__TRANSITIONS); + } + return transitions; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public S getInitialState() { + if (initialState != null && initialState.eIsProxy()) { + InternalEObject oldInitialState = (InternalEObject)initialState; + initialState = (S)eResolveProxy(oldInitialState); + if (initialState != oldInitialState) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArbiterPackage.ARBITER__INITIAL_STATE, oldInitialState, initialState)); + } + } + return initialState; + } + + /** + * + * + * @generated + */ + public S basicGetInitialState() { + return initialState; + } + + /** + * + * + * @generated + */ + public void setInitialState(S newInitialState) { + S oldInitialState = initialState; + initialState = newInitialState; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.ARBITER__INITIAL_STATE, oldInitialState, initialState)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + return ((InternalEList)getStates()).basicRemove(otherEnd, msgs); + case ArbiterPackage.ARBITER__TRANSITIONS: + return ((InternalEList)getTransitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + return getStates(); + case ArbiterPackage.ARBITER__TRANSITIONS: + return getTransitions(); + case ArbiterPackage.ARBITER__INITIAL_STATE: + if (resolve) return getInitialState(); + return basicGetInitialState(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + getStates().clear(); + getStates().addAll((Collection)newValue); + return; + case ArbiterPackage.ARBITER__TRANSITIONS: + getTransitions().clear(); + getTransitions().addAll((Collection)newValue); + return; + case ArbiterPackage.ARBITER__INITIAL_STATE: + setInitialState((S)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + getStates().clear(); + return; + case ArbiterPackage.ARBITER__TRANSITIONS: + getTransitions().clear(); + return; + case ArbiterPackage.ARBITER__INITIAL_STATE: + setInitialState((S)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + return states != null && !states.isEmpty(); + case ArbiterPackage.ARBITER__TRANSITIONS: + return transitions != null && !transitions.isEmpty(); + case ArbiterPackage.ARBITER__INITIAL_STATE: + return initialState != null; + } + return super.eIsSet(featureID); + } + +} //ArbiterImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java new file mode 100644 index 000000000..04b6309c9 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java @@ -0,0 +1,387 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.Arbiter; +import fr.inria.diverse.event.commons.model.arbiter.ArbiterFactory; +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.Transition; +import fr.inria.diverse.event.commons.model.arbiter.TruthValue; + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.ETypeParameter; +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class ArbiterPackageImpl extends EPackageImpl implements ArbiterPackage { + /** + * + * + * @generated + */ + private EClass arbiterEClass = null; + + /** + * + * + * @generated + */ + private EClass stateEClass = null; + + /** + * + * + * @generated + */ + private EClass transitionEClass = null; + + /** + * + * + * @generated + */ + private EEnum truthValueEEnum = 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 fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#eNS_URI + * @see #init() + * @generated + */ + private ArbiterPackageImpl() { + super(eNS_URI, ArbiterFactory.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 ArbiterPackage#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 ArbiterPackage init() { + if (isInited) return (ArbiterPackage)EPackage.Registry.INSTANCE.getEPackage(ArbiterPackage.eNS_URI); + + // Obtain or create and register package + ArbiterPackageImpl theArbiterPackage = (ArbiterPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ArbiterPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ArbiterPackageImpl()); + + isInited = true; + + // Create package meta-data objects + theArbiterPackage.createPackageContents(); + + // Initialize created meta-data + theArbiterPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theArbiterPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(ArbiterPackage.eNS_URI, theArbiterPackage); + return theArbiterPackage; + } + + /** + * + * + * @generated + */ + public EClass getArbiter() { + return arbiterEClass; + } + + /** + * + * + * @generated + */ + public EReference getArbiter_States() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getArbiter_Transitions() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getArbiter_InitialState() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getState() { + return stateEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getState_TruthValue() { + return (EAttribute)stateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getState_OutgoingTransitions() { + return (EReference)stateEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getState_IncomingTransitions() { + return (EReference)stateEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getTransition() { + return transitionEClass; + } + + /** + * + * + * @generated + */ + public EReference getTransition_Source() { + return (EReference)transitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getTransition_Target() { + return (EReference)transitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getTransition_Guard() { + return (EReference)transitionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EEnum getTruthValue() { + return truthValueEEnum; + } + + /** + * + * + * @generated + */ + public ArbiterFactory getArbiterFactory() { + return (ArbiterFactory)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 + arbiterEClass = createEClass(ARBITER); + createEReference(arbiterEClass, ARBITER__STATES); + createEReference(arbiterEClass, ARBITER__TRANSITIONS); + createEReference(arbiterEClass, ARBITER__INITIAL_STATE); + + stateEClass = createEClass(STATE); + createEAttribute(stateEClass, STATE__TRUTH_VALUE); + createEReference(stateEClass, STATE__OUTGOING_TRANSITIONS); + createEReference(stateEClass, STATE__INCOMING_TRANSITIONS); + + transitionEClass = createEClass(TRANSITION); + createEReference(transitionEClass, TRANSITION__SOURCE); + createEReference(transitionEClass, TRANSITION__TARGET); + createEReference(transitionEClass, TRANSITION__GUARD); + + // Create enums + truthValueEEnum = createEEnum(TRUTH_VALUE); + } + + /** + * + * + * @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 + PropertyPackage thePropertyPackage = (PropertyPackage)EPackage.Registry.INSTANCE.getEPackage(PropertyPackage.eNS_URI); + + // Create type parameters + ETypeParameter arbiterEClass_P = addETypeParameter(arbiterEClass, "P"); + ETypeParameter arbiterEClass_S = addETypeParameter(arbiterEClass, "S"); + ETypeParameter arbiterEClass_T = addETypeParameter(arbiterEClass, "T"); + ETypeParameter stateEClass_P = addETypeParameter(stateEClass, "P"); + ETypeParameter stateEClass_T = addETypeParameter(stateEClass, "T"); + ETypeParameter transitionEClass_P = addETypeParameter(transitionEClass, "P"); + ETypeParameter transitionEClass_S = addETypeParameter(transitionEClass, "S"); + + // Set bounds for type parameters + EGenericType g1 = createEGenericType(thePropertyPackage.getProperty()); + arbiterEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getState()); + EGenericType g2 = createEGenericType(arbiterEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(arbiterEClass_T); + g1.getETypeArguments().add(g2); + arbiterEClass_S.getEBounds().add(g1); + g1 = createEGenericType(this.getTransition()); + g2 = createEGenericType(arbiterEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(arbiterEClass_S); + g1.getETypeArguments().add(g2); + arbiterEClass_T.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getProperty()); + stateEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getTransition()); + g2 = createEGenericType(stateEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + stateEClass_T.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getProperty()); + transitionEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getState()); + g2 = createEGenericType(transitionEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + transitionEClass_S.getEBounds().add(g1); + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(arbiterEClass, Arbiter.class, "Arbiter", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(arbiterEClass_S); + initEReference(getArbiter_States(), g1, null, "states", null, 0, -1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterEClass_T); + initEReference(getArbiter_Transitions(), g1, null, "transitions", null, 0, -1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterEClass_S); + initEReference(getArbiter_InitialState(), g1, null, "initialState", null, 0, 1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(stateEClass, State.class, "State", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getState_TruthValue(), this.getTruthValue(), "truthValue", null, 1, 1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(stateEClass_T); + initEReference(getState_OutgoingTransitions(), g1, this.getTransition_Source(), "outgoingTransitions", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(stateEClass_T); + initEReference(getState_IncomingTransitions(), g1, this.getTransition_Target(), "incomingTransitions", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(transitionEClass, Transition.class, "Transition", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(transitionEClass_S); + initEReference(getTransition_Source(), g1, this.getState_OutgoingTransitions(), "source", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(transitionEClass_S); + initEReference(getTransition_Target(), g1, this.getState_IncomingTransitions(), "target", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(transitionEClass_P); + initEReference(getTransition_Guard(), g1, null, "guard", null, 0, 1, Transition.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(truthValueEEnum, TruthValue.class, "TruthValue"); + addEEnumLiteral(truthValueEEnum, TruthValue.TRUE); + addEEnumLiteral(truthValueEEnum, TruthValue.FALSE); + addEEnumLiteral(truthValueEEnum, TruthValue.INCONCLUSIVE); + + // Create resource + createResource(eNS_URI); + } + +} //ArbiterPackageImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java new file mode 100644 index 000000000..49c094171 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java @@ -0,0 +1,277 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.Transition; +import fr.inria.diverse.event.commons.model.arbiter.TruthValue; + +import fr.inria.diverse.event.commons.model.property.Property; +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.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'State'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl#getTruthValue Truth Value}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl#getOutgoingTransitions Outgoing Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl#getIncomingTransitions Incoming Transitions}
    • + *
    + * + * @generated + */ +public abstract class StateImpl

    > extends MinimalEObjectImpl.Container implements State { + /** + * The default value of the '{@link #getTruthValue() Truth Value}' attribute. + * + * + * @see #getTruthValue() + * @generated + * @ordered + */ + protected static final TruthValue TRUTH_VALUE_EDEFAULT = TruthValue.TRUE; + + /** + * The cached value of the '{@link #getTruthValue() Truth Value}' attribute. + * + * + * @see #getTruthValue() + * @generated + * @ordered + */ + protected TruthValue truthValue = TRUTH_VALUE_EDEFAULT; + + /** + * The cached value of the '{@link #getOutgoingTransitions() Outgoing Transitions}' reference list. + * + * + * @see #getOutgoingTransitions() + * @generated + * @ordered + */ + protected EList outgoingTransitions; + + /** + * The cached value of the '{@link #getIncomingTransitions() Incoming Transitions}' reference list. + * + * + * @see #getIncomingTransitions() + * @generated + * @ordered + */ + protected EList incomingTransitions; + + /** + * + * + * @generated + */ + protected StateImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ArbiterPackage.Literals.STATE; + } + + /** + * + * + * @generated + */ + public TruthValue getTruthValue() { + return truthValue; + } + + /** + * + * + * @generated + */ + public void setTruthValue(TruthValue newTruthValue) { + TruthValue oldTruthValue = truthValue; + truthValue = newTruthValue == null ? TRUTH_VALUE_EDEFAULT : newTruthValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.STATE__TRUTH_VALUE, oldTruthValue, truthValue)); + } + + /** + * + * + * @generated + */ + public EList getOutgoingTransitions() { + if (outgoingTransitions == null) { + outgoingTransitions = new EObjectWithInverseResolvingEList(Transition.class, this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, ArbiterPackage.TRANSITION__SOURCE); + } + return outgoingTransitions; + } + + /** + * + * + * @generated + */ + public EList getIncomingTransitions() { + if (incomingTransitions == null) { + incomingTransitions = new EObjectWithInverseResolvingEList(Transition.class, this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, ArbiterPackage.TRANSITION__TARGET); + } + return incomingTransitions; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + return ((InternalEList)(InternalEList)getOutgoingTransitions()).basicAdd(otherEnd, msgs); + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + return ((InternalEList)(InternalEList)getIncomingTransitions()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + return ((InternalEList)getOutgoingTransitions()).basicRemove(otherEnd, msgs); + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + return ((InternalEList)getIncomingTransitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ArbiterPackage.STATE__TRUTH_VALUE: + return getTruthValue(); + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + return getOutgoingTransitions(); + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + return getIncomingTransitions(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ArbiterPackage.STATE__TRUTH_VALUE: + setTruthValue((TruthValue)newValue); + return; + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + getOutgoingTransitions().clear(); + getOutgoingTransitions().addAll((Collection)newValue); + return; + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + getIncomingTransitions().clear(); + getIncomingTransitions().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ArbiterPackage.STATE__TRUTH_VALUE: + setTruthValue(TRUTH_VALUE_EDEFAULT); + return; + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + getOutgoingTransitions().clear(); + return; + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + getIncomingTransitions().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ArbiterPackage.STATE__TRUTH_VALUE: + return truthValue != TRUTH_VALUE_EDEFAULT; + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + return outgoingTransitions != null && !outgoingTransitions.isEmpty(); + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + return incomingTransitions != null && !incomingTransitions.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (truthValue: "); + result.append(truthValue); + result.append(')'); + return result.toString(); + } + +} //StateImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java new file mode 100644 index 000000000..5dffaad07 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java @@ -0,0 +1,370 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.Transition; + +import fr.inria.diverse.event.commons.model.property.Property; +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.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Transition'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl#getSource Source}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl#getTarget Target}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl#getGuard Guard}
    • + *
    + * + * @generated + */ +public abstract class TransitionImpl

    > extends MinimalEObjectImpl.Container implements Transition { + /** + * The cached value of the '{@link #getSource() Source}' reference. + * + * + * @see #getSource() + * @generated + * @ordered + */ + protected S source; + + /** + * The cached value of the '{@link #getTarget() Target}' reference. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected S target; + + /** + * The cached value of the '{@link #getGuard() Guard}' containment reference. + * + * + * @see #getGuard() + * @generated + * @ordered + */ + protected P guard; + + /** + * + * + * @generated + */ + protected TransitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ArbiterPackage.Literals.TRANSITION; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public S getSource() { + if (source != null && source.eIsProxy()) { + InternalEObject oldSource = (InternalEObject)source; + source = (S)eResolveProxy(oldSource); + if (source != oldSource) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArbiterPackage.TRANSITION__SOURCE, oldSource, source)); + } + } + return source; + } + + /** + * + * + * @generated + */ + public S basicGetSource() { + return source; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSource(S newSource, NotificationChain msgs) { + S oldSource = source; + source = newSource; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__SOURCE, oldSource, newSource); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setSource(S newSource) { + if (newSource != source) { + NotificationChain msgs = null; + if (source != null) + msgs = ((InternalEObject)source).eInverseRemove(this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, State.class, msgs); + if (newSource != null) + msgs = ((InternalEObject)newSource).eInverseAdd(this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, State.class, msgs); + msgs = basicSetSource(newSource, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__SOURCE, newSource, newSource)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public S getTarget() { + if (target != null && target.eIsProxy()) { + InternalEObject oldTarget = (InternalEObject)target; + target = (S)eResolveProxy(oldTarget); + if (target != oldTarget) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArbiterPackage.TRANSITION__TARGET, oldTarget, target)); + } + } + return target; + } + + /** + * + * + * @generated + */ + public S basicGetTarget() { + return target; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTarget(S newTarget, NotificationChain msgs) { + S oldTarget = target; + target = newTarget; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__TARGET, oldTarget, newTarget); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setTarget(S newTarget) { + if (newTarget != target) { + NotificationChain msgs = null; + if (target != null) + msgs = ((InternalEObject)target).eInverseRemove(this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, State.class, msgs); + if (newTarget != null) + msgs = ((InternalEObject)newTarget).eInverseAdd(this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, State.class, msgs); + msgs = basicSetTarget(newTarget, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__TARGET, newTarget, newTarget)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public P getGuard() { + return guard; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGuard(P newGuard, NotificationChain msgs) { + P oldGuard = guard; + guard = newGuard; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__GUARD, oldGuard, newGuard); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setGuard(P newGuard) { + if (newGuard != guard) { + NotificationChain msgs = null; + if (guard != null) + msgs = ((InternalEObject)guard).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ArbiterPackage.TRANSITION__GUARD, null, msgs); + if (newGuard != null) + msgs = ((InternalEObject)newGuard).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ArbiterPackage.TRANSITION__GUARD, null, msgs); + msgs = basicSetGuard(newGuard, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__GUARD, newGuard, newGuard)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + if (source != null) + msgs = ((InternalEObject)source).eInverseRemove(this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, State.class, msgs); + return basicSetSource((S)otherEnd, msgs); + case ArbiterPackage.TRANSITION__TARGET: + if (target != null) + msgs = ((InternalEObject)target).eInverseRemove(this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, State.class, msgs); + return basicSetTarget((S)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + return basicSetSource(null, msgs); + case ArbiterPackage.TRANSITION__TARGET: + return basicSetTarget(null, msgs); + case ArbiterPackage.TRANSITION__GUARD: + return basicSetGuard(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + if (resolve) return getSource(); + return basicGetSource(); + case ArbiterPackage.TRANSITION__TARGET: + if (resolve) return getTarget(); + return basicGetTarget(); + case ArbiterPackage.TRANSITION__GUARD: + return getGuard(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + setSource((S)newValue); + return; + case ArbiterPackage.TRANSITION__TARGET: + setTarget((S)newValue); + return; + case ArbiterPackage.TRANSITION__GUARD: + setGuard((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + setSource((S)null); + return; + case ArbiterPackage.TRANSITION__TARGET: + setTarget((S)null); + return; + case ArbiterPackage.TRANSITION__GUARD: + setGuard((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + return source != null; + case ArbiterPackage.TRANSITION__TARGET: + return target != null; + case ArbiterPackage.TRANSITION__GUARD: + return guard != null; + } + return super.eIsSet(featureID); + } + +} //TransitionImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java new file mode 100644 index 000000000..73262b6ca --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java @@ -0,0 +1,157 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.util; + +import fr.inria.diverse.event.commons.model.arbiter.*; + +import fr.inria.diverse.event.commons.model.property.Property; +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; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage + * @generated + */ +public class ArbiterAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static ArbiterPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public ArbiterAdapterFactory() { + if (modelPackage == null) { + modelPackage = ArbiterPackage.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 ArbiterSwitch modelSwitch = + new ArbiterSwitch() { + @Override + public

    , T extends Transition> Adapter caseArbiter(Arbiter object) { + return createArbiterAdapter(); + } + @Override + public

    > Adapter caseState(State object) { + return createStateAdapter(); + } + @Override + public

    > Adapter caseTransition(Transition object) { + return createTransitionAdapter(); + } + @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 fr.inria.diverse.event.commons.model.arbiter.Arbiter Arbiter}'. + * + * 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 fr.inria.diverse.event.commons.model.arbiter.Arbiter + * @generated + */ + public Adapter createArbiterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.arbiter.State State}'. + * + * 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 fr.inria.diverse.event.commons.model.arbiter.State + * @generated + */ + public Adapter createStateAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.arbiter.Transition Transition}'. + * + * 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 fr.inria.diverse.event.commons.model.arbiter.Transition + * @generated + */ + public Adapter createTransitionAdapter() { + 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; + } + +} //ArbiterAdapterFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java new file mode 100644 index 000000000..3a2f5fcaa --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java @@ -0,0 +1,153 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.util; + +import fr.inria.diverse.event.commons.model.arbiter.*; + +import fr.inria.diverse.event.commons.model.property.Property; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * 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 fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage + * @generated + */ +public class ArbiterSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static ArbiterPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public ArbiterSwitch() { + if (modelPackage == null) { + modelPackage = ArbiterPackage.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 T1 doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case ArbiterPackage.ARBITER: { + Arbiter arbiter = (Arbiter)theEObject; + T1 result = caseArbiter(arbiter); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ArbiterPackage.STATE: { + State state = (State)theEObject; + T1 result = caseState(state); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ArbiterPackage.TRANSITION: { + Transition transition = (Transition)theEObject; + T1 result = caseTransition(transition); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Arbiter'. + * + * 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 'Arbiter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    , T extends Transition> T1 caseArbiter(Arbiter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'State'. + * + * 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 'State'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    > T1 caseState(State object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Transition'. + * + * 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 'Transition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    > T1 caseTransition(Transition 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 T1 defaultCase(EObject object) { + return null; + } + +} //ArbiterSwitch diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/EventPrecondition.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/EventPrecondition.java new file mode 100644 index 000000000..a99bfa6db --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/EventPrecondition.java @@ -0,0 +1,50 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +import fr.inria.diverse.event.commons.model.scenario.Event; + +/** + * + * A representation of the model object 'Event Precondition'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.EventPrecondition#getEvent Event}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getEventPrecondition() + * @model + * @generated + */ +public interface EventPrecondition extends Property { + /** + * Returns the value of the 'Event' reference. + * + *

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

    + * + * @return the value of the 'Event' reference. + * @see #setEvent(Event) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getEventPrecondition_Event() + * @model + * @generated + */ + Event getEvent(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.EventPrecondition#getEvent Event}' reference. + * + * + * @param value the new value of the 'Event' reference. + * @see #getEvent() + * @generated + */ + void setEvent(Event value); + +} // EventPrecondition diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java index a5cce62f7..05dcd2388 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java @@ -30,6 +30,15 @@ public interface PropertyFactory extends EFactory { */ CompositeProperty createCompositeProperty(); + /** + * Returns a new object of class 'Event Precondition'. + * + * + * @return a new object of class 'Event Precondition'. + * @generated + */ + EventPrecondition createEventPrecondition(); + /** * Returns a new object of class 'Container Reference Property'. * @@ -66,6 +75,15 @@ public interface PropertyFactory extends EFactory { */ ManyStringAttributeProperty createManyStringAttributeProperty(); + /** + * Returns a new object of class 'Reference'. + * + * + * @return a new object of class 'Reference'. + * @generated + */ + PropertyReference createPropertyReference(); + /** * Returns the package supported by this factory. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java index 1f4fe131a..53c2336b4 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java @@ -123,6 +123,43 @@ public interface PropertyPackage extends EPackage { */ int COMPOSITE_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 0; + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.EventPreconditionImpl Event Precondition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.EventPreconditionImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getEventPrecondition() + * @generated + */ + int EVENT_PRECONDITION = 2; + + /** + * The feature id for the 'Event' reference. + * + * + * @generated + * @ordered + */ + int EVENT_PRECONDITION__EVENT = PROPERTY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Event Precondition' class. + * + * + * @generated + * @ordered + */ + int EVENT_PRECONDITION_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Event Precondition' class. + * + * + * @generated + * @ordered + */ + int EVENT_PRECONDITION_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl State Property}' class. * @@ -131,7 +168,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStateProperty() * @generated */ - int STATE_PROPERTY = 2; + int STATE_PROPERTY = 3; /** * The feature id for the 'Target' reference. @@ -177,7 +214,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBinaryProperty() * @generated */ - int BINARY_PROPERTY = 3; + int BINARY_PROPERTY = 4; /** * The feature id for the 'Target' reference. @@ -250,7 +287,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyReferenceProperty() * @generated */ - int MANY_REFERENCE_PROPERTY = 4; + int MANY_REFERENCE_PROPERTY = 5; /** * The feature id for the 'Target' reference. @@ -314,7 +351,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getSingleReferenceProperty() * @generated */ - int SINGLE_REFERENCE_PROPERTY = 5; + int SINGLE_REFERENCE_PROPERTY = 6; /** * The feature id for the 'Target' reference. @@ -369,7 +406,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getContainerReferenceProperty() * @generated */ - int CONTAINER_REFERENCE_PROPERTY = 6; + int CONTAINER_REFERENCE_PROPERTY = 7; /** * The feature id for the 'Target' reference. @@ -424,7 +461,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyBooleanAttributeProperty() * @generated */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY = 7; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY = 8; /** * The feature id for the 'Target' reference. @@ -497,7 +534,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyIntegerAttributeProperty() * @generated */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY = 8; + int MANY_INTEGER_ATTRIBUTE_PROPERTY = 9; /** * The feature id for the 'Target' reference. @@ -570,7 +607,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyStringAttributeProperty() * @generated */ - int MANY_STRING_ATTRIBUTE_PROPERTY = 9; + int MANY_STRING_ATTRIBUTE_PROPERTY = 10; /** * The feature id for the 'Target' reference. @@ -643,7 +680,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanAttributeProperty() * @generated */ - int BOOLEAN_ATTRIBUTE_PROPERTY = 10; + int BOOLEAN_ATTRIBUTE_PROPERTY = 11; /** * The feature id for the 'Target' reference. @@ -707,7 +744,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getIntegerAttributeProperty() * @generated */ - int INTEGER_ATTRIBUTE_PROPERTY = 11; + int INTEGER_ATTRIBUTE_PROPERTY = 12; /** * The feature id for the 'Target' reference. @@ -771,7 +808,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStringAttributeProperty() * @generated */ - int STRING_ATTRIBUTE_PROPERTY = 12; + int STRING_ATTRIBUTE_PROPERTY = 13; /** * The feature id for the 'Target' reference. @@ -835,7 +872,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepProperty() * @generated */ - int STEP_PROPERTY = 13; + int STEP_PROPERTY = 14; /** * The feature id for the 'Stepping' attribute. @@ -873,6 +910,43 @@ public interface PropertyPackage extends EPackage { */ int STEP_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 1; + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.PropertyReferenceImpl Reference}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyReferenceImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getPropertyReference() + * @generated + */ + int PROPERTY_REFERENCE = 15; + + /** + * The feature id for the 'Referenced Property' reference. + * + * + * @generated + * @ordered + */ + int PROPERTY_REFERENCE__REFERENCED_PROPERTY = PROPERTY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Reference' class. + * + * + * @generated + * @ordered + */ + int PROPERTY_REFERENCE_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Reference' class. + * + * + * @generated + * @ordered + */ + int PROPERTY_REFERENCE_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. * @@ -881,7 +955,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getOperator() * @generated */ - int OPERATOR = 14; + int OPERATOR = 16; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}' enum. @@ -891,7 +965,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanOperator() * @generated */ - int BOOLEAN_OPERATOR = 15; + int BOOLEAN_OPERATOR = 17; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Quantifier Quantifier}' enum. @@ -901,7 +975,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getQuantifier() * @generated */ - int QUANTIFIER = 16; + int QUANTIFIER = 18; /** @@ -912,7 +986,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepping() * @generated */ - int STEPPING = 17; + int STEPPING = 19; /** @@ -1319,6 +1393,27 @@ public interface PropertyPackage extends EPackage { */ EOperation getStepProperty__GetOperation(); + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.PropertyReference Reference}'. + * + * + * @return the meta object for class 'Reference'. + * @see fr.inria.diverse.event.commons.model.property.PropertyReference + * @generated + */ + EClass getPropertyReference(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.property.PropertyReference#getReferencedProperty Referenced Property}'. + * + * + * @return the meta object for the reference 'Referenced Property'. + * @see fr.inria.diverse.event.commons.model.property.PropertyReference#getReferencedProperty() + * @see #getPropertyReference() + * @generated + */ + EReference getPropertyReference_ReferencedProperty(); + /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.Property Property}'. * @@ -1350,6 +1445,27 @@ public interface PropertyPackage extends EPackage { */ EReference getCompositeProperty_Properties(); + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.EventPrecondition Event Precondition}'. + * + * + * @return the meta object for class 'Event Precondition'. + * @see fr.inria.diverse.event.commons.model.property.EventPrecondition + * @generated + */ + EClass getEventPrecondition(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.property.EventPrecondition#getEvent Event}'. + * + * + * @return the meta object for the reference 'Event'. + * @see fr.inria.diverse.event.commons.model.property.EventPrecondition#getEvent() + * @see #getEventPrecondition() + * @generated + */ + EReference getEventPrecondition_Event(); + /** * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}'. * @@ -1741,6 +1857,24 @@ interface Literals { */ EOperation STEP_PROPERTY___GET_OPERATION = eINSTANCE.getStepProperty__GetOperation(); + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.PropertyReferenceImpl Reference}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyReferenceImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getPropertyReference() + * @generated + */ + EClass PROPERTY_REFERENCE = eINSTANCE.getPropertyReference(); + + /** + * The meta object literal for the 'Referenced Property' reference feature. + * + * + * @generated + */ + EReference PROPERTY_REFERENCE__REFERENCED_PROPERTY = eINSTANCE.getPropertyReference_ReferencedProperty(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.PropertyImpl Property}' class. * @@ -1769,6 +1903,24 @@ interface Literals { */ EReference COMPOSITE_PROPERTY__PROPERTIES = eINSTANCE.getCompositeProperty_Properties(); + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.EventPreconditionImpl Event Precondition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.EventPreconditionImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getEventPrecondition() + * @generated + */ + EClass EVENT_PRECONDITION = eINSTANCE.getEventPrecondition(); + + /** + * The meta object literal for the 'Event' reference feature. + * + * + * @generated + */ + EReference EVENT_PRECONDITION__EVENT = eINSTANCE.getEventPrecondition_Event(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyReference.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyReference.java new file mode 100644 index 000000000..82d3daa4a --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyReference.java @@ -0,0 +1,49 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Reference'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.PropertyReference#getReferencedProperty Referenced Property}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getPropertyReference() + * @model + * @generated + */ +public interface PropertyReference extends Property { + /** + * Returns the value of the 'Referenced Property' reference. + * + *

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

    + * + * @return the value of the 'Referenced Property' reference. + * @see #setReferencedProperty(Property) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getPropertyReference_ReferencedProperty() + * @model + * @generated + */ + Property getReferencedProperty(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.PropertyReference#getReferencedProperty Referenced Property}' reference. + * + * + * @param value the new value of the 'Referenced Property' reference. + * @see #getReferencedProperty() + * @generated + */ + void setReferencedProperty(Property value); + +} // PropertyReference diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/EventPreconditionImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/EventPreconditionImpl.java new file mode 100644 index 000000000..1dbc469d9 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/EventPreconditionImpl.java @@ -0,0 +1,156 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.EventPrecondition; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +import fr.inria.diverse.event.commons.model.scenario.Event; +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; + +/** + * + * An implementation of the model object 'Event Precondition'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.EventPreconditionImpl#getEvent Event}
    • + *
    + * + * @generated + */ +public class EventPreconditionImpl extends PropertyImpl implements EventPrecondition { + /** + * The cached value of the '{@link #getEvent() Event}' reference. + * + * + * @see #getEvent() + * @generated + * @ordered + */ + protected Event event; + + /** + * + * + * @generated + */ + protected EventPreconditionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.EVENT_PRECONDITION; + } + + /** + * + * + * @generated + */ + public Event getEvent() { + if (event != null && event.eIsProxy()) { + InternalEObject oldEvent = (InternalEObject)event; + event = (Event)eResolveProxy(oldEvent); + if (event != oldEvent) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertyPackage.EVENT_PRECONDITION__EVENT, oldEvent, event)); + } + } + return event; + } + + /** + * + * + * @generated + */ + public Event basicGetEvent() { + return event; + } + + /** + * + * + * @generated + */ + public void setEvent(Event newEvent) { + Event oldEvent = event; + event = newEvent; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.EVENT_PRECONDITION__EVENT, oldEvent, event)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.EVENT_PRECONDITION__EVENT: + if (resolve) return getEvent(); + return basicGetEvent(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.EVENT_PRECONDITION__EVENT: + setEvent((Event)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.EVENT_PRECONDITION__EVENT: + setEvent((Event)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.EVENT_PRECONDITION__EVENT: + return event != null; + } + return super.eIsSet(featureID); + } + +} //EventPreconditionImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java index c36186b0e..539220131 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java @@ -58,10 +58,12 @@ public PropertyFactoryImpl() { public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case PropertyPackage.COMPOSITE_PROPERTY: return createCompositeProperty(); + case PropertyPackage.EVENT_PRECONDITION: return createEventPrecondition(); case PropertyPackage.CONTAINER_REFERENCE_PROPERTY: return createContainerReferenceProperty(); case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY: return createManyBooleanAttributeProperty(); case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY: return createManyIntegerAttributeProperty(); case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY: return createManyStringAttributeProperty(); + case PropertyPackage.PROPERTY_REFERENCE: return createPropertyReference(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -119,6 +121,16 @@ public CompositeProperty createCompositeProperty() { return compositeProperty; } + /** + * + * + * @generated + */ + public EventPrecondition createEventPrecondition() { + EventPreconditionImpl eventPrecondition = new EventPreconditionImpl(); + return eventPrecondition; + } + /** * * @@ -159,6 +171,16 @@ public ManyStringAttributeProperty createManyStringAttributeProperty() { return manyStringAttributeProperty; } + /** + * + * + * @generated + */ + public PropertyReference createPropertyReference() { + PropertyReferenceImpl propertyReference = new PropertyReferenceImpl(); + return propertyReference; + } + /** * * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java index 396af5e55..4c320ca43 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java @@ -7,6 +7,7 @@ import fr.inria.diverse.event.commons.model.property.BooleanOperator; import fr.inria.diverse.event.commons.model.property.CompositeProperty; import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty; +import fr.inria.diverse.event.commons.model.property.EventPrecondition; import fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty; import fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty; import fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty; @@ -16,6 +17,7 @@ import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.property.PropertyFactory; import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.PropertyReference; import fr.inria.diverse.event.commons.model.property.Quantifier; import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty; import fr.inria.diverse.event.commons.model.property.StateProperty; @@ -23,6 +25,8 @@ import fr.inria.diverse.event.commons.model.property.Stepping; import fr.inria.diverse.event.commons.model.property.StringAttributeProperty; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EEnum; @@ -126,6 +130,13 @@ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage */ private EClass stepPropertyEClass = null; + /** + * + * + * @generated + */ + private EClass propertyReferenceEClass = null; + /** * * @@ -140,6 +151,13 @@ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage */ private EClass compositePropertyEClass = null; + /** + * + * + * @generated + */ + private EClass eventPreconditionEClass = null; + /** * * @@ -214,14 +232,16 @@ public static PropertyPackage init() { isInited = true; - // Initialize simple dependencies - EcorePackage.eINSTANCE.eClass(); + // Obtain or create and register interdependencies + ScenarioPackageImpl theScenarioPackage = (ScenarioPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ScenarioPackage.eNS_URI) instanceof ScenarioPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ScenarioPackage.eNS_URI) : ScenarioPackage.eINSTANCE); // Create package meta-data objects thePropertyPackage.createPackageContents(); + theScenarioPackage.createPackageContents(); // Initialize created meta-data thePropertyPackage.initializePackageContents(); + theScenarioPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed thePropertyPackage.freeze(); @@ -574,6 +594,24 @@ public EOperation getStepProperty__GetOperation() { return stepPropertyEClass.getEOperations().get(0); } + /** + * + * + * @generated + */ + public EClass getPropertyReference() { + return propertyReferenceEClass; + } + + /** + * + * + * @generated + */ + public EReference getPropertyReference_ReferencedProperty() { + return (EReference)propertyReferenceEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -601,6 +639,24 @@ public EReference getCompositeProperty_Properties() { return (EReference)compositePropertyEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + public EClass getEventPrecondition() { + return eventPreconditionEClass; + } + + /** + * + * + * @generated + */ + public EReference getEventPrecondition_Event() { + return (EReference)eventPreconditionEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -670,6 +726,9 @@ public void createPackageContents() { compositePropertyEClass = createEClass(COMPOSITE_PROPERTY); createEReference(compositePropertyEClass, COMPOSITE_PROPERTY__PROPERTIES); + eventPreconditionEClass = createEClass(EVENT_PRECONDITION); + createEReference(eventPreconditionEClass, EVENT_PRECONDITION__EVENT); + statePropertyEClass = createEClass(STATE_PROPERTY); createEReference(statePropertyEClass, STATE_PROPERTY__TARGET); createEOperation(statePropertyEClass, STATE_PROPERTY___GET_FEATURE); @@ -720,6 +779,9 @@ public void createPackageContents() { createEAttribute(stepPropertyEClass, STEP_PROPERTY__STEPPING); createEOperation(stepPropertyEClass, STEP_PROPERTY___GET_OPERATION); + propertyReferenceEClass = createEClass(PROPERTY_REFERENCE); + createEReference(propertyReferenceEClass, PROPERTY_REFERENCE__REFERENCED_PROPERTY); + // Create enums operatorEEnum = createEEnum(OPERATOR); booleanOperatorEEnum = createEEnum(BOOLEAN_OPERATOR); @@ -751,6 +813,7 @@ public void initializePackageContents() { setNsURI(eNS_URI); // Obtain other dependent packages + ScenarioPackage theScenarioPackage = (ScenarioPackage)EPackage.Registry.INSTANCE.getEPackage(ScenarioPackage.eNS_URI); EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); // Create type parameters @@ -790,6 +853,7 @@ public void initializePackageContents() { // Add supertypes to classes compositePropertyEClass.getESuperTypes().add(this.getProperty()); + eventPreconditionEClass.getESuperTypes().add(this.getProperty()); statePropertyEClass.getESuperTypes().add(this.getProperty()); g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(binaryPropertyEClass_T); @@ -832,6 +896,7 @@ public void initializePackageContents() { g1.getETypeArguments().add(g2); stringAttributePropertyEClass.getEGenericSuperTypes().add(g1); stepPropertyEClass.getESuperTypes().add(this.getProperty()); + propertyReferenceEClass.getESuperTypes().add(this.getProperty()); // Initialize classes, features, and operations; add parameters initEClass(propertyEClass, Property.class, "Property", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -839,6 +904,12 @@ public void initializePackageContents() { initEClass(compositePropertyEClass, CompositeProperty.class, "CompositeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getCompositeProperty_Properties(), this.getProperty(), null, "properties", null, 0, -1, CompositeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(eventPreconditionEClass, EventPrecondition.class, "EventPrecondition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(theScenarioPackage.getEvent()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + initEReference(getEventPrecondition_Event(), g1, null, "event", null, 0, 1, EventPrecondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(statePropertyEClass, StateProperty.class, "StateProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(statePropertyEClass_T); initEReference(getStateProperty_Target(), g1, null, "target", null, 0, 1, StateProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -897,6 +968,9 @@ public void initializePackageContents() { initEOperation(getStepProperty__GetOperation(), theEcorePackage.getEOperation(), "getOperation", 0, 1, IS_UNIQUE, IS_ORDERED); + initEClass(propertyReferenceEClass, PropertyReference.class, "PropertyReference", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPropertyReference_ReferencedProperty(), this.getProperty(), null, "referencedProperty", null, 0, 1, PropertyReference.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(operatorEEnum, Operator.class, "Operator"); addEEnumLiteral(operatorEEnum, Operator.EQUAL); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyReferenceImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyReferenceImpl.java new file mode 100644 index 000000000..046ff94d3 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyReferenceImpl.java @@ -0,0 +1,156 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.Property; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.PropertyReference; + +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; + +/** + * + * An implementation of the model object 'Reference'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.PropertyReferenceImpl#getReferencedProperty Referenced Property}
    • + *
    + * + * @generated + */ +public class PropertyReferenceImpl extends PropertyImpl implements PropertyReference { + /** + * The cached value of the '{@link #getReferencedProperty() Referenced Property}' reference. + * + * + * @see #getReferencedProperty() + * @generated + * @ordered + */ + protected Property referencedProperty; + + /** + * + * + * @generated + */ + protected PropertyReferenceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.PROPERTY_REFERENCE; + } + + /** + * + * + * @generated + */ + public Property getReferencedProperty() { + if (referencedProperty != null && referencedProperty.eIsProxy()) { + InternalEObject oldReferencedProperty = (InternalEObject)referencedProperty; + referencedProperty = (Property)eResolveProxy(oldReferencedProperty); + if (referencedProperty != oldReferencedProperty) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY, oldReferencedProperty, referencedProperty)); + } + } + return referencedProperty; + } + + /** + * + * + * @generated + */ + public Property basicGetReferencedProperty() { + return referencedProperty; + } + + /** + * + * + * @generated + */ + public void setReferencedProperty(Property newReferencedProperty) { + Property oldReferencedProperty = referencedProperty; + referencedProperty = newReferencedProperty; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY, oldReferencedProperty, referencedProperty)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY: + if (resolve) return getReferencedProperty(); + return basicGetReferencedProperty(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY: + setReferencedProperty((Property)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY: + setReferencedProperty((Property)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY: + return referencedProperty != null; + } + return super.eIsSet(featureID); + } + +} //PropertyReferenceImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java index a79ce9f69..7da1f38ed 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java @@ -76,6 +76,10 @@ public Adapter caseCompositeProperty(CompositeProperty object) { return createCompositePropertyAdapter(); } @Override + public Adapter caseEventPrecondition(EventPrecondition object) { + return createEventPreconditionAdapter(); + } + @Override public Adapter caseStateProperty(StateProperty object) { return createStatePropertyAdapter(); } @@ -124,6 +128,10 @@ public Adapter caseStepProperty(StepProperty object) { return createStepPropertyAdapter(); } @Override + public Adapter casePropertyReference(PropertyReference object) { + return createPropertyReferenceAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -311,6 +319,20 @@ public Adapter createStepPropertyAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.PropertyReference Reference}'. + * + * 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 fr.inria.diverse.event.commons.model.property.PropertyReference + * @generated + */ + public Adapter createPropertyReferenceAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.Property Property}'. * @@ -339,6 +361,20 @@ public Adapter createCompositePropertyAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.EventPrecondition Event Precondition}'. + * + * 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 fr.inria.diverse.event.commons.model.property.EventPrecondition + * @generated + */ + public Adapter createEventPreconditionAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java index bb6927f48..88654c06a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java @@ -79,6 +79,13 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } + case PropertyPackage.EVENT_PRECONDITION: { + EventPrecondition eventPrecondition = (EventPrecondition)theEObject; + T1 result = caseEventPrecondition(eventPrecondition); + if (result == null) result = caseProperty(eventPrecondition); + if (result == null) result = defaultCase(theEObject); + return result; + } case PropertyPackage.STATE_PROPERTY: { StateProperty stateProperty = (StateProperty)theEObject; T1 result = caseStateProperty(stateProperty); @@ -173,6 +180,13 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } + case PropertyPackage.PROPERTY_REFERENCE: { + PropertyReference propertyReference = (PropertyReference)theEObject; + T1 result = casePropertyReference(propertyReference); + if (result == null) result = caseProperty(propertyReference); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -357,6 +371,21 @@ public T1 caseStepProperty(StepProperty object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Reference'. + * + * 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 'Reference'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 casePropertyReference(PropertyReference object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Property'. * @@ -387,6 +416,21 @@ public T1 caseCompositeProperty(CompositeProperty object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Event Precondition'. + * + * 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 'Event Precondition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseEventPrecondition(EventPrecondition object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java index 8d2c90971..eef3e4088 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/report/impl/ReportPackageImpl.java @@ -84,9 +84,6 @@ public static ReportPackage init() { isInited = true; - // Initialize simple dependencies - ScenarioPackage.eINSTANCE.eClass(); - // Create package meta-data objects theReportPackage.createPackageContents(); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/EventOccurrence.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/EventOccurrence.java index faef7d725..9955e7363 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/EventOccurrence.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/EventOccurrence.java @@ -2,7 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario; -import fr.inria.diverse.event.commons.model.property.StateProperty; +import fr.inria.diverse.event.commons.model.property.Property; /** * @@ -21,7 +21,7 @@ * @model abstract="true" * @generated */ -public interface EventOccurrence, P extends StateProperty> extends ScenarioElement

    { +public interface EventOccurrence, P extends Property> extends ScenarioElement

    { /** * Returns the value of the 'Event' containment reference. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java index 3759f78b0..2185d9615 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioElement.java @@ -2,8 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario; -import fr.inria.diverse.event.commons.model.property.StateProperty; - +import fr.inria.diverse.event.commons.model.property.Property; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; @@ -25,7 +24,7 @@ * @model abstract="true" * @generated */ -public interface ScenarioElement

    > extends EObject { +public interface ScenarioElement

    extends EObject { /** * Returns the value of the 'Next Elements' containment reference list. * The list contents are of type {@link fr.inria.diverse.event.commons.model.scenario.ScenarioElement}<P>. @@ -51,7 +50,7 @@ public interface ScenarioElement

    > extends EObject { *

    * * @return the value of the 'Guard' containment reference. - * @see #setGuard(StateProperty) + * @see #setGuard(Property) * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioElement_Guard() * @model containment="true" * @generated diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSM.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSM.java index 674165c9f..5665378eb 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSM.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSM.java @@ -2,8 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario; -import fr.inria.diverse.event.commons.model.property.StateProperty; - +import fr.inria.diverse.event.commons.model.property.Property; import org.eclipse.emf.common.util.EList; /** @@ -19,13 +18,14 @@ *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getInitialState Initial State}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getAcceptingStates Accepting States}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getTransitions Transitions}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getName Name}
  • * * * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSM() * @model abstract="true" * @generated */ -public interface ScenarioFSM

    , E extends Event, S extends ScenarioFSMState, T extends ScenarioFSMTransition> extends ScenarioElement

    { +public interface ScenarioFSM

    , S extends ScenarioFSMState, T extends ScenarioFSMTransition> extends ScenarioElement

    { /** * Returns the value of the 'States' containment reference list. * @@ -97,4 +97,30 @@ public interface ScenarioFSM

    , E extends Event, S e */ EList getTransitions(); + /** + * 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 fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSM_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + } // ScenarioFSM diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMState.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMState.java index 22e7551c0..73d8a2504 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMState.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMState.java @@ -18,6 +18,7 @@ *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getEvent Event}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getOutgoingTransitions Outgoing Transitions}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getIncomingTransitions Incoming Transitions}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getName Name}
  • * * * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMState() @@ -85,4 +86,30 @@ public interface ScenarioFSMState, T extends ScenarioFSMTrans */ EList getIncomingTransitions(); + /** + * 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 fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMState_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + } // ScenarioFSMState diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMTransition.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMTransition.java index 9c4f730d5..4f06e1fee 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMTransition.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFSMTransition.java @@ -2,7 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario; -import fr.inria.diverse.event.commons.model.property.StateProperty; +import fr.inria.diverse.event.commons.model.property.Property; import org.eclipse.emf.ecore.EObject; /** @@ -17,13 +17,14 @@ *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getGuard Guard}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getSource Source}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getTarget Target}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getName Name}
  • * * * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMTransition() * @model abstract="true" * @generated */ -public interface ScenarioFSMTransition

    , S extends ScenarioFSMState> extends EObject { +public interface ScenarioFSMTransition

    > extends EObject { /** * Returns the value of the 'Guard' containment reference. * @@ -33,7 +34,7 @@ public interface ScenarioFSMTransition

    , S extends Sce *

    * * @return the value of the 'Guard' containment reference. - * @see #setGuard(StateProperty) + * @see #setGuard(Property) * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMTransition_Guard() * @model containment="true" * @generated @@ -106,4 +107,30 @@ public interface ScenarioFSMTransition

    , S extends Sce */ void setTarget(S 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 fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getScenarioFSMTransition_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + } // ScenarioFSMTransition diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java index 6db6403d0..ce85f4138 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java @@ -406,6 +406,15 @@ public interface ScenarioPackage extends EPackage { */ int SCENARIO_FSM__TRANSITIONS = SCENARIO_ELEMENT_FEATURE_COUNT + 3; + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM__NAME = SCENARIO_ELEMENT_FEATURE_COUNT + 4; + /** * The number of structural features of the 'FSM' class. * @@ -413,7 +422,7 @@ public interface ScenarioPackage extends EPackage { * @generated * @ordered */ - int SCENARIO_FSM_FEATURE_COUNT = SCENARIO_ELEMENT_FEATURE_COUNT + 4; + int SCENARIO_FSM_FEATURE_COUNT = SCENARIO_ELEMENT_FEATURE_COUNT + 5; /** * The number of operations of the 'FSM' class. @@ -461,6 +470,15 @@ public interface ScenarioPackage extends EPackage { */ int SCENARIO_FSM_STATE__INCOMING_TRANSITIONS = 2; + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_STATE__NAME = 3; + /** * The number of structural features of the 'FSM State' class. * @@ -468,7 +486,7 @@ public interface ScenarioPackage extends EPackage { * @generated * @ordered */ - int SCENARIO_FSM_STATE_FEATURE_COUNT = 3; + int SCENARIO_FSM_STATE_FEATURE_COUNT = 4; /** * The number of operations of the 'FSM State' class. @@ -516,6 +534,15 @@ public interface ScenarioPackage extends EPackage { */ int SCENARIO_FSM_TRANSITION__TARGET = 2; + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM_TRANSITION__NAME = 3; + /** * The number of structural features of the 'FSM Transition' class. * @@ -523,7 +550,7 @@ public interface ScenarioPackage extends EPackage { * @generated * @ordered */ - int SCENARIO_FSM_TRANSITION_FEATURE_COUNT = 3; + int SCENARIO_FSM_TRANSITION_FEATURE_COUNT = 4; /** * The number of operations of the 'FSM Transition' class. @@ -747,6 +774,17 @@ public interface ScenarioPackage extends EPackage { */ EReference getScenarioFSM_Transitions(); + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSM#getName() + * @see #getScenarioFSM() + * @generated + */ + EAttribute getScenarioFSM_Name(); + /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState FSM State}'. * @@ -790,6 +828,17 @@ public interface ScenarioPackage extends EPackage { */ EReference getScenarioFSMState_IncomingTransitions(); + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState#getName() + * @see #getScenarioFSMState() + * @generated + */ + EAttribute getScenarioFSMState_Name(); + /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition FSM Transition}'. * @@ -833,6 +882,17 @@ public interface ScenarioPackage extends EPackage { */ EReference getScenarioFSMTransition_Target(); + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition#getName() + * @see #getScenarioFSMTransition() + * @generated + */ + EAttribute getScenarioFSMTransition_Name(); + /** * Returns the factory that creates the instances of the model. * @@ -1032,6 +1092,14 @@ interface Literals { */ EReference SCENARIO_FSM__TRANSITIONS = eINSTANCE.getScenarioFSM_Transitions(); + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO_FSM__NAME = eINSTANCE.getScenarioFSM_Name(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl FSM State}' class. * @@ -1066,6 +1134,14 @@ interface Literals { */ EReference SCENARIO_FSM_STATE__INCOMING_TRANSITIONS = eINSTANCE.getScenarioFSMState_IncomingTransitions(); + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO_FSM_STATE__NAME = eINSTANCE.getScenarioFSMState_Name(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl FSM Transition}' class. * @@ -1100,6 +1176,14 @@ interface Literals { */ EReference SCENARIO_FSM_TRANSITION__TARGET = eINSTANCE.getScenarioFSMTransition_Target(); + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute SCENARIO_FSM_TRANSITION__NAME = eINSTANCE.getScenarioFSMTransition_Name(); + } } //ScenarioPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventOccurrenceImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventOccurrenceImpl.java index 476bd1e6a..a38e05db7 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventOccurrenceImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/EventOccurrenceImpl.java @@ -2,8 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; -import fr.inria.diverse.event.commons.model.property.StateProperty; - +import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.scenario.Event; import fr.inria.diverse.event.commons.model.scenario.EventOccurrence; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; @@ -30,7 +29,7 @@ * * @generated */ -public abstract class EventOccurrenceImpl, P extends StateProperty> extends ScenarioElementImpl

    implements EventOccurrence { +public abstract class EventOccurrenceImpl, P extends Property> extends ScenarioElementImpl

    implements EventOccurrence { /** * The cached value of the '{@link #getEvent() Event}' containment reference. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java index 5bcc0139f..2067e55e3 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioElementImpl.java @@ -2,8 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; -import fr.inria.diverse.event.commons.model.property.StateProperty; - +import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.scenario.ScenarioElement; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; @@ -37,7 +36,7 @@ * * @generated */ -public abstract class ScenarioElementImpl

    > extends MinimalEObjectImpl.Container implements ScenarioElement

    { +public abstract class ScenarioElementImpl

    extends MinimalEObjectImpl.Container implements ScenarioElement

    { /** * The cached value of the '{@link #getNextElements() Next Elements}' containment reference list. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMImpl.java index 512f29e61..4dc516d68 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMImpl.java @@ -2,8 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; -import fr.inria.diverse.event.commons.model.property.StateProperty; - +import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.scenario.Event; import fr.inria.diverse.event.commons.model.scenario.ScenarioFSM; import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState; @@ -37,11 +36,12 @@ *

  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl#getInitialState Initial State}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl#getAcceptingStates Accepting States}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl#getTransitions Transitions}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMImpl#getName Name}
  • * * * @generated */ -public abstract class ScenarioFSMImpl

    , E extends Event, S extends ScenarioFSMState, T extends ScenarioFSMTransition> extends ScenarioElementImpl

    implements ScenarioFSM { +public abstract class ScenarioFSMImpl

    , S extends ScenarioFSMState, T extends ScenarioFSMTransition> extends ScenarioElementImpl

    implements ScenarioFSM { /** * The cached value of the '{@link #getStates() States}' containment reference list. * @@ -82,6 +82,26 @@ public abstract class ScenarioFSMImpl

    , E extends Even */ protected EList transitions; + /** + * 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; + /** * * @@ -176,6 +196,27 @@ public EList getTransitions() { return transitions; } + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM__NAME, oldName, name)); + } + /** * * @@ -209,6 +250,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return getAcceptingStates(); case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: return getTransitions(); + case ScenarioPackage.SCENARIO_FSM__NAME: + return getName(); } return super.eGet(featureID, resolve, coreType); } @@ -237,6 +280,9 @@ public void eSet(int featureID, Object newValue) { getTransitions().clear(); getTransitions().addAll((Collection)newValue); return; + case ScenarioPackage.SCENARIO_FSM__NAME: + setName((String)newValue); + return; } super.eSet(featureID, newValue); } @@ -261,6 +307,9 @@ public void eUnset(int featureID) { case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: getTransitions().clear(); return; + case ScenarioPackage.SCENARIO_FSM__NAME: + setName(NAME_EDEFAULT); + return; } super.eUnset(featureID); } @@ -281,8 +330,26 @@ public boolean eIsSet(int featureID) { return acceptingStates != null && !acceptingStates.isEmpty(); case ScenarioPackage.SCENARIO_FSM__TRANSITIONS: return transitions != null && !transitions.isEmpty(); + case ScenarioPackage.SCENARIO_FSM__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } 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(); + } + } //ScenarioFSMImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java index 4146f2da3..83b2a615d 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java @@ -33,6 +33,7 @@ *

  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl#getEvent Event}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl#getOutgoingTransitions Outgoing Transitions}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl#getIncomingTransitions Incoming Transitions}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMStateImpl#getName Name}
  • * * * @generated @@ -68,6 +69,26 @@ public abstract class ScenarioFSMStateImpl, T extends Scenari */ protected EList incomingTransitions; + /** + * 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; + /** * * @@ -154,6 +175,27 @@ public EList getIncomingTransitions() { return incomingTransitions; } + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_STATE__NAME, oldName, name)); + } + /** * * @@ -203,6 +245,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return getOutgoingTransitions(); case ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS: return getIncomingTransitions(); + case ScenarioPackage.SCENARIO_FSM_STATE__NAME: + return getName(); } return super.eGet(featureID, resolve, coreType); } @@ -227,6 +271,9 @@ public void eSet(int featureID, Object newValue) { getIncomingTransitions().clear(); getIncomingTransitions().addAll((Collection)newValue); return; + case ScenarioPackage.SCENARIO_FSM_STATE__NAME: + setName((String)newValue); + return; } super.eSet(featureID, newValue); } @@ -248,6 +295,9 @@ public void eUnset(int featureID) { case ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS: getIncomingTransitions().clear(); return; + case ScenarioPackage.SCENARIO_FSM_STATE__NAME: + setName(NAME_EDEFAULT); + return; } super.eUnset(featureID); } @@ -266,8 +316,26 @@ public boolean eIsSet(int featureID) { return outgoingTransitions != null && !outgoingTransitions.isEmpty(); case ScenarioPackage.SCENARIO_FSM_STATE__INCOMING_TRANSITIONS: return incomingTransitions != null && !incomingTransitions.isEmpty(); + case ScenarioPackage.SCENARIO_FSM_STATE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } 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(); + } + } //ScenarioFSMStateImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMTransitionImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMTransitionImpl.java index 89d853c76..8a8ef2916 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMTransitionImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFSMTransitionImpl.java @@ -2,8 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; -import fr.inria.diverse.event.commons.model.property.StateProperty; - +import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMState; import fr.inria.diverse.event.commons.model.scenario.ScenarioFSMTransition; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; @@ -26,11 +25,12 @@ *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl#getGuard Guard}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl#getSource Source}
  • *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl#getTarget Target}
  • + *
  • {@link fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFSMTransitionImpl#getName Name}
  • * * * @generated */ -public abstract class ScenarioFSMTransitionImpl

    , S extends ScenarioFSMState> extends MinimalEObjectImpl.Container implements ScenarioFSMTransition { +public abstract class ScenarioFSMTransitionImpl

    > extends MinimalEObjectImpl.Container implements ScenarioFSMTransition { /** * The cached value of the '{@link #getGuard() Guard}' containment reference. * @@ -61,6 +61,26 @@ public abstract class ScenarioFSMTransitionImpl

    , S ex */ protected S target; + /** + * 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; + /** * * @@ -245,6 +265,27 @@ else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET, newTarget, newTarget)); } + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_FSM_TRANSITION__NAME, oldName, name)); + } + /** * * @@ -300,6 +341,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: if (resolve) return getTarget(); return basicGetTarget(); + case ScenarioPackage.SCENARIO_FSM_TRANSITION__NAME: + return getName(); } return super.eGet(featureID, resolve, coreType); } @@ -322,6 +365,9 @@ public void eSet(int featureID, Object newValue) { case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: setTarget((S)newValue); return; + case ScenarioPackage.SCENARIO_FSM_TRANSITION__NAME: + setName((String)newValue); + return; } super.eSet(featureID, newValue); } @@ -343,6 +389,9 @@ public void eUnset(int featureID) { case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: setTarget((S)null); return; + case ScenarioPackage.SCENARIO_FSM_TRANSITION__NAME: + setName(NAME_EDEFAULT); + return; } super.eUnset(featureID); } @@ -361,8 +410,26 @@ public boolean eIsSet(int featureID) { return source != null; case ScenarioPackage.SCENARIO_FSM_TRANSITION__TARGET: return target != null; + case ScenarioPackage.SCENARIO_FSM_TRANSITION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } 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(); + } + } //ScenarioFSMTransitionImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java index 49b9789ab..569334644 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java @@ -4,6 +4,7 @@ import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl; import fr.inria.diverse.event.commons.model.scenario.ElementProvider; import fr.inria.diverse.event.commons.model.scenario.ElementQuery; import fr.inria.diverse.event.commons.model.scenario.ElementReference; @@ -149,14 +150,16 @@ public static ScenarioPackage init() { isInited = true; - // Initialize simple dependencies - PropertyPackage.eINSTANCE.eClass(); + // Obtain or create and register interdependencies + PropertyPackageImpl thePropertyPackage = (PropertyPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(PropertyPackage.eNS_URI) instanceof PropertyPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(PropertyPackage.eNS_URI) : PropertyPackage.eINSTANCE); // Create package meta-data objects theScenarioPackage.createPackageContents(); + thePropertyPackage.createPackageContents(); // Initialize created meta-data theScenarioPackage.initializePackageContents(); + thePropertyPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theScenarioPackage.freeze(); @@ -347,6 +350,15 @@ public EReference getScenarioFSM_Transitions() { return (EReference)scenarioFSMEClass.getEStructuralFeatures().get(3); } + /** + * + * + * @generated + */ + public EAttribute getScenarioFSM_Name() { + return (EAttribute)scenarioFSMEClass.getEStructuralFeatures().get(4); + } + /** * * @@ -383,6 +395,15 @@ public EReference getScenarioFSMState_IncomingTransitions() { return (EReference)scenarioFSMStateEClass.getEStructuralFeatures().get(2); } + /** + * + * + * @generated + */ + public EAttribute getScenarioFSMState_Name() { + return (EAttribute)scenarioFSMStateEClass.getEStructuralFeatures().get(3); + } + /** * * @@ -419,6 +440,15 @@ public EReference getScenarioFSMTransition_Target() { return (EReference)scenarioFSMTransitionEClass.getEStructuralFeatures().get(2); } + /** + * + * + * @generated + */ + public EAttribute getScenarioFSMTransition_Name() { + return (EAttribute)scenarioFSMTransitionEClass.getEStructuralFeatures().get(3); + } + /** * * @@ -474,16 +504,19 @@ public void createPackageContents() { createEReference(scenarioFSMEClass, SCENARIO_FSM__INITIAL_STATE); createEReference(scenarioFSMEClass, SCENARIO_FSM__ACCEPTING_STATES); createEReference(scenarioFSMEClass, SCENARIO_FSM__TRANSITIONS); + createEAttribute(scenarioFSMEClass, SCENARIO_FSM__NAME); scenarioFSMStateEClass = createEClass(SCENARIO_FSM_STATE); createEReference(scenarioFSMStateEClass, SCENARIO_FSM_STATE__EVENT); createEReference(scenarioFSMStateEClass, SCENARIO_FSM_STATE__OUTGOING_TRANSITIONS); createEReference(scenarioFSMStateEClass, SCENARIO_FSM_STATE__INCOMING_TRANSITIONS); + createEAttribute(scenarioFSMStateEClass, SCENARIO_FSM_STATE__NAME); scenarioFSMTransitionEClass = createEClass(SCENARIO_FSM_TRANSITION); createEReference(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__GUARD); createEReference(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__SOURCE); createEReference(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__TARGET); + createEAttribute(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__NAME); } /** @@ -544,17 +577,11 @@ public void initializePackageContents() { g2 = createEGenericType(); g1.getETypeArguments().add(g2); eventOccurrenceEClass_E.getEBounds().add(g1); - g1 = createEGenericType(thePropertyPackage.getStateProperty()); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); + g1 = createEGenericType(thePropertyPackage.getProperty()); eventOccurrenceEClass_P.getEBounds().add(g1); - g1 = createEGenericType(thePropertyPackage.getStateProperty()); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); + g1 = createEGenericType(thePropertyPackage.getProperty()); scenarioElementEClass_P.getEBounds().add(g1); - g1 = createEGenericType(thePropertyPackage.getStateProperty()); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); + g1 = createEGenericType(thePropertyPackage.getProperty()); scenarioFSMEClass_P.getEBounds().add(g1); g1 = createEGenericType(this.getEvent()); g2 = createEGenericType(); @@ -582,9 +609,7 @@ public void initializePackageContents() { g2 = createEGenericType(); g1.getETypeArguments().add(g2); scenarioFSMStateEClass_T.getEBounds().add(g1); - g1 = createEGenericType(thePropertyPackage.getStateProperty()); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); + g1 = createEGenericType(thePropertyPackage.getProperty()); scenarioFSMTransitionEClass_P.getEBounds().add(g1); g1 = createEGenericType(this.getScenarioFSMState()); g2 = createEGenericType(); @@ -654,6 +679,7 @@ public void initializePackageContents() { initEReference(getScenarioFSM_AcceptingStates(), g1, null, "acceptingStates", null, 0, -1, ScenarioFSM.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(scenarioFSMEClass_T); initEReference(getScenarioFSM_Transitions(), g1, null, "transitions", null, 0, -1, ScenarioFSM.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenarioFSM_Name(), ecorePackage.getEString(), "name", null, 0, 1, ScenarioFSM.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(scenarioFSMStateEClass, ScenarioFSMState.class, "ScenarioFSMState", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(scenarioFSMStateEClass_E); @@ -662,6 +688,7 @@ public void initializePackageContents() { initEReference(getScenarioFSMState_OutgoingTransitions(), g1, this.getScenarioFSMTransition_Source(), "outgoingTransitions", null, 0, -1, ScenarioFSMState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(scenarioFSMStateEClass_T); initEReference(getScenarioFSMState_IncomingTransitions(), g1, this.getScenarioFSMTransition_Target(), "incomingTransitions", null, 0, -1, ScenarioFSMState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenarioFSMState_Name(), ecorePackage.getEString(), "name", null, 0, 1, ScenarioFSMState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(scenarioFSMTransitionEClass, ScenarioFSMTransition.class, "ScenarioFSMTransition", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(scenarioFSMTransitionEClass_P); @@ -670,6 +697,7 @@ public void initializePackageContents() { initEReference(getScenarioFSMTransition_Source(), g1, this.getScenarioFSMState_OutgoingTransitions(), "source", null, 1, 1, ScenarioFSMTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(scenarioFSMTransitionEClass_S); initEReference(getScenarioFSMTransition_Target(), g1, this.getScenarioFSMState_IncomingTransitions(), "target", null, 1, 1, ScenarioFSMTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getScenarioFSMTransition_Name(), ecorePackage.getEString(), "name", null, 0, 1, ScenarioFSMTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Create resource createResource(eNS_URI); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java index 1eaf88c4b..ab40afcf9 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario.util; +import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.scenario.*; @@ -90,15 +91,15 @@ public > Adapter caseElementQuery(ElementQuery, P extends StateProperty> Adapter caseEventOccurrence(EventOccurrence object) { + public , P extends Property> Adapter caseEventOccurrence(EventOccurrence object) { return createEventOccurrenceAdapter(); } @Override - public

    > Adapter caseScenarioElement(ScenarioElement

    object) { + public

    Adapter caseScenarioElement(ScenarioElement

    object) { return createScenarioElementAdapter(); } @Override - public

    , E extends Event, S extends ScenarioFSMState, T extends ScenarioFSMTransition> Adapter caseScenarioFSM(ScenarioFSM object) { + public

    , S extends ScenarioFSMState, T extends ScenarioFSMTransition> Adapter caseScenarioFSM(ScenarioFSM object) { return createScenarioFSMAdapter(); } @Override @@ -106,7 +107,7 @@ public

    , E extends Event, S extends ScenarioFSMSta return createScenarioFSMStateAdapter(); } @Override - public

    , S extends ScenarioFSMState> Adapter caseScenarioFSMTransition(ScenarioFSMTransition object) { + public

    > Adapter caseScenarioFSMTransition(ScenarioFSMTransition object) { return createScenarioFSMTransitionAdapter(); } @Override diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java index 25bc4c313..a44b0867e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario.util; +import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.scenario.*; @@ -222,7 +223,7 @@ public > T1 caseElementQuery(ElementQuery ob * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public , P extends StateProperty> T1 caseEventOccurrence(EventOccurrence object) { + public , P extends Property> T1 caseEventOccurrence(EventOccurrence object) { return null; } @@ -237,7 +238,7 @@ public , P extends StateProperty> T1 caseEventOccurrence(E * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public

    > T1 caseScenarioElement(ScenarioElement

    object) { + public

    T1 caseScenarioElement(ScenarioElement

    object) { return null; } @@ -252,7 +253,7 @@ public

    > T1 caseScenarioElement(ScenarioElement

    ob * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public

    , E extends Event, S extends ScenarioFSMState, T extends ScenarioFSMTransition> T1 caseScenarioFSM(ScenarioFSM object) { + public

    , S extends ScenarioFSMState, T extends ScenarioFSMTransition> T1 caseScenarioFSM(ScenarioFSM object) { return null; } @@ -282,7 +283,7 @@ public

    , E extends Event, S extends ScenarioFSMSta * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public

    , S extends ScenarioFSMState> T1 caseScenarioFSMTransition(ScenarioFSMTransition object) { + public

    > T1 caseScenarioFSMTransition(ScenarioFSMTransition object) { return null; } diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java index 93ab8e7db..28472def4 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java @@ -166,6 +166,13 @@ public URI getScenarioURI() { return _scenarioURI; } + private URI _arbiterURI; + + @Override + public URI getArbiterURI() { + return _arbiterURI; + } + private boolean _breakStart; @Override diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java index 4c3c435ab..480781cf2 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java @@ -86,6 +86,10 @@ public final void performInitialize(IExecutionContext executionContext) { if (scenarioURI != null) { eventManagerAddon.loadScenario(scenarioURI, executionContext.getResourceModel().getResourceSet()); } + URI arbiterURI = executionContext.getRunConfiguration().getScenarioURI(); + if (arbiterURI != null) { + eventManagerAddon.loadArbiter(arbiterURI, executionContext.getResourceModel().getResourceSet()); + } } prepareEntryPoint(executionContext); prepareInitializeModel(executionContext); diff --git a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IRunConfiguration.java b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IRunConfiguration.java index 3a03a481c..9915ed991 100644 --- a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IRunConfiguration.java +++ b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IRunConfiguration.java @@ -27,6 +27,7 @@ public interface IRunConfiguration { public static final String LAUNCH_INITIALIZATION_METHOD = "GEMOC_LAUNCH_INITIALIZATION_METHOD"; public static final String LAUNCH_INITIALIZATION_ARGUMENTS = "GEMOC_LAUNCH_INITIALIZATION_ARGUMENTS"; public static final String LAUNCH_SCENARIO_URI = "GEMOC_LAUNCH_SCENARIO_URI"; + public static final String LAUNCH_ARBITER_URI = "GEMOC_LAUNCH_ARBITER_URI"; public static final String LAUNCH_BREAK_START = "GEMOC_LAUNCH_BREAK_START"; public static final String DEBUG_MODEL_ID = "GEMOC_DEBUG_MODEL_ID"; @@ -59,6 +60,8 @@ public interface IRunConfiguration { URI getScenarioURI(); + URI getArbiterURI(); + String getDebugModelID(); boolean getBreakStart(); diff --git a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java index f91e4df6f..ec7cc4c22 100644 --- a/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java +++ b/java_execution/java_engine/plugins/org.gemoc.execution.sequential.javaengine.ui/src/org/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java @@ -74,6 +74,7 @@ public class LaunchConfigurationMainTab extends LaunchConfigurationTab { protected Text _modelInitializationMethodText; protected Text _modelInitializationArgumentsText; protected Text _scenarioLocationText; + protected Text _arbiterLocationText; protected Text _siriusRepresentationLocationText; protected Button _animateButton; protected Text _delayText; @@ -160,6 +161,9 @@ public void initializeFrom(ILaunchConfiguration configuration) { URI scenarioURI = runConfiguration.getScenarioURI(); _scenarioLocationText.setText(scenarioURI == null ? "" : URIHelper.removePlatformScheme(scenarioURI)); + URI arbiterURI = runConfiguration.getArbiterURI(); + _arbiterLocationText.setText(arbiterURI == null ? "" : + URIHelper.removePlatformScheme(arbiterURI)); _entryPointModelElementLabel.setText(""); updateMainElementName(); @@ -192,6 +196,8 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) { _modelInitializationArgumentsText.getText()); configuration.setAttribute(RunConfiguration.LAUNCH_SCENARIO_URI, _scenarioLocationText.getText()); + configuration.setAttribute(RunConfiguration.LAUNCH_ARBITER_URI, + _arbiterLocationText.getText()); try { configuration.setAttribute("Property Monitor", !configuration.getAttribute(RunConfiguration.LAUNCH_SCENARIO_URI, "").equals("")); @@ -296,6 +302,25 @@ public void widgetSelected(SelectionEvent evt) { } }); + // Arbiter location text + createTextLabelLayout(parent, "Arbiter"); + _arbiterLocationText = new Text(parent, SWT.SINGLE | SWT.BORDER); + _arbiterLocationText.setLayoutData(createStandardLayout()); + _arbiterLocationText.setFont(font); + _arbiterLocationText.addModifyListener(fBasicModifyListener); + Button arbiterLocationButton = createPushButton(parent, "Browse", null); + arbiterLocationButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent evt) { + SelectAnyIFileDialog dialog = new SelectAnyIFileDialog(); + if (dialog.open() == Dialog.OK) { + String arbiterPath = ((IResource) dialog.getResult()[0]) + .getFullPath().toPortableString(); + _arbiterLocationText.setText(arbiterPath); + updateLaunchConfigurationDialog(); + } + } + }); + return parent; } From 34c446332b5275edef19d9482e352006fe09840f Mon Sep 17 00:00:00 2001 From: d-leroy Date: Thu, 1 Jun 2017 14:42:28 +0200 Subject: [PATCH 06/31] [Property Language] working implementation of Arbiter --- .../event/AbstractEventManager.java | 2 +- .../interpreter/property/PropertyMonitor.java | 28 +- .../interpreter/scenario/ArbiterManager.java | 15 +- .../META-INF/MANIFEST.MF | 4 +- ...iterTransition_guard_CompositeProperty.gif | Bin 0 -> 223 bytes ...ition_guard_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...iterTransition_guard_EventPrecondition.gif | Bin 0 -> 223 bytes ...ion_guard_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...ion_guard_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...tion_guard_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...iterTransition_guard_PropertyReference.gif | Bin 0 -> 223 bytes .../CreateArbiter_states_ArbiterState.gif | Bin 0 -> 223 bytes ...eArbiter_transitions_ArbiterTransition.gif | Bin 0 -> 223 bytes .../CreateReport_events_EventReport.gif | Bin 0 -> 223 bytes .../obj16/{Arbiter.gif => ArbiterState.gif} | Bin 129 -> 129 bytes .../{State.gif => ArbiterTransition.gif} | Bin 129 -> 129 bytes .../obj16/{Transition.gif => EventReport.gif} | Bin 129 -> 129 bytes .../icons/full/obj16/Report.gif | Bin 0 -> 129 bytes .../plugin.properties | 32 +- .../plugin.xml | 6 +- .../provider/StepPropertyItemProvider.java | 36 +- .../provider/EventReportItemProvider.java} | 85 +- .../provider/ReportEditPlugin.java} | 10 +- .../provider/ReportItemProvider.java} | 58 +- .../ReportItemProviderAdapterFactory.java} | 56 +- .../provider/ArbiterItemProvider.java | 241 +++ .../provider/ArbiterStateItemProvider.java} | 91 +- .../ArbiterTransitionItemProvider.java | 276 +++ .../ScenarioItemProviderAdapterFactory.java | 48 + .../META-INF/MANIFEST.MF | 4 +- .../icons/full/obj16/ReportModelFile.gif | Bin 0 -> 346 bytes .../icons/full/obj16/ScenarioModelFile.gif | Bin 0 -> 346 bytes .../icons/full/wizban/NewReport.gif | Bin 0 -> 2462 bytes .../icons/full/wizban/NewScenario.gif | Bin 0 -> 2462 bytes .../plugin.properties | 12 +- .../plugin.xml | 54 + .../presentation/PropertyModelWizard.java | 3 +- .../ReportActionBarContributor.java | 423 ++++ .../report/presentation/ReportEditor.java | 1828 +++++++++++++++++ .../presentation/ReportEditorPlugin.java} | 10 +- .../presentation/ReportModelWizard.java | 628 ++++++ .../ScenarioActionBarContributor.java | 423 ++++ .../scenario/presentation/ScenarioEditor.java | 1825 ++++++++++++++++ .../presentation/ScenarioModelWizard.java | 627 ++++++ .../META-INF/MANIFEST.MF | 5 +- .../model/property.ecore | 148 +- .../model/scenario.ecore | 232 ++- .../event/commons/model/arbiter/Arbiter.java | 85 - .../commons/model/arbiter/ArbiterFactory.java | 33 - .../commons/model/arbiter/ArbiterPackage.java | 512 ----- .../event/commons/model/arbiter/State.java | 92 - .../commons/model/arbiter/Transition.java | 109 - .../arbiter/impl/ArbiterFactoryImpl.java | 134 -- .../arbiter/impl/ArbiterPackageImpl.java | 387 ---- .../arbiter/util/ArbiterAdapterFactory.java | 157 -- .../model/arbiter/util/ArbiterSwitch.java | 153 -- .../model/property/PropertyPackage.java | 30 +- .../commons/model/property/StepProperty.java | 30 +- .../property/impl/PropertyPackageImpl.java | 15 + .../model/property/impl/StepPropertyImpl.java | 84 +- .../property/util/PropertyAdapterFactory.java | 2 +- .../model/property/util/PropertySwitch.java | 4 +- .../event/commons/model/scenario/Arbiter.java | 129 ++ .../commons/model/scenario/ArbiterState.java | 120 ++ .../model/scenario/ArbiterTransition.java | 137 ++ .../model/scenario/ScenarioFactory.java | 19 + .../model/scenario/ScenarioPackage.java | 540 +++++ .../{arbiter => scenario}/TruthValue.java | 57 +- .../impl/ArbiterImpl.java | 163 +- .../impl/ArbiterStateImpl.java} | 178 +- .../impl/ArbiterTransitionImpl.java} | 228 +- .../scenario/impl/ScenarioFactoryImpl.java | 74 + .../scenario/impl/ScenarioPackageImpl.java | 279 +++ .../scenario/util/ScenarioAdapterFactory.java | 54 + .../model/scenario/util/ScenarioSwitch.java | 63 + .../engine/ui/commons/RunConfiguration.java | 2 + .../AbstractSequentialExecutionEngine.java | 2 +- 77 files changed, 8914 insertions(+), 2168 deletions(-) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_CompositeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_EventPrecondition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_PropertyReference.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiter_states_ArbiterState.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiter_transitions_ArbiterTransition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReport_events_EventReport.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{Arbiter.gif => ArbiterState.gif} (50%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{State.gif => ArbiterTransition.gif} (50%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{Transition.gif => EventReport.gif} (50%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Report.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{arbiter/provider/TransitionItemProvider.java => report/provider/EventReportItemProvider.java} (61%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{arbiter/provider/ArbiterEditPlugin.java => report/provider/ReportEditPlugin.java} (86%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{arbiter/provider/ArbiterItemProvider.java => report/provider/ReportItemProvider.java} (72%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{arbiter/provider/ArbiterItemProviderAdapterFactory.java => report/provider/ReportItemProviderAdapterFactory.java} (73%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterItemProvider.java rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{arbiter/provider/StateItemProvider.java => scenario/provider/ArbiterStateItemProvider.java} (68%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterTransitionItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ScenarioModelFile.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewScenario.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/{arbiter/presentation/ArbiterEditorPlugin.java => report/presentation/ReportEditorPlugin.java} (86%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioActionBarContributor.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioEditor.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioModelWizard.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Arbiter.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ArbiterState.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ArbiterTransition.java rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/{arbiter => scenario}/TruthValue.java (92%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/{arbiter => scenario}/impl/ArbiterImpl.java (50%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/{arbiter/impl/StateImpl.java => scenario/impl/ArbiterStateImpl.java} (60%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/{arbiter/impl/TransitionImpl.java => scenario/impl/ArbiterTransitionImpl.java} (56%) diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java index ace38e18e..6d8492cca 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java @@ -23,7 +23,7 @@ import fr.inria.diverse.event.commons.model.EventManagerRegistry; import fr.inria.diverse.event.commons.model.IEventManager; import fr.inria.diverse.event.commons.model.IEventManagerListener; -import fr.inria.diverse.event.commons.model.arbiter.Arbiter; +import fr.inria.diverse.event.commons.model.scenario.Arbiter; import fr.inria.diverse.event.commons.model.scenario.Scenario; import fr.inria.diverse.trace.commons.model.trace.Step; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java index a64524bd4..2296cd1fb 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.function.Predicate; import java.util.stream.Collectors; import org.eclipse.emf.ecore.EAttribute; @@ -34,6 +35,7 @@ import fr.inria.diverse.event.commons.model.scenario.ElementProvider; import fr.inria.diverse.event.commons.model.scenario.Event; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.trace.commons.model.trace.MSE; import fr.inria.diverse.trace.commons.model.trace.Step; public class PropertyMonitor implements IEngineAddon, IPropertyMonitor { @@ -44,11 +46,11 @@ public class PropertyMonitor implements IEngineAddon, IPropertyMonitor { private final Map> propertyListeners = new HashMap<>(); - private final Set ongoingSteps = new HashSet<>(); + private final Set ongoingSteps = new HashSet<>(); - private final Set endedSteps = new HashSet<>(); + private final Set endedSteps = new HashSet<>(); - private final Set endingSteps = new HashSet<>(); + private final Set endingSteps = new HashSet<>(); private IEventManager eventManager; @@ -65,8 +67,8 @@ private boolean monitor(Property property) { private boolean evaluateProperty(Property property) { boolean result = false; - if (property instanceof StepProperty) { - result = evaluateStepProperty((StepProperty) property); + if (property instanceof StepProperty) { + result = evaluateStepProperty((StepProperty) property); } else if (property instanceof StateProperty) { result = evaluateStateProperty((StateProperty) property); } else if (property instanceof CompositeProperty) { @@ -91,8 +93,7 @@ private void updateProperties() { @Override public void aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute) { - final EOperation operation = stepToExecute.getMseoccurrence().getMse().getAction(); - ongoingSteps.add(operation); + ongoingSteps.add(stepToExecute.getMseoccurrence().getMse()); endedSteps.addAll(endingSteps); endingSteps.clear(); updateProperties(); @@ -100,10 +101,9 @@ public void aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute) { @Override public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { - final EOperation operation = stepExecuted.getMseoccurrence().getMse().getAction(); endedSteps.addAll(endingSteps); endingSteps.clear(); - endingSteps.add(operation); + endingSteps.add(stepExecuted.getMseoccurrence().getMse()); updateProperties(); } @@ -120,12 +120,14 @@ private boolean evaluateCompositeProperty(CompositeProperty property) { return list.stream().allMatch(b -> b); } - private boolean evaluateStepProperty(StepProperty property) { + private boolean evaluateStepProperty(StepProperty property) { final EOperation operation = property.getOperation(); + final EObject caller = ElementProviderAspect.resolve(property.getTargetProvider(), executedModel); final Stepping stepping = property.getStepping(); - return ongoingSteps.contains(operation) && stepping == Stepping.ONGOING - || endedSteps.contains(operation) && stepping == Stepping.ENDED - || endingSteps.contains(operation) && stepping == Stepping.ENDING; + final Predicate predicate = mse -> mse.getAction() == operation && mse.getCaller() == caller; + return stepping == Stepping.ONGOING && ongoingSteps.stream().anyMatch(predicate) + || stepping == Stepping.ENDED && endedSteps.stream().anyMatch(predicate) + || stepping == Stepping.ENDING && endingSteps.stream().anyMatch(predicate); } private boolean evaluateStateProperty(StateProperty property) { diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java index b2fbb54cf..c5bbfcc06 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java @@ -6,14 +6,14 @@ import fr.inria.diverse.event.commons.interpreter.property.IPropertyListener; import fr.inria.diverse.event.commons.interpreter.property.IPropertyMonitor; -import fr.inria.diverse.event.commons.model.arbiter.Arbiter; -import fr.inria.diverse.event.commons.model.arbiter.State; -import fr.inria.diverse.event.commons.model.arbiter.TruthValue; +import fr.inria.diverse.event.commons.model.scenario.Arbiter; +import fr.inria.diverse.event.commons.model.scenario.ArbiterState; +import fr.inria.diverse.event.commons.model.scenario.TruthValue; import fr.inria.diverse.event.commons.model.property.Property; public class ArbiterManager { - private State currentState; + private ArbiterState currentState; private final IPropertyMonitor propertyMonitor; public ArbiterManager(IPropertyMonitor propertyMonitor) { @@ -24,7 +24,7 @@ public TruthValue getTruthValue() { return currentState.getTruthValue(); } - private void setupArbiterStatePropertyListeners(Arbiter arbiter, State state) { + private void setupArbiterStatePropertyListeners(Arbiter arbiter, ArbiterState state) { final Map guards = new HashMap<>(); state.getOutgoingTransitions().forEach(t -> { final Property property = t.getGuard(); @@ -41,16 +41,17 @@ private void setupArbiterStatePropertyListeners(Arbiter arbiter, State< public void loadArbiter(Arbiter arbiter) { currentState = arbiter.getInitialState(); + setupArbiterStatePropertyListeners(arbiter, currentState); } private class ArbiterTransitionGuardListener implements IPropertyListener { private final Arbiter arbiter; - private final State state; + private final ArbiterState state; private final Property property; private Map guards = new HashMap<>(); - public ArbiterTransitionGuardListener(Arbiter arbiter, State state, Property property, Map guards) { + public ArbiterTransitionGuardListener(Arbiter arbiter, ArbiterState state, Property property, Map guards) { this.arbiter = arbiter; this.state = state; this.property = property; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF index c119eff3f..733ba4c42 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF @@ -4,13 +4,13 @@ Bundle-Name: %pluginName Bundle-SymbolicName: fr.inria.diverse.event.commons.model.edit;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: fr.inria.diverse.event.commons.model.arbiter.provider.ArbiterEditPlugin$Implementation +Bundle-Activator: fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: fr.inria.diverse.event.commons.model.property.provider, fr.inria.diverse.event.commons.model.scenario.provider, - fr.inria.diverse.event.commons.model.arbiter.provider + fr.inria.diverse.event.commons.model.report.provider Require-Bundle: org.eclipse.core.runtime, fr.inria.diverse.event.commons.model;visibility:=reexport, org.eclipse.emf.edit;visibility:=reexport, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_CompositeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_CompositeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..bee89db72929a724216c7c5ec5e7e1790e1bf04d GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b&YU@w%Pu)MIQ;(~KR@37|9$(0 zhK4m=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gij+{S literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..7ae2ea9921af2d9c71dd48ff0557219de92f1e1e GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ z-E-+h&!(GcGtW3Q9N0Bo4T!c*QeM|3zqCneUZvQ~65)S;-viO#&*y>Y&-2B!EQ}zQ4u}BR$-o+;pwO2RX{W|8^X%a%7q(97Z|<8^;%WTZq~}`pBuz2(eyQY4 z=Rl3w%TKV2^l8mGb<)j>K}YSrw~K{9P{ZsO2_F`nY-d`S;3j{grRH|7*6Ek&`3yNV NO{tAd*{X^R)&TzGVlw~$ literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_EventPrecondition.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_EventPrecondition.gif new file mode 100644 index 0000000000000000000000000000000000000000..4a574b11303677905fae297560b6b40db7029416 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6yx4Q;X3wTGX)_NvH2nV`KR@37|9$(0 zhK4m=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gihlT^YrmF$b)=A3iy5yHONzJPin^_|K@9%pc`uq7j5dC?+`1jpr zplJ}G_>+YZ#L@u~AUhdYV-ytnQX=it7-pV5JmtdHN&U@zlS({|Kb!Pi%buhurrs}= zoar2>F?;z5c9A}8}5D03R{UYJRqLb}R3lrSrZ?x3h&eb~oGCiLm Pr=}^ju_;?sk--`OI-_IW literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_ManyIntegerAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..b03123db0899b822f062b227c023c8480d11ef7b GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6eEt3P=$oVS@6WHiRQdmZ{QP+P|M%@1 z8XERodeO7#X4=d%4h;u(O;-b=t&^13b;&PnlA2d3HnT+d-{1E@^!M|5Ao}xs@$b9M zK+_;V@h1x-h@}G}Kz1^)#waNCr9|4PG0Z%Bc*=#Xllq(cCY5*^e>Um4mOV*ROub(! zIny~%WA^eB>>_3tK1kH}_2{@ihKy(sM0)lBSq?zf^Lj zbD+lTg4sA2Ytgb#~OwlghEaFf5$Qgb_3>-5X?e1@Ew Nrqsr!Y*j@DYXG+9VblNs literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_PropertyReference.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiterTransition_guard_PropertyReference.gif new file mode 100644 index 0000000000000000000000000000000000000000..09741e808c9c16faf187577d743db5e4fb4144da GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?78%!XVcBJnP(gt4*dTgKR@37|9$(0 zh6ZHuUDMToXzL{9bzSmHo22Gdip?w${`dDi5dHmp9*F)tU;O)SGte{$Q2fcl2x94g z2#}o&tT74-eJPQ4Y78^a9-eYx>!kkXzDXsX#-B}ku4PZs6jSe)O3ri+)R?{e1iMI| z)|^u(-K-dN)b4w`SO^3)%zlyZVbRHUriBS^@;6#)Zs%&9ewm)nkWs>oms E0JjTcE&u=k literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiter_states_ArbiterState.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiter_states_ArbiterState.gif new file mode 100644 index 0000000000000000000000000000000000000000..83994f32f6cf3d9740499d2851fa712bf7f1c827 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ zz1DQ?Sn#nmmTTH{+ICG>1EQ^yl-G61FKv>VS1C5LMEKv|_dxXb^LZfp^L+8|yUjq; zAVBda3nPf710q0nGO)%dDDA99YNmER{Un)7% zIZ$Kv@)PVLeOhx)opiHe&{4bZ?P4Ji)G+%+!iPmC+nE+7xXIsWskxo2b^2v`K0{7T NQ)**VwyGk7H2_w1VKD#z literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiter_transitions_ArbiterTransition.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateArbiter_transitions_ArbiterTransition.gif new file mode 100644 index 0000000000000000000000000000000000000000..633561b32bb9d1295e086cdec92e61be35090aa7 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?78%!XVcBJnP(gt4*dTgKR@37|9$(0 zhK6fR*Nz1rTVuJVO{Z1sf9kF>bpZftvkAHY diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/State.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ArbiterTransition.gif similarity index 50% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/State.gif rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ArbiterTransition.gif index cb1755a712505aeaaa447d9b1cc5940e602f87b6..98b351f1c441775dfbe390577f2e534a4dcf07f9 100644 GIT binary patch delta 22 ecmZojD672?`wm diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Transition.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventReport.gif similarity index 50% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Transition.gif rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/EventReport.gif index 7bac4fd3808df6247660dfb8d76e15609f279841..d3dc5a9ad8159548d5ada4a1cd545ec1d4de029c 100644 GIT binary patch delta 22 ecmZo@ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Report.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Report.gif new file mode 100644 index 0000000000000000000000000000000000000000..33854e98c25a13543eb9477dc67b0baf87fc81aa GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgt|Nnblyy&@kGwsY7 zhXV%`f3h$#FmN*HfOLY)U|`WRIO(~1uf^*x-&FV?7P@XXWxbV>;I&}kR~x;L)6}k- WmG`XF - + * * @generated */ -public class TransitionItemProvider +public class EventReportItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, @@ -42,7 +45,7 @@ public class TransitionItemProvider * * @generated */ - public TransitionItemProvider(AdapterFactory adapterFactory) { + public EventReportItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -57,27 +60,28 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - addSourcePropertyDescriptor(object); + addEventPropertyDescriptor(object); + addMatchesPropertyDescriptor(object); addTargetPropertyDescriptor(object); - addGuardPropertyDescriptor(object); + addTimePropertyDescriptor(object); } return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Source feature. + * This adds a property descriptor for the Event feature. * * * @generated */ - protected void addSourcePropertyDescriptor(Object object) { + protected void addEventPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_Transition_source_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Transition_source_feature", "_UI_Transition_type"), - ArbiterPackage.Literals.TRANSITION__SOURCE, + getString("_UI_EventReport_event_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventReport_event_feature", "_UI_EventReport_type"), + ReportPackage.Literals.EVENT_REPORT__EVENT, true, false, true, @@ -87,19 +91,19 @@ protected void addSourcePropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Target feature. + * This adds a property descriptor for the Matches feature. * * * @generated */ - protected void addTargetPropertyDescriptor(Object object) { + protected void addMatchesPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_Transition_target_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Transition_target_feature", "_UI_Transition_type"), - ArbiterPackage.Literals.TRANSITION__TARGET, + getString("_UI_EventReport_matches_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventReport_matches_feature", "_UI_EventReport_type"), + ReportPackage.Literals.EVENT_REPORT__MATCHES, true, false, true, @@ -109,19 +113,19 @@ protected void addTargetPropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Guard feature. + * This adds a property descriptor for the Target feature. * * * @generated */ - protected void addGuardPropertyDescriptor(Object object) { + protected void addTargetPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_Transition_guard_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Transition_guard_feature", "_UI_Transition_type"), - ArbiterPackage.Literals.TRANSITION__GUARD, + getString("_UI_EventReport_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventReport_target_feature", "_UI_EventReport_type"), + ReportPackage.Literals.EVENT_REPORT__TARGET, true, false, true, @@ -131,14 +135,36 @@ protected void addGuardPropertyDescriptor(Object object) { } /** - * This returns Transition.gif. + * This adds a property descriptor for the Time feature. + * + * + * @generated + */ + protected void addTimePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_EventReport_time_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EventReport_time_feature", "_UI_EventReport_type"), + ReportPackage.Literals.EVENT_REPORT__TIME, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns EventReport.gif. * * * @generated */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Transition")); + return overlayImage(object, getResourceLocator().getImage("full/obj16/EventReport")); } /** @@ -149,7 +175,8 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - return getString("_UI_Transition_type"); + EventReport eventReport = (EventReport)object; + return getString("_UI_EventReport_type") + " " + eventReport.getTime(); } @@ -163,6 +190,12 @@ public String getText(Object object) { @Override public void notifyChanged(Notification notification) { updateChildren(notification); + + switch (notification.getFeatureID(EventReport.class)) { + case ReportPackage.EVENT_REPORT__TIME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } super.notifyChanged(notification); } @@ -186,7 +219,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors */ @Override public ResourceLocator getResourceLocator() { - return ArbiterEditPlugin.INSTANCE; + return ReportEditPlugin.INSTANCE; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterEditPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportEditPlugin.java similarity index 86% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterEditPlugin.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportEditPlugin.java index f30d904d8..4e1f70ebe 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterEditPlugin.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportEditPlugin.java @@ -1,6 +1,6 @@ /** */ -package fr.inria.diverse.event.commons.model.arbiter.provider; +package fr.inria.diverse.event.commons.model.report.provider; import fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin; @@ -13,19 +13,19 @@ import org.eclipse.emf.ecore.provider.EcoreEditPlugin; /** - * This is the central singleton for the Arbiter edit plugin. + * This is the central singleton for the Report edit plugin. * * * @generated */ -public final class ArbiterEditPlugin extends EMFPlugin { +public final class ReportEditPlugin extends EMFPlugin { /** * Keep track of the singleton. * * * @generated */ - public static final ArbiterEditPlugin INSTANCE = new ArbiterEditPlugin(); + public static final ReportEditPlugin INSTANCE = new ReportEditPlugin(); /** * Keep track of the singleton. @@ -41,7 +41,7 @@ public final class ArbiterEditPlugin extends EMFPlugin { * * @generated */ - public ArbiterEditPlugin() { + public ReportEditPlugin() { super (new ResourceLocator [] { EcoreEditPlugin.INSTANCE, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java similarity index 72% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java index c88baa941..873884bc5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProvider.java @@ -1,10 +1,11 @@ /** */ -package fr.inria.diverse.event.commons.model.arbiter.provider; +package fr.inria.diverse.event.commons.model.report.provider; -import fr.inria.diverse.event.commons.model.arbiter.Arbiter; -import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.report.Report; +import fr.inria.diverse.event.commons.model.report.ReportFactory; +import fr.inria.diverse.event.commons.model.report.ReportPackage; import java.util.Collection; import java.util.List; @@ -16,7 +17,6 @@ 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; @@ -27,12 +27,12 @@ import org.eclipse.emf.edit.provider.ViewerNotification; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.Report} object. * * * @generated */ -public class ArbiterItemProvider +public class ReportItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, @@ -46,7 +46,7 @@ public class ArbiterItemProvider * * @generated */ - public ArbiterItemProvider(AdapterFactory adapterFactory) { + public ReportItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -61,33 +61,10 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - addInitialStatePropertyDescriptor(object); } return itemPropertyDescriptors; } - /** - * This adds a property descriptor for the Initial State feature. - * - * - * @generated - */ - protected void addInitialStatePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Arbiter_initialState_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Arbiter_initialState_feature", "_UI_Arbiter_type"), - ArbiterPackage.Literals.ARBITER__INITIAL_STATE, - true, - false, - true, - null, - 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 @@ -100,8 +77,7 @@ protected void addInitialStatePropertyDescriptor(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ArbiterPackage.Literals.ARBITER__STATES); - childrenFeatures.add(ArbiterPackage.Literals.ARBITER__TRANSITIONS); + childrenFeatures.add(ReportPackage.Literals.REPORT__EVENTS); } return childrenFeatures; } @@ -120,14 +96,14 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { } /** - * This returns Arbiter.gif. + * This returns Report.gif. * * * @generated */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Arbiter")); + return overlayImage(object, getResourceLocator().getImage("full/obj16/Report")); } /** @@ -138,7 +114,7 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - return getString("_UI_Arbiter_type"); + return getString("_UI_Report_type"); } @@ -153,9 +129,8 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(Arbiter.class)) { - case ArbiterPackage.ARBITER__STATES: - case ArbiterPackage.ARBITER__TRANSITIONS: + switch (notification.getFeatureID(Report.class)) { + case ReportPackage.REPORT__EVENTS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -172,6 +147,11 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (ReportPackage.Literals.REPORT__EVENTS, + ReportFactory.eINSTANCE.createEventReport())); } /** @@ -182,7 +162,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors */ @Override public ResourceLocator getResourceLocator() { - return ArbiterEditPlugin.INSTANCE; + return ReportEditPlugin.INSTANCE; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java similarity index 73% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProviderAdapterFactory.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java index b3270e17c..9e8b1855f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java @@ -1,8 +1,8 @@ /** */ -package fr.inria.diverse.event.commons.model.arbiter.provider; +package fr.inria.diverse.event.commons.model.report.provider; -import fr.inria.diverse.event.commons.model.arbiter.util.ArbiterAdapterFactory; +import fr.inria.diverse.event.commons.model.report.util.ReportAdapterFactory; import java.util.ArrayList; import java.util.Collection; @@ -32,7 +32,7 @@ * * @generated */ -public class ArbiterItemProviderAdapterFactory extends ArbiterAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { +public class ReportItemProviderAdapterFactory extends ReportAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { /** * This keeps track of the root adapter factory that delegates to this adapter factory. * @@ -63,7 +63,7 @@ public class ArbiterItemProviderAdapterFactory extends ArbiterAdapterFactory imp * * @generated */ - public ArbiterItemProviderAdapterFactory() { + public ReportItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); @@ -71,6 +71,52 @@ public ArbiterItemProviderAdapterFactory() { supportedTypes.add(IItemPropertySource.class); } + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.Report} instances. + * + * + * @generated + */ + protected ReportItemProvider reportItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.Report}. + * + * + * @generated + */ + @Override + public Adapter createReportAdapter() { + if (reportItemProvider == null) { + reportItemProvider = new ReportItemProvider(this); + } + + return reportItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.EventReport} instances. + * + * + * @generated + */ + protected EventReportItemProvider eventReportItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.EventReport}. + * + * + * @generated + */ + @Override + public Adapter createEventReportAdapter() { + if (eventReportItemProvider == null) { + eventReportItemProvider = new EventReportItemProvider(this); + } + + return eventReportItemProvider; + } + /** * This returns the root adapter factory that contains this factory. * @@ -170,6 +216,8 @@ public void fireNotifyChanged(Notification notification) { * @generated */ public void dispose() { + if (reportItemProvider != null) reportItemProvider.dispose(); + if (eventReportItemProvider != null) eventReportItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterItemProvider.java new file mode 100644 index 000000000..4dd918258 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterItemProvider.java @@ -0,0 +1,241 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.scenario.Arbiter; +import fr.inria.diverse.event.commons.model.scenario.ScenarioFactory; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.Arbiter} object. + * + * + * @generated + */ +public class ArbiterItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ArbiterItemProvider(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); + + addInitialStatePropertyDescriptor(object); + addAcceptingStatesPropertyDescriptor(object); + addNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Initial State feature. + * + * + * @generated + */ + protected void addInitialStatePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arbiter_initialState_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arbiter_initialState_feature", "_UI_Arbiter_type"), + ScenarioPackage.Literals.ARBITER__INITIAL_STATE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Accepting States feature. + * + * + * @generated + */ + protected void addAcceptingStatesPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arbiter_acceptingStates_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arbiter_acceptingStates_feature", "_UI_Arbiter_type"), + ScenarioPackage.Literals.ARBITER__ACCEPTING_STATES, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arbiter_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arbiter_name_feature", "_UI_Arbiter_type"), + ScenarioPackage.Literals.ARBITER__NAME, + 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(ScenarioPackage.Literals.ARBITER__STATES); + childrenFeatures.add(ScenarioPackage.Literals.ARBITER__TRANSITIONS); + } + 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 = ((Arbiter)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_Arbiter_type") : + getString("_UI_Arbiter_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(Arbiter.class)) { + case ScenarioPackage.ARBITER__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case ScenarioPackage.ARBITER__STATES: + case ScenarioPackage.ARBITER__TRANSITIONS: + 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 + (ScenarioPackage.Literals.ARBITER__STATES, + ScenarioFactory.eINSTANCE.createArbiterState())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ARBITER__TRANSITIONS, + ScenarioFactory.eINSTANCE.createArbiterTransition())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ScenarioEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/StateItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterStateItemProvider.java similarity index 68% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/StateItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterStateItemProvider.java index 9689a5101..9336c5ca2 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/StateItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterStateItemProvider.java @@ -1,12 +1,10 @@ /** */ -package fr.inria.diverse.event.commons.model.arbiter.provider; +package fr.inria.diverse.event.commons.model.scenario.provider; -import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; -import fr.inria.diverse.event.commons.model.arbiter.State; -import fr.inria.diverse.event.commons.model.arbiter.TruthValue; - +import fr.inria.diverse.event.commons.model.scenario.ArbiterState; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import java.util.Collection; import java.util.List; @@ -27,12 +25,12 @@ import org.eclipse.emf.edit.provider.ViewerNotification; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.arbiter.State} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ArbiterState} object. * * * @generated */ -public class StateItemProvider +public class ArbiterStateItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, @@ -46,7 +44,7 @@ public class StateItemProvider * * @generated */ - public StateItemProvider(AdapterFactory adapterFactory) { + public ArbiterStateItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -61,31 +59,32 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - addTruthValuePropertyDescriptor(object); - addOutgoingTransitionsPropertyDescriptor(object); addIncomingTransitionsPropertyDescriptor(object); + addOutgoingTransitionsPropertyDescriptor(object); + addTruthValuePropertyDescriptor(object); + addNamePropertyDescriptor(object); } return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Truth Value feature. + * This adds a property descriptor for the Incoming Transitions feature. * * * @generated */ - protected void addTruthValuePropertyDescriptor(Object object) { + protected void addIncomingTransitionsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_State_truthValue_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_State_truthValue_feature", "_UI_State_type"), - ArbiterPackage.Literals.STATE__TRUTH_VALUE, + getString("_UI_ArbiterState_incomingTransitions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ArbiterState_incomingTransitions_feature", "_UI_ArbiterState_type"), + ScenarioPackage.Literals.ARBITER_STATE__INCOMING_TRANSITIONS, true, false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + true, + null, null, null)); } @@ -101,9 +100,9 @@ protected void addOutgoingTransitionsPropertyDescriptor(Object object) { (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_State_outgoingTransitions_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_State_outgoingTransitions_feature", "_UI_State_type"), - ArbiterPackage.Literals.STATE__OUTGOING_TRANSITIONS, + getString("_UI_ArbiterState_outgoingTransitions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ArbiterState_outgoingTransitions_feature", "_UI_ArbiterState_type"), + ScenarioPackage.Literals.ARBITER_STATE__OUTGOING_TRANSITIONS, true, false, true, @@ -113,36 +112,58 @@ protected void addOutgoingTransitionsPropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Incoming Transitions feature. + * This adds a property descriptor for the Truth Value feature. * * * @generated */ - protected void addIncomingTransitionsPropertyDescriptor(Object object) { + protected void addTruthValuePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_State_incomingTransitions_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_State_incomingTransitions_feature", "_UI_State_type"), - ArbiterPackage.Literals.STATE__INCOMING_TRANSITIONS, + getString("_UI_ArbiterState_truthValue_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ArbiterState_truthValue_feature", "_UI_ArbiterState_type"), + ScenarioPackage.Literals.ARBITER_STATE__TRUTH_VALUE, true, false, - true, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, + null)); + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ArbiterState_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ArbiterState_name_feature", "_UI_ArbiterState_type"), + ScenarioPackage.Literals.ARBITER_STATE__NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This returns State.gif. + * This returns ArbiterState.gif. * * * @generated */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/State")); + return overlayImage(object, getResourceLocator().getImage("full/obj16/ArbiterState")); } /** @@ -153,11 +174,10 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - TruthValue labelValue = ((State)object).getTruthValue(); - String label = labelValue == null ? null : labelValue.toString(); + String label = ((ArbiterState)object).getName(); return label == null || label.length() == 0 ? - getString("_UI_State_type") : - getString("_UI_State_type") + " " + label; + getString("_UI_ArbiterState_type") : + getString("_UI_ArbiterState_type") + " " + label; } @@ -172,8 +192,9 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(State.class)) { - case ArbiterPackage.STATE__TRUTH_VALUE: + switch (notification.getFeatureID(ArbiterState.class)) { + case ScenarioPackage.ARBITER_STATE__TRUTH_VALUE: + case ScenarioPackage.ARBITER_STATE__NAME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } @@ -200,7 +221,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors */ @Override public ResourceLocator getResourceLocator() { - return ArbiterEditPlugin.INSTANCE; + return ScenarioEditPlugin.INSTANCE; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterTransitionItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterTransitionItemProvider.java new file mode 100644 index 000000000..bd177cd6f --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterTransitionItemProvider.java @@ -0,0 +1,276 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyFactory; + +import fr.inria.diverse.event.commons.model.scenario.ArbiterTransition; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + +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.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.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition} object. + * + * + * @generated + */ +public class ArbiterTransitionItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ArbiterTransitionItemProvider(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); + + addSourcePropertyDescriptor(object); + addTargetPropertyDescriptor(object); + addNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Source feature. + * + * + * @generated + */ + protected void addSourcePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ArbiterTransition_source_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ArbiterTransition_source_feature", "_UI_ArbiterTransition_type"), + ScenarioPackage.Literals.ARBITER_TRANSITION__SOURCE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ArbiterTransition_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ArbiterTransition_target_feature", "_UI_ArbiterTransition_type"), + ScenarioPackage.Literals.ARBITER_TRANSITION__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ArbiterTransition_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ArbiterTransition_name_feature", "_UI_ArbiterTransition_type"), + ScenarioPackage.Literals.ARBITER_TRANSITION__NAME, + 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(ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD); + } + 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 ArbiterTransition.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ArbiterTransition")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((ArbiterTransition)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_ArbiterTransition_type") : + getString("_UI_ArbiterTransition_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(ArbiterTransition.class)) { + case ScenarioPackage.ARBITER_TRANSITION__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case ScenarioPackage.ARBITER_TRANSITION__GUARD: + 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 + (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createCompositeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createEventPrecondition())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createPropertyReference())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ScenarioEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProviderAdapterFactory.java index f259d88cc..5c6087252 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioItemProviderAdapterFactory.java @@ -71,6 +71,52 @@ public ScenarioItemProviderAdapterFactory() { supportedTypes.add(IItemPropertySource.class); } + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.scenario.ArbiterState} instances. + * + * + * @generated + */ + protected ArbiterStateItemProvider arbiterStateItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ArbiterState}. + * + * + * @generated + */ + @Override + public Adapter createArbiterStateAdapter() { + if (arbiterStateItemProvider == null) { + arbiterStateItemProvider = new ArbiterStateItemProvider(this); + } + + return arbiterStateItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition} instances. + * + * + * @generated + */ + protected ArbiterTransitionItemProvider arbiterTransitionItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition}. + * + * + * @generated + */ + @Override + public Adapter createArbiterTransitionAdapter() { + if (arbiterTransitionItemProvider == null) { + arbiterTransitionItemProvider = new ArbiterTransitionItemProvider(this); + } + + return arbiterTransitionItemProvider; + } + /** * This returns the root adapter factory that contains this factory. * @@ -170,6 +216,8 @@ public void fireNotifyChanged(Notification notification) { * @generated */ public void dispose() { + if (arbiterStateItemProvider != null) arbiterStateItemProvider.dispose(); + if (arbiterTransitionItemProvider != null) arbiterTransitionItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF index dd211a551..3c89248c9 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF @@ -4,13 +4,13 @@ Bundle-Name: %pluginName Bundle-SymbolicName: fr.inria.diverse.event.commons.model.editor;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: fr.inria.diverse.event.commons.model.arbiter.presentation.ArbiterEditorPlugin$Implementation +Bundle-Activator: fr.inria.diverse.event.commons.model.property.presentation.PropertyEditorPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: fr.inria.diverse.event.commons.model.property.presentation, fr.inria.diverse.event.commons.model.scenario.presentation, - fr.inria.diverse.event.commons.model.arbiter.presentation + fr.inria.diverse.event.commons.model.report.presentation Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources;visibility:=reexport, fr.inria.diverse.event.commons.model.edit;visibility:=reexport, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif new file mode 100644 index 0000000000000000000000000000000000000000..26ea9421d720270f52a6dc2d5b8a0726aa2351de GIT binary patch literal 346 zcmZ?wbhEHb6krfwxXQrL(9jScAHRS9{{Q#qA2@IT$YuD?z`*by$o~Hy%=-U-&x;p5 zH*cn$Ipc8Pz?KQNK(wLXZcUHF@@}U^9nN!GU8gs>HJAI=mHJf|2VB{dd24UYgA@Hf zfBpIX^Y_;uzdwEb{o(8Hx1WB!`tbAq%O7{1e+ODXEui?5g^_`QjX?)wAjnS)Y~>Ek z1s*y=iYHVqX|z<#yTIF``7>g@%*sNhS5?+GJtqojwaYydSQ;U?las$GIz%(d?T7or zM)}AtaTOI_))w9-aaX2-R+g4RCRhF{UY2S7{9Qd$`&lNsNT{l|wJwryl~h|*#lK2T W(p74cQ~}FoDIX^${`oGB4AuZ%t9q0G literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ScenarioModelFile.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ScenarioModelFile.gif new file mode 100644 index 0000000000000000000000000000000000000000..366f9ff33929abad861653d50512f3d93bac89ca GIT binary patch literal 346 zcmZ?wbhEHb6krfwxXQrL(9jScAHRS9{{Q#qA2@IT$YuD?z`*by$o~Hy%=-U-&z=`O zJvY+~kK=5pV??4Nv1r&d>FfuT(G3bB{1o?@9t=yrx zz(Yq!@r24Hjh2de7kFDVe@3jASy{;Rs>=GN=R_f`cDZK)OCtn#a`HDthiFE*{cwNS zC?DA+uA;)r+QQo;?#fiq%FzpH0zKg&cH302j$)SP}Ki|cX!5RS2fO$0l literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif new file mode 100644 index 0000000000000000000000000000000000000000..023a6d4bd7b72c780d173567f7e3ce552951c45c GIT binary patch literal 2462 zcmd6m`8OMg8ivzyXM`x-QPZJfTAHHK&QR5AsWql$w2Ic!kg?USY8f{w=)@9er5!BYj=!_Znuek4d&imtcp6{IRvvaUDGxu`>TnBsx>}7X% zcXj>C>iTB}dwftJ85GP)Wg9E&Uo1Q`ExocVy)wHN7qccO5q!QCi)HPXdjpQM@yoS^ z<80wr`+z*>pu(FW#WzEWTpr?GAL8A@pSed8-6IK}F(l8JlKXLGKJgX4dz8Zy$%y32 zpp@#+)Y|a$=Mm|3(Z5q4Wi=#VntsEz{Dy5#Euy1}=;)Hp%#toFnT6ZqML|_BzP1lv z%O=+Mmo{+9_86cv^XeGGw9XMadz{fX(aRTcMrQ<5i(^v@<6@cc-O{vlRU}!Smv2gC z>zD6kUAdoac`x&-cg|Js>}$Rln+N}Hfwc?Bv-QV1{+bU9DsTzIyN2Q2BA&TN5#6H* z9x)`3J^51KgbJVda^HkNIx;ywJRucKExZxS#M0F%$@0wnhiU1`^4h23 zIyRB|s`TH1jRRHfd}`MSy>GmS_qOkkY0m2z-q@@_v^X;Pet2STd|D=5+K?=+Eq(a3 zxUx0ydS+;1P9R!%Gc6O&EWMlmAeOF7N#ydiPfH&@F0O2T*!;4(@p*oEQ@XUixVp8n z@p+5pvo+PcIom(cSJ~E5QbaCFCln?X;9{}4@RT%CQ*#ZywX2u;FZ~1UUCjCl0v=M6=ct7?-u|{y8s0xZTrTum#IpJ4ete-9NX^-(sLx5 zjq28Bsv880&YUkqW@s2kX*=M2AsIT>2ne@%&LQ9Md^@pr%^!dMnebcY(T`kPn2*k^h*qzHBmNX&LLS^Yx*k$~C`&M|yaW#4P zwpXVVDo!~0aeg`$I7Ao2>zT*6$*orQgO3~er<8q*_aXAbjE_E^iH*^`P#OuoVn$FH za<NG<$-i0f=2;479^fm%nqlV1qOp|i=^OqhBUpxs zg$`Q3AFSd62x?y$72v16Pw++^pu;eQZtXl!iBGz%BPo$qA*%w?+OMJQDC82k>A4#(plak`tK^*UGs^qGYI5P28SQsv~s)?1no zM#zskgA6H8@;;YeFAwO1=Kvc>WNuuowDQCl6Y80CzCR?GANk8wF4U2u2Y1`3JYBuqNL4>Bh4vi%gU{k?s)%$m zaBE+uDk=O2&1W3T_>DXv&DFT)Po4;%;BP8!5XfbBV5T11_uAe7L%Kiml9GqWH4pNr z^vO`@?iwzksh%o;gr6n0by-jS8H-Wtt8bl76o?p@hX>t2roSBaZsuOon~oKKd#)S7 zkGDR+oFsekk?%tXY|KO+gF|aPh87qit0W{}TFSE+@i<@Bn!PaPKCl`uxuFJ5_`sA8 z@6eyCDSn+vi@WlZ7^rHkGMD31zw;XRS@ki1?Mup=Z#+>76_n?G2*(PIYR{+iT79EUXyWKy zU}JMbZB4UGxDHygIJ;ZAg9jvb#s-*}G*7aYrLfS(aU;J5rf-<(%Z1%py91Qn82I}b zz@>?segZ1J39IFKlW+wX5t;n}@5DOD3nyzU9ggDyd@2qd8A4Wpv)7cs_vCk0OrIJr zQck)Uw4~2vrkQB4vJfU@;sR{Jd?=m=+W;cb)|?+B%^eLd>SQ}ORy`lb@BSQJ(Lxl! zdM%i?t*FrGLLZsS76@Q-%o*L6-&&JJs{;24JrZ>4<6DNmE~ouBAt1;AQM zG1@gLit4S)d294DjR(=elXy-%fWJj7OFH z0D2-Mx@-JrKPcnJu^;ZJ8qPd9m_?yQ=j7VoCH)y^nQ#<*40reX?KG{|{^;i7{pNKJ z`gqiLuFmx;A$Q$&+;aC(E^2lI(tW>m6836+YD_=+jg>nYO2Lc=` z;10rd$VEf*`oIJ~7}SQK*kAl9zcL#|5*1#VY-+94HZU9(>ghS9rr7|Gr+l|-#OujH znik#PI8OmpeG2jF{C9Yc)q&DyA+ zqB-mOGUlUao^O;hE;99xBU87lLfH=0v&sP-RDF4fpRCY-X@j|3j{Q3(kb$ literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewScenario.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewScenario.gif new file mode 100644 index 0000000000000000000000000000000000000000..e85f1da21d92ca93e4dcf62ba760305d61d146a3 GIT binary patch literal 2462 zcmd6m`8OMg8ivzyXM`x-QPZJfTAHHK&QR5AsWql$w2Ic!kg?USY8f{w=-48$rioY* zYbAC`Y)wT;A`FcZl_-%Sg2vLt=!_Znuek4d&imtcp6{IRvvaUDGxu`>TnBsx>}7X% zcWwR4+WKcYYhs8m9^%hQq#LX2Uo1ScEWNTVy|TKym$I{`5D1=?71P=;?*<%eHxJTkWV~CzHrT62?ec~&9_o#p;k`T#N zK`Aw%sdeG$&m+?7qkpG7%5F?RH~)rh{SDKST1-O~(=toDvP!!#Bqnx`7lqY*xVnB^ z9gEN~P}ayU-(!&6!mX!|P`gHHtO3qT?nc+I+GHc-58HBTo9sYtRmEnb;j_%I_`U6Fq( zsb>)=ugd-%*fdz(!J~AK()uTQxo`Xbm|?%3<&Mwsg-fGT??)!*CuXFQvKP`XwxU{gYM!Bf(R%`LUGw(dU0zYGj^bTb+%@z@^L z;Jeuw-oPIt?6EQ4#FSwEf4BC3SCBoUyy~4II)1-K+HIQHLypuoY-ssK> z7A2^=LlK;fWzi5Voa)sXaV}{Gy2h%BJ}eHNphc4X(RTWzc12h4eHuV7DbW;(M5n8r zwykw44B}HPR-Wb zOF`{Ixj1uP)dL*kZNMR>_~}=n4t;A@NBYfzyTDX9^8i-`)(kU87LTWF&)o1o8NoD6 zEOOBL{a`f*fLHrUuLM8sdxA6S1RaJc^l0aUN`2C89f^t5N@+Ea+Myk)PBo~{d|Gq~ zV8no6cu-XNWH0ir?q)8e{=o@LXUcablt~sN)+=Jv@qeX_Wb@52|j$aGX(ef(}@DX%HQG zmGZ9jPv*uoN~=$d(V?D6=LbT9d6BT$ljEoX7seQ+&ad_xVK@PQ#4 z*`YmGQ~Wxc7I)<*5m41yWj@!ZVdpjWv+832%a@qH&~%~)3|3&x9#>dvS1S$(68Z)WRV zU}5q?ZB4UHI1XBKSi4)gLkGlm#s=t^G*6P2rJ%^haigFXrf-<#%YogI-vLT*4E}u# z;L^-VKLM58gw=7qiP%E4ki>d`b7CIkhLg0F4##l-K9z@#3?r+-IdUcNJ=vXA)2GHu zUI-A!~cAovd#rgojR<$e%e5m#|Ws1V9D%1m626(bZ^4v7-Z>Kv9#iL4p z06h^9+%^8QAC&Rq_z!nf4QHPm%qCN#bMx%)690^|OgIWYhP`|JcAC~}|IC(>{pR%! z`Z&~guFefAA$Q$&-17F3FKYGx(tW>m67*?(YDz!)jg>nISB0ItTu literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties index da329cd52..51b197608 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties @@ -57,9 +57,9 @@ _UI_ScenarioModelWizard_description = Create a new Scenario model _UI_ScenarioEditor_label = Scenario Model Editor _UI_ScenarioEditorFilenameDefaultBase = My _UI_ScenarioEditorFilenameExtensions = scenario -_UI_ArbiterEditor_menu = &Arbiter Editor -_UI_ArbiterModelWizard_label = Arbiter Model -_UI_ArbiterModelWizard_description = Create a new Arbiter model -_UI_ArbiterEditor_label = Arbiter Model Editor -_UI_ArbiterEditorFilenameDefaultBase = My -_UI_ArbiterEditorFilenameExtensions = arbiter +_UI_ReportEditor_menu = &Report Editor +_UI_ReportModelWizard_label = Report Model +_UI_ReportModelWizard_description = Create a new Report model +_UI_ReportEditor_label = Report Model Editor +_UI_ReportEditorFilenameDefaultBase = My +_UI_ReportEditorFilenameExtensions = report diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml index 9c1260a55..4f05a1b8b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml @@ -34,4 +34,58 @@ + + + + + %_UI_ScenarioModelWizard_description + + + + + + + + + + + + + + %_UI_ReportModelWizard_description + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java index 7f2012397..941bf3af3 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/property/presentation/PropertyModelWizard.java @@ -395,8 +395,7 @@ public PropertyModelWizardInitialObjectCreationPage(String pageId) { * @generated */ public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - { + Composite composite = new Composite(parent, SWT.NONE); { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java new file mode 100644 index 000000000..23179e8b8 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java @@ -0,0 +1,423 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.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 Report model editor. + * + * + * @generated + */ +public class ReportActionBarContributor + 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(ReportEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + ReportEditorPlugin.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(ReportEditorPlugin.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 ReportActionBarContributor() { + 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("report-settings")); + toolBarManager.add(new Separator("report-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(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditor_menu"), "fr.inria.diverse.event.commons.model.reportMenuID"); + 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(ReportEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(ReportEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + submenuManager.insertBefore("additions", createSiblingMenuManager); + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener + (new IMenuListener() { + 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 + */ + 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(ReportEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(ReportEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java new file mode 100644 index 000000000..0a1092f33 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java @@ -0,0 +1,1828 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.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.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.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.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.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 fr.inria.diverse.event.commons.model.report.provider.ReportItemProviderAdapterFactory; + +import fr.inria.diverse.event.commons.model.property.provider.PropertyItemProviderAdapterFactory; + +import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioItemProviderAdapterFactory; + +import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; + +import org.eclipse.ui.actions.WorkspaceModifyOperation; + + +/** + * This is an example of a Report model editor. + * + * + * @generated + */ +public class ReportEditor + 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() { + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(ReportEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(ReportEditor.this); + handleActivate(); + } + } + else if (p == ReportEditor.this) { + handleActivate(); + } + } + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + 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() { + 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() { + public void run() { + updateProblemIndication(); + } + }); + } + } + }; + + /** + * This listens for workspace changes. + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = + new IResourceChangeListener() { + 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(); + + 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() { + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(ReportEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == ReportEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + ReportEditorPlugin.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(ReportEditor.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, + "fr.inria.diverse.event.commons.model.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) { + ReportEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + markerHelper.deleteMarkers(editingDomain.getResourceSet()); + if (diagnostic.getSeverity() != Diagnostic.OK) { + try { + markerHelper.createMarkers(diagnostic); + } + catch (CoreException exception) { + ReportEditorPlugin.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 ReportEditor() { + 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 ReportItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new PropertyItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new ScenarioItemProviderAdapterFactory()); + 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() { + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec + (new Runnable() { + 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() { + 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 + */ + 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. + // + 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 + */ + 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(), editingDomain.getResourceSet().getURIConverter()); + 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) { + boolean hasErrors = !resource.getErrors().isEmpty(); + if (hasErrors || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = + new BasicDiagnostic + (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, + "fr.inria.diverse.event.commons.model.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, + "fr.inria.diverse.event.commons.model.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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() { + 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() { + 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. + // + 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) { + ReportEditor.this.setSelectionToViewer(selection); + ReportEditor.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. + // + ReportEditorPlugin.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 + */ + 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 + */ + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * @generated + */ + 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 + */ + 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 ReportEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return ReportEditorPlugin.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 + */ + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/arbiter/presentation/ArbiterEditorPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java similarity index 86% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/arbiter/presentation/ArbiterEditorPlugin.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java index f13583545..4d1d39678 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/arbiter/presentation/ArbiterEditorPlugin.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java @@ -1,6 +1,6 @@ /** */ -package fr.inria.diverse.event.commons.model.arbiter.presentation; +package fr.inria.diverse.event.commons.model.report.presentation; import fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin; @@ -15,19 +15,19 @@ import org.eclipse.emf.ecore.provider.EcoreEditPlugin; /** - * This is the central singleton for the Arbiter editor plugin. + * This is the central singleton for the Report editor plugin. * * * @generated */ -public final class ArbiterEditorPlugin extends EMFPlugin { +public final class ReportEditorPlugin extends EMFPlugin { /** * Keep track of the singleton. * * * @generated */ - public static final ArbiterEditorPlugin INSTANCE = new ArbiterEditorPlugin(); + public static final ReportEditorPlugin INSTANCE = new ReportEditorPlugin(); /** * Keep track of the singleton. @@ -43,7 +43,7 @@ public final class ArbiterEditorPlugin extends EMFPlugin { * * @generated */ - public ArbiterEditorPlugin() { + public ReportEditorPlugin() { super (new ResourceLocator [] { EcoreEditPlugin.INSTANCE, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java new file mode 100644 index 000000000..9df62a07c --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java @@ -0,0 +1,628 @@ +/** + */ +package fr.inria.diverse.event.commons.model.report.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.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.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.xmi.XMLResource; + +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; + +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.jface.dialogs.MessageDialog; + +import org.eclipse.jface.viewers.IStructuredSelection; + +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; + +import org.eclipse.swt.SWT; + +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.ModifyEvent; + +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.actions.WorkspaceModifyOperation; + +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; + +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + +import fr.inria.diverse.event.commons.model.report.ReportFactory; +import fr.inria.diverse.event.commons.model.report.ReportPackage; +import fr.inria.diverse.event.commons.model.report.provider.ReportEditPlugin; + + +import org.eclipse.core.runtime.Path; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; + +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; + + +/** + * This is a simple wizard for creating a new model file. + * + * + * @generated + */ +public class ReportModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected ReportPackage reportPackage = ReportPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected ReportFactory reportFactory = reportPackage.getReportFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected ReportModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected ReportModelWizardInitialObjectCreationPage 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 + */ + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(ReportEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(ReportEditorPlugin.INSTANCE.getImage("full/wizban/NewReport"))); + } + + /** + * 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 : reportPackage.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)reportPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = reportFactory.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) { + ReportEditorPlugin.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() { + 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(), ReportEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } + catch (Exception exception) { + ReportEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class ReportModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public ReportModelWizardNewFileCreationPage(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(ReportEditorPlugin.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 ReportModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public ReportModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * @generated + */ + 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(ReportEditorPlugin.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(ReportEditorPlugin.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() { + 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 ReportEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } + catch(MissingResourceException mre) { + ReportEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(ReportEditorPlugin.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 ReportModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_label")); + newFileCreationPage.setDescription(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_description")); + newFileCreationPage.setFileName(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameDefaultBase") + "." + 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 = ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameDefaultBase"); + 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 ReportModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_label")); + initialObjectCreationPage.setDescription(ReportEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioActionBarContributor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioActionBarContributor.java new file mode 100644 index 000000000..0ae545e93 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioActionBarContributor.java @@ -0,0 +1,423 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.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 Scenario model editor. + * + * + * @generated + */ +public class ScenarioActionBarContributor + 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(ScenarioEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + ScenarioEditorPlugin.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(ScenarioEditorPlugin.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 ScenarioActionBarContributor() { + 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("scenario-settings")); + toolBarManager.add(new Separator("scenario-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(ScenarioEditorPlugin.INSTANCE.getString("_UI_ScenarioEditor_menu"), "fr.inria.diverse.event.commons.model.scenarioMenuID"); + 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(ScenarioEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(ScenarioEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + submenuManager.insertBefore("additions", createSiblingMenuManager); + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener + (new IMenuListener() { + 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 + */ + 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(ScenarioEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(ScenarioEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioEditor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioEditor.java new file mode 100644 index 000000000..a70e693aa --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioEditor.java @@ -0,0 +1,1825 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.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.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.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.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.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 fr.inria.diverse.event.commons.model.scenario.provider.ScenarioItemProviderAdapterFactory; + +import fr.inria.diverse.event.commons.model.property.provider.PropertyItemProviderAdapterFactory; + +import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; + +import org.eclipse.ui.actions.WorkspaceModifyOperation; + + +/** + * This is an example of a Scenario model editor. + * + * + * @generated + */ +public class ScenarioEditor + 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() { + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(ScenarioEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(ScenarioEditor.this); + handleActivate(); + } + } + else if (p == ScenarioEditor.this) { + handleActivate(); + } + } + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + 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() { + 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() { + public void run() { + updateProblemIndication(); + } + }); + } + } + }; + + /** + * This listens for workspace changes. + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = + new IResourceChangeListener() { + 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(); + + 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() { + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(ScenarioEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == ScenarioEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + ScenarioEditorPlugin.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(ScenarioEditor.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, + "fr.inria.diverse.event.commons.model.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) { + ScenarioEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + markerHelper.deleteMarkers(editingDomain.getResourceSet()); + if (diagnostic.getSeverity() != Diagnostic.OK) { + try { + markerHelper.createMarkers(diagnostic); + } + catch (CoreException exception) { + ScenarioEditorPlugin.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 ScenarioEditor() { + 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 ScenarioItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new PropertyItemProviderAdapterFactory()); + 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() { + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec + (new Runnable() { + 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() { + 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 + */ + 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. + // + 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 + */ + 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(), editingDomain.getResourceSet().getURIConverter()); + 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) { + boolean hasErrors = !resource.getErrors().isEmpty(); + if (hasErrors || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = + new BasicDiagnostic + (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, + "fr.inria.diverse.event.commons.model.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, + "fr.inria.diverse.event.commons.model.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(), ScenarioEditor.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(), ScenarioEditor.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(), ScenarioEditor.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(), ScenarioEditor.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(), ScenarioEditor.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(), ScenarioEditor.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() { + 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() { + 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. + // + 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) { + ScenarioEditor.this.setSelectionToViewer(selection); + ScenarioEditor.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. + // + ScenarioEditorPlugin.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 + */ + 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 + */ + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * @generated + */ + 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 + */ + 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 ScenarioEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return ScenarioEditorPlugin.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 + */ + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioModelWizard.java new file mode 100644 index 000000000..5787746cc --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioModelWizard.java @@ -0,0 +1,627 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario.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.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.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.xmi.XMLResource; + +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; + +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.jface.dialogs.MessageDialog; + +import org.eclipse.jface.viewers.IStructuredSelection; + +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; + +import org.eclipse.swt.SWT; + +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.ModifyEvent; + +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.actions.WorkspaceModifyOperation; + +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; + +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + +import fr.inria.diverse.event.commons.model.scenario.ScenarioFactory; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioEditPlugin; + + +import org.eclipse.core.runtime.Path; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; + +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; + + +/** + * This is a simple wizard for creating a new model file. + * + * + * @generated + */ +public class ScenarioModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(ScenarioEditorPlugin.INSTANCE.getString("_UI_ScenarioEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + ScenarioEditorPlugin.INSTANCE.getString("_UI_ScenarioEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected ScenarioPackage scenarioPackage = ScenarioPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected ScenarioFactory scenarioFactory = scenarioPackage.getScenarioFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected ScenarioModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected ScenarioModelWizardInitialObjectCreationPage 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 + */ + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(ScenarioEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(ScenarioEditorPlugin.INSTANCE.getImage("full/wizban/NewScenario"))); + } + + /** + * 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 : scenarioPackage.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)scenarioPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = scenarioFactory.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) { + ScenarioEditorPlugin.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() { + 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(), ScenarioEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } + catch (Exception exception) { + ScenarioEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class ScenarioModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public ScenarioModelWizardNewFileCreationPage(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(ScenarioEditorPlugin.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 ScenarioModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public ScenarioModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * @generated + */ + 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(ScenarioEditorPlugin.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(ScenarioEditorPlugin.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() { + 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 ScenarioEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } + catch(MissingResourceException mre) { + ScenarioEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(ScenarioEditorPlugin.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 ScenarioModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(ScenarioEditorPlugin.INSTANCE.getString("_UI_ScenarioModelWizard_label")); + newFileCreationPage.setDescription(ScenarioEditorPlugin.INSTANCE.getString("_UI_ScenarioModelWizard_description")); + newFileCreationPage.setFileName(ScenarioEditorPlugin.INSTANCE.getString("_UI_ScenarioEditorFilenameDefaultBase") + "." + 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 = ScenarioEditorPlugin.INSTANCE.getString("_UI_ScenarioEditorFilenameDefaultBase"); + 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 ScenarioModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(ScenarioEditorPlugin.INSTANCE.getString("_UI_ScenarioModelWizard_label")); + initialObjectCreationPage.setDescription(ScenarioEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF index 6fc920320..dd4447134 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF @@ -16,10 +16,7 @@ Export-Package: fr.inria.diverse.event.commons.model, fr.inria.diverse.event.commons.model.property.util, fr.inria.diverse.event.commons.model.report, fr.inria.diverse.event.commons.model.report.impl, - fr.inria.diverse.event.commons.model.report.util, - fr.inria.diverse.event.commons.model.arbiter, - fr.inria.diverse.event.commons.model.arbiter.impl, - fr.inria.diverse.event.commons.model.arbiter.util + fr.inria.diverse.event.commons.model.report.util Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, fr.inria.diverse.event.commons.model;visibility:=reexport, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore index b9b0d40fd..91f554bfb 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore @@ -1,142 +1,162 @@ - + - - + + - + - + + - + - + + + - + - + - + - + - + - - + + - + - - + + - - - + + + - + - + - - + + - + - + - - + + - - - - - + + + + + + + - - - - - + + + + + + + - - - - - + + + + + + + - - - - + + + + + + - - - - + + + + + + - - - - + + + + + + - - - + + + + + + + + + + + + @@ -155,7 +175,7 @@ - - + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore index 1af9727cc..0a4ee4d03 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore @@ -1,23 +1,20 @@ - + - + - - + + - - - + + + @@ -27,143 +24,240 @@ - + - - + + - - + + + - + - - + + - + - + + + - + + + + - - - + + - + + + - - - + + + - + - + + + - + - - - + + + - - - + + + - - + + - + - + - - + + - - - + + + + + - + - + - + + + + - - + + - - + + - - + + + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java deleted file mode 100644 index 3ca0d5a18..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.arbiter; - -import fr.inria.diverse.event.commons.model.property.Property; -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Arbiter'. - * - * - *

    - * The following features are supported: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getStates States}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getTransitions Transitions}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState Initial State}
    • - *
    - * - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter() - * @model abstract="true" - * @generated - */ -public interface Arbiter

    , T extends Transition> extends EObject { - /** - * Returns the value of the 'States' containment reference list. - * - *

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

    - * - * @return the value of the 'States' containment reference list. - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter_States() - * @model containment="true" - * @generated - */ - EList getStates(); - - /** - * Returns the value of the 'Transitions' containment reference list. - * - *

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

    - * - * @return the value of the 'Transitions' containment reference list. - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter_Transitions() - * @model containment="true" - * @generated - */ - EList getTransitions(); - - /** - * Returns the value of the 'Initial State' reference. - * - *

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

    - * - * @return the value of the 'Initial State' reference. - * @see #setInitialState(State) - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter_InitialState() - * @model - * @generated - */ - S getInitialState(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState Initial State}' reference. - * - * - * @param value the new value of the 'Initial State' reference. - * @see #getInitialState() - * @generated - */ - void setInitialState(S value); - -} // Arbiter diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java deleted file mode 100644 index 9c1785570..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.arbiter; - -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 fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage - * @generated - */ -public interface ArbiterFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * @generated - */ - ArbiterFactory eINSTANCE = fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterFactoryImpl.init(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - ArbiterPackage getArbiterPackage(); - -} //ArbiterFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java deleted file mode 100644 index 8bb7615f0..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java +++ /dev/null @@ -1,512 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.arbiter; - -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 operation of each class,
    • - *
    • each enum,
    • - *
    • and each data type
    • - *
    - * - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterFactory - * @model kind="package" - * @generated - */ -public interface ArbiterPackage extends EPackage { - /** - * The package name. - * - * - * @generated - */ - String eNAME = "arbiter"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "http://www.gemoc.org/arbiter"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "arbiter"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - ArbiterPackage eINSTANCE = fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl.init(); - - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl Arbiter}' class. - * - * - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getArbiter() - * @generated - */ - int ARBITER = 0; - - /** - * The feature id for the 'States' containment reference list. - * - * - * @generated - * @ordered - */ - int ARBITER__STATES = 0; - - /** - * The feature id for the 'Transitions' containment reference list. - * - * - * @generated - * @ordered - */ - int ARBITER__TRANSITIONS = 1; - - /** - * The feature id for the 'Initial State' reference. - * - * - * @generated - * @ordered - */ - int ARBITER__INITIAL_STATE = 2; - - /** - * The number of structural features of the 'Arbiter' class. - * - * - * @generated - * @ordered - */ - int ARBITER_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'Arbiter' class. - * - * - * @generated - * @ordered - */ - int ARBITER_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl State}' class. - * - * - * @see fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getState() - * @generated - */ - int STATE = 1; - - /** - * The feature id for the 'Truth Value' attribute. - * - * - * @generated - * @ordered - */ - int STATE__TRUTH_VALUE = 0; - - /** - * The feature id for the 'Outgoing Transitions' reference list. - * - * - * @generated - * @ordered - */ - int STATE__OUTGOING_TRANSITIONS = 1; - - /** - * The feature id for the 'Incoming Transitions' reference list. - * - * - * @generated - * @ordered - */ - int STATE__INCOMING_TRANSITIONS = 2; - - /** - * The number of structural features of the 'State' class. - * - * - * @generated - * @ordered - */ - int STATE_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'State' class. - * - * - * @generated - * @ordered - */ - int STATE_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl Transition}' class. - * - * - * @see fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTransition() - * @generated - */ - int TRANSITION = 2; - - /** - * The feature id for the 'Source' reference. - * - * - * @generated - * @ordered - */ - int TRANSITION__SOURCE = 0; - - /** - * The feature id for the 'Target' reference. - * - * - * @generated - * @ordered - */ - int TRANSITION__TARGET = 1; - - /** - * The feature id for the 'Guard' containment reference. - * - * - * @generated - * @ordered - */ - int TRANSITION__GUARD = 2; - - /** - * The number of structural features of the 'Transition' class. - * - * - * @generated - * @ordered - */ - int TRANSITION_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'Transition' class. - * - * - * @generated - * @ordered - */ - int TRANSITION_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.TruthValue Truth Value}' enum. - * - * - * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTruthValue() - * @generated - */ - int TRUTH_VALUE = 3; - - - /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter Arbiter}'. - * - * - * @return the meta object for class 'Arbiter'. - * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter - * @generated - */ - EClass getArbiter(); - - /** - * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getStates States}'. - * - * - * @return the meta object for the containment reference list 'States'. - * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter#getStates() - * @see #getArbiter() - * @generated - */ - EReference getArbiter_States(); - - /** - * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getTransitions Transitions}'. - * - * - * @return the meta object for the containment reference list 'Transitions'. - * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter#getTransitions() - * @see #getArbiter() - * @generated - */ - EReference getArbiter_Transitions(); - - /** - * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState Initial State}'. - * - * - * @return the meta object for the reference 'Initial State'. - * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState() - * @see #getArbiter() - * @generated - */ - EReference getArbiter_InitialState(); - - /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.arbiter.State State}'. - * - * - * @return the meta object for class 'State'. - * @see fr.inria.diverse.event.commons.model.arbiter.State - * @generated - */ - EClass getState(); - - /** - * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue Truth Value}'. - * - * - * @return the meta object for the attribute 'Truth Value'. - * @see fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue() - * @see #getState() - * @generated - */ - EAttribute getState_TruthValue(); - - /** - * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions Outgoing Transitions}'. - * - * - * @return the meta object for the reference list 'Outgoing Transitions'. - * @see fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions() - * @see #getState() - * @generated - */ - EReference getState_OutgoingTransitions(); - - /** - * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions Incoming Transitions}'. - * - * - * @return the meta object for the reference list 'Incoming Transitions'. - * @see fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions() - * @see #getState() - * @generated - */ - EReference getState_IncomingTransitions(); - - /** - * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.arbiter.Transition Transition}'. - * - * - * @return the meta object for class 'Transition'. - * @see fr.inria.diverse.event.commons.model.arbiter.Transition - * @generated - */ - EClass getTransition(); - - /** - * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}'. - * - * - * @return the meta object for the reference 'Source'. - * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getSource() - * @see #getTransition() - * @generated - */ - EReference getTransition_Source(); - - /** - * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}'. - * - * - * @return the meta object for the reference 'Target'. - * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget() - * @see #getTransition() - * @generated - */ - EReference getTransition_Target(); - - /** - * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard Guard}'. - * - * - * @return the meta object for the containment reference 'Guard'. - * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard() - * @see #getTransition() - * @generated - */ - EReference getTransition_Guard(); - - /** - * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.arbiter.TruthValue Truth Value}'. - * - * - * @return the meta object for enum 'Truth Value'. - * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue - * @generated - */ - EEnum getTruthValue(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - ArbiterFactory getArbiterFactory(); - - /** - * - * 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 fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl Arbiter}' class. - * - * - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getArbiter() - * @generated - */ - EClass ARBITER = eINSTANCE.getArbiter(); - - /** - * The meta object literal for the 'States' containment reference list feature. - * - * - * @generated - */ - EReference ARBITER__STATES = eINSTANCE.getArbiter_States(); - - /** - * The meta object literal for the 'Transitions' containment reference list feature. - * - * - * @generated - */ - EReference ARBITER__TRANSITIONS = eINSTANCE.getArbiter_Transitions(); - - /** - * The meta object literal for the 'Initial State' reference feature. - * - * - * @generated - */ - EReference ARBITER__INITIAL_STATE = eINSTANCE.getArbiter_InitialState(); - - /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl State}' class. - * - * - * @see fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getState() - * @generated - */ - EClass STATE = eINSTANCE.getState(); - - /** - * The meta object literal for the 'Truth Value' attribute feature. - * - * - * @generated - */ - EAttribute STATE__TRUTH_VALUE = eINSTANCE.getState_TruthValue(); - - /** - * The meta object literal for the 'Outgoing Transitions' reference list feature. - * - * - * @generated - */ - EReference STATE__OUTGOING_TRANSITIONS = eINSTANCE.getState_OutgoingTransitions(); - - /** - * The meta object literal for the 'Incoming Transitions' reference list feature. - * - * - * @generated - */ - EReference STATE__INCOMING_TRANSITIONS = eINSTANCE.getState_IncomingTransitions(); - - /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl Transition}' class. - * - * - * @see fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTransition() - * @generated - */ - EClass TRANSITION = eINSTANCE.getTransition(); - - /** - * The meta object literal for the 'Source' reference feature. - * - * - * @generated - */ - EReference TRANSITION__SOURCE = eINSTANCE.getTransition_Source(); - - /** - * The meta object literal for the 'Target' reference feature. - * - * - * @generated - */ - EReference TRANSITION__TARGET = eINSTANCE.getTransition_Target(); - - /** - * The meta object literal for the 'Guard' containment reference feature. - * - * - * @generated - */ - EReference TRANSITION__GUARD = eINSTANCE.getTransition_Guard(); - - /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.arbiter.TruthValue Truth Value}' enum. - * - * - * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue - * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTruthValue() - * @generated - */ - EEnum TRUTH_VALUE = eINSTANCE.getTruthValue(); - - } - -} //ArbiterPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java deleted file mode 100644 index a97cc4f3d..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.arbiter; - -import fr.inria.diverse.event.commons.model.property.Property; -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'State'. - * - * - *

    - * The following features are supported: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue Truth Value}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions Outgoing Transitions}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions Incoming Transitions}
    • - *
    - * - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState() - * @model abstract="true" - * @generated - */ -public interface State

    > extends EObject { - /** - * Returns the value of the 'Truth Value' attribute. - * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.arbiter.TruthValue}. - * - *

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

    - * - * @return the value of the 'Truth Value' attribute. - * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue - * @see #setTruthValue(TruthValue) - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState_TruthValue() - * @model required="true" - * @generated - */ - TruthValue getTruthValue(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue Truth Value}' attribute. - * - * - * @param value the new value of the 'Truth Value' attribute. - * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue - * @see #getTruthValue() - * @generated - */ - void setTruthValue(TruthValue value); - - /** - * Returns the value of the 'Outgoing Transitions' reference list. - * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}'. - * - *

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

    - * - * @return the value of the 'Outgoing Transitions' reference list. - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState_OutgoingTransitions() - * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getSource - * @model opposite="source" - * @generated - */ - EList getOutgoingTransitions(); - - /** - * Returns the value of the 'Incoming Transitions' reference list. - * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}'. - * - *

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

    - * - * @return the value of the 'Incoming Transitions' reference list. - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState_IncomingTransitions() - * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget - * @model opposite="target" - * @generated - */ - EList getIncomingTransitions(); - -} // State diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java deleted file mode 100644 index ddc85c552..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.arbiter; - -import fr.inria.diverse.event.commons.model.property.Property; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Transition'. - * - * - *

    - * The following features are supported: - *

    - *
      - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard Guard}
    • - *
    - * - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition() - * @model abstract="true" - * @generated - */ -public interface Transition

    > extends EObject { - /** - * Returns the value of the 'Source' reference. - * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions Outgoing Transitions}'. - * - *

    - * 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(State) - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition_Source() - * @see fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions - * @model opposite="outgoingTransitions" required="true" - * @generated - */ - S getSource(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}' reference. - * - * - * @param value the new value of the 'Source' reference. - * @see #getSource() - * @generated - */ - void setSource(S value); - - /** - * Returns the value of the 'Target' reference. - * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions Incoming Transitions}'. - * - *

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

    - * - * @return the value of the 'Target' reference. - * @see #setTarget(State) - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition_Target() - * @see fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions - * @model opposite="incomingTransitions" required="true" - * @generated - */ - S getTarget(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}' reference. - * - * - * @param value the new value of the 'Target' reference. - * @see #getTarget() - * @generated - */ - void setTarget(S value); - - /** - * Returns the value of the 'Guard' containment reference. - * - *

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

    - * - * @return the value of the 'Guard' containment reference. - * @see #setGuard(Property) - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition_Guard() - * @model containment="true" - * @generated - */ - P getGuard(); - - /** - * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard Guard}' containment reference. - * - * - * @param value the new value of the 'Guard' containment reference. - * @see #getGuard() - * @generated - */ - void setGuard(P value); - -} // Transition diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java deleted file mode 100644 index 15bdbf8c5..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.arbiter.impl; - -import fr.inria.diverse.event.commons.model.arbiter.*; -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; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class ArbiterFactoryImpl extends EFactoryImpl implements ArbiterFactory { - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static ArbiterFactory init() { - try { - ArbiterFactory theArbiterFactory = (ArbiterFactory)EPackage.Registry.INSTANCE.getEFactory(ArbiterPackage.eNS_URI); - if (theArbiterFactory != null) { - return theArbiterFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new ArbiterFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public ArbiterFactoryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - 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 ArbiterPackage.TRUTH_VALUE: - return createTruthValueFromString(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 ArbiterPackage.TRUTH_VALUE: - return convertTruthValueToString(eDataType, instanceValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public TruthValue createTruthValueFromString(EDataType eDataType, String initialValue) { - TruthValue result = TruthValue.get(initialValue); - if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertTruthValueToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public ArbiterPackage getArbiterPackage() { - return (ArbiterPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static ArbiterPackage getPackage() { - return ArbiterPackage.eINSTANCE; - } - -} //ArbiterFactoryImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java deleted file mode 100644 index 04b6309c9..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java +++ /dev/null @@ -1,387 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.arbiter.impl; - -import fr.inria.diverse.event.commons.model.arbiter.Arbiter; -import fr.inria.diverse.event.commons.model.arbiter.ArbiterFactory; -import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; -import fr.inria.diverse.event.commons.model.arbiter.State; -import fr.inria.diverse.event.commons.model.arbiter.Transition; -import fr.inria.diverse.event.commons.model.arbiter.TruthValue; - -import fr.inria.diverse.event.commons.model.property.PropertyPackage; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EGenericType; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.ETypeParameter; -import org.eclipse.emf.ecore.impl.EPackageImpl; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class ArbiterPackageImpl extends EPackageImpl implements ArbiterPackage { - /** - * - * - * @generated - */ - private EClass arbiterEClass = null; - - /** - * - * - * @generated - */ - private EClass stateEClass = null; - - /** - * - * - * @generated - */ - private EClass transitionEClass = null; - - /** - * - * - * @generated - */ - private EEnum truthValueEEnum = 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 fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#eNS_URI - * @see #init() - * @generated - */ - private ArbiterPackageImpl() { - super(eNS_URI, ArbiterFactory.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 ArbiterPackage#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 ArbiterPackage init() { - if (isInited) return (ArbiterPackage)EPackage.Registry.INSTANCE.getEPackage(ArbiterPackage.eNS_URI); - - // Obtain or create and register package - ArbiterPackageImpl theArbiterPackage = (ArbiterPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ArbiterPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ArbiterPackageImpl()); - - isInited = true; - - // Create package meta-data objects - theArbiterPackage.createPackageContents(); - - // Initialize created meta-data - theArbiterPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theArbiterPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(ArbiterPackage.eNS_URI, theArbiterPackage); - return theArbiterPackage; - } - - /** - * - * - * @generated - */ - public EClass getArbiter() { - return arbiterEClass; - } - - /** - * - * - * @generated - */ - public EReference getArbiter_States() { - return (EReference)arbiterEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getArbiter_Transitions() { - return (EReference)arbiterEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getArbiter_InitialState() { - return (EReference)arbiterEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EClass getState() { - return stateEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getState_TruthValue() { - return (EAttribute)stateEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getState_OutgoingTransitions() { - return (EReference)stateEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getState_IncomingTransitions() { - return (EReference)stateEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EClass getTransition() { - return transitionEClass; - } - - /** - * - * - * @generated - */ - public EReference getTransition_Source() { - return (EReference)transitionEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getTransition_Target() { - return (EReference)transitionEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getTransition_Guard() { - return (EReference)transitionEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EEnum getTruthValue() { - return truthValueEEnum; - } - - /** - * - * - * @generated - */ - public ArbiterFactory getArbiterFactory() { - return (ArbiterFactory)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 - arbiterEClass = createEClass(ARBITER); - createEReference(arbiterEClass, ARBITER__STATES); - createEReference(arbiterEClass, ARBITER__TRANSITIONS); - createEReference(arbiterEClass, ARBITER__INITIAL_STATE); - - stateEClass = createEClass(STATE); - createEAttribute(stateEClass, STATE__TRUTH_VALUE); - createEReference(stateEClass, STATE__OUTGOING_TRANSITIONS); - createEReference(stateEClass, STATE__INCOMING_TRANSITIONS); - - transitionEClass = createEClass(TRANSITION); - createEReference(transitionEClass, TRANSITION__SOURCE); - createEReference(transitionEClass, TRANSITION__TARGET); - createEReference(transitionEClass, TRANSITION__GUARD); - - // Create enums - truthValueEEnum = createEEnum(TRUTH_VALUE); - } - - /** - * - * - * @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 - PropertyPackage thePropertyPackage = (PropertyPackage)EPackage.Registry.INSTANCE.getEPackage(PropertyPackage.eNS_URI); - - // Create type parameters - ETypeParameter arbiterEClass_P = addETypeParameter(arbiterEClass, "P"); - ETypeParameter arbiterEClass_S = addETypeParameter(arbiterEClass, "S"); - ETypeParameter arbiterEClass_T = addETypeParameter(arbiterEClass, "T"); - ETypeParameter stateEClass_P = addETypeParameter(stateEClass, "P"); - ETypeParameter stateEClass_T = addETypeParameter(stateEClass, "T"); - ETypeParameter transitionEClass_P = addETypeParameter(transitionEClass, "P"); - ETypeParameter transitionEClass_S = addETypeParameter(transitionEClass, "S"); - - // Set bounds for type parameters - EGenericType g1 = createEGenericType(thePropertyPackage.getProperty()); - arbiterEClass_P.getEBounds().add(g1); - g1 = createEGenericType(this.getState()); - EGenericType g2 = createEGenericType(arbiterEClass_P); - g1.getETypeArguments().add(g2); - g2 = createEGenericType(arbiterEClass_T); - g1.getETypeArguments().add(g2); - arbiterEClass_S.getEBounds().add(g1); - g1 = createEGenericType(this.getTransition()); - g2 = createEGenericType(arbiterEClass_P); - g1.getETypeArguments().add(g2); - g2 = createEGenericType(arbiterEClass_S); - g1.getETypeArguments().add(g2); - arbiterEClass_T.getEBounds().add(g1); - g1 = createEGenericType(thePropertyPackage.getProperty()); - stateEClass_P.getEBounds().add(g1); - g1 = createEGenericType(this.getTransition()); - g2 = createEGenericType(stateEClass_P); - g1.getETypeArguments().add(g2); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); - stateEClass_T.getEBounds().add(g1); - g1 = createEGenericType(thePropertyPackage.getProperty()); - transitionEClass_P.getEBounds().add(g1); - g1 = createEGenericType(this.getState()); - g2 = createEGenericType(transitionEClass_P); - g1.getETypeArguments().add(g2); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); - transitionEClass_S.getEBounds().add(g1); - - // Add supertypes to classes - - // Initialize classes, features, and operations; add parameters - initEClass(arbiterEClass, Arbiter.class, "Arbiter", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(arbiterEClass_S); - initEReference(getArbiter_States(), g1, null, "states", null, 0, -1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - g1 = createEGenericType(arbiterEClass_T); - initEReference(getArbiter_Transitions(), g1, null, "transitions", null, 0, -1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - g1 = createEGenericType(arbiterEClass_S); - initEReference(getArbiter_InitialState(), g1, null, "initialState", null, 0, 1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(stateEClass, State.class, "State", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getState_TruthValue(), this.getTruthValue(), "truthValue", null, 1, 1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - g1 = createEGenericType(stateEClass_T); - initEReference(getState_OutgoingTransitions(), g1, this.getTransition_Source(), "outgoingTransitions", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - g1 = createEGenericType(stateEClass_T); - initEReference(getState_IncomingTransitions(), g1, this.getTransition_Target(), "incomingTransitions", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(transitionEClass, Transition.class, "Transition", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(transitionEClass_S); - initEReference(getTransition_Source(), g1, this.getState_OutgoingTransitions(), "source", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - g1 = createEGenericType(transitionEClass_S); - initEReference(getTransition_Target(), g1, this.getState_IncomingTransitions(), "target", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - g1 = createEGenericType(transitionEClass_P); - initEReference(getTransition_Guard(), g1, null, "guard", null, 0, 1, Transition.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(truthValueEEnum, TruthValue.class, "TruthValue"); - addEEnumLiteral(truthValueEEnum, TruthValue.TRUE); - addEEnumLiteral(truthValueEEnum, TruthValue.FALSE); - addEEnumLiteral(truthValueEEnum, TruthValue.INCONCLUSIVE); - - // Create resource - createResource(eNS_URI); - } - -} //ArbiterPackageImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java deleted file mode 100644 index 73262b6ca..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.arbiter.util; - -import fr.inria.diverse.event.commons.model.arbiter.*; - -import fr.inria.diverse.event.commons.model.property.Property; -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; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage - * @generated - */ -public class ArbiterAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * @generated - */ - protected static ArbiterPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public ArbiterAdapterFactory() { - if (modelPackage == null) { - modelPackage = ArbiterPackage.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 ArbiterSwitch modelSwitch = - new ArbiterSwitch() { - @Override - public

    , T extends Transition> Adapter caseArbiter(Arbiter object) { - return createArbiterAdapter(); - } - @Override - public

    > Adapter caseState(State object) { - return createStateAdapter(); - } - @Override - public

    > Adapter caseTransition(Transition object) { - return createTransitionAdapter(); - } - @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 fr.inria.diverse.event.commons.model.arbiter.Arbiter Arbiter}'. - * - * 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 fr.inria.diverse.event.commons.model.arbiter.Arbiter - * @generated - */ - public Adapter createArbiterAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.arbiter.State State}'. - * - * 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 fr.inria.diverse.event.commons.model.arbiter.State - * @generated - */ - public Adapter createStateAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.arbiter.Transition Transition}'. - * - * 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 fr.inria.diverse.event.commons.model.arbiter.Transition - * @generated - */ - public Adapter createTransitionAdapter() { - 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; - } - -} //ArbiterAdapterFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java deleted file mode 100644 index 3a2f5fcaa..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.arbiter.util; - -import fr.inria.diverse.event.commons.model.arbiter.*; - -import fr.inria.diverse.event.commons.model.property.Property; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.util.Switch; - -/** - * - * 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 fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage - * @generated - */ -public class ArbiterSwitch extends Switch { - /** - * The cached model package - * - * - * @generated - */ - protected static ArbiterPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public ArbiterSwitch() { - if (modelPackage == null) { - modelPackage = ArbiterPackage.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 T1 doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case ArbiterPackage.ARBITER: { - Arbiter arbiter = (Arbiter)theEObject; - T1 result = caseArbiter(arbiter); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ArbiterPackage.STATE: { - State state = (State)theEObject; - T1 result = caseState(state); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ArbiterPackage.TRANSITION: { - Transition transition = (Transition)theEObject; - T1 result = caseTransition(transition); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Arbiter'. - * - * 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 'Arbiter'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public

    , T extends Transition> T1 caseArbiter(Arbiter object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'State'. - * - * 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 'State'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public

    > T1 caseState(State object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Transition'. - * - * 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 'Transition'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public

    > T1 caseTransition(Transition 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 T1 defaultCase(EObject object) { - return null; - } - -} //ArbiterSwitch diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java index 53c2336b4..529677ec5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java @@ -883,6 +883,15 @@ public interface PropertyPackage extends EPackage { */ int STEP_PROPERTY__STEPPING = PROPERTY_FEATURE_COUNT + 0; + /** + * The feature id for the 'Target Provider' containment reference. + * + * + * @generated + * @ordered + */ + int STEP_PROPERTY__TARGET_PROVIDER = PROPERTY_FEATURE_COUNT + 1; + /** * The number of structural features of the 'Step Property' class. * @@ -890,7 +899,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int STEP_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; + int STEP_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 2; /** * The operation id for the 'Get Operation' operation. @@ -1383,6 +1392,17 @@ public interface PropertyPackage extends EPackage { */ EAttribute getStepProperty_Stepping(); + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.StepProperty#getTargetProvider Target Provider}'. + * + * + * @return the meta object for the containment reference 'Target Provider'. + * @see fr.inria.diverse.event.commons.model.property.StepProperty#getTargetProvider() + * @see #getStepProperty() + * @generated + */ + EReference getStepProperty_TargetProvider(); + /** * Returns the meta object for the '{@link fr.inria.diverse.event.commons.model.property.StepProperty#getOperation() Get Operation}' operation. * @@ -1849,6 +1869,14 @@ interface Literals { */ EAttribute STEP_PROPERTY__STEPPING = eINSTANCE.getStepProperty_Stepping(); + /** + * The meta object literal for the 'Target Provider' containment reference feature. + * + * + * @generated + */ + EReference STEP_PROPERTY__TARGET_PROVIDER = eINSTANCE.getStepProperty_TargetProvider(); + /** * The meta object literal for the 'Get Operation' operation. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java index 8a462fa0c..d23cff849 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StepProperty.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.property; +import fr.inria.diverse.event.commons.model.scenario.ElementProvider; import org.eclipse.emf.ecore.EOperation; /** @@ -14,13 +15,14 @@ *

    *
      *
    • {@link fr.inria.diverse.event.commons.model.property.StepProperty#getStepping Stepping}
    • + *
    • {@link fr.inria.diverse.event.commons.model.property.StepProperty#getTargetProvider Target Provider}
    • *
    * * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStepProperty() * @model abstract="true" * @generated */ -public interface StepProperty extends Property { +public interface StepProperty extends Property { /** * @@ -62,4 +64,30 @@ public interface StepProperty extends Property { * @generated */ void setStepping(Stepping value); + + /** + * Returns the value of the 'Target Provider' containment reference. + * + *

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

    + * + * @return the value of the 'Target Provider' containment reference. + * @see #setTargetProvider(ElementProvider) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStepProperty_TargetProvider() + * @model containment="true" + * @generated + */ + ElementProvider getTargetProvider(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.StepProperty#getTargetProvider Target Provider}' containment reference. + * + * + * @param value the new value of the 'Target Provider' containment reference. + * @see #getTargetProvider() + * @generated + */ + void setTargetProvider(ElementProvider value); } // StepProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java index 4c320ca43..f6b8e219f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java @@ -585,6 +585,15 @@ public EAttribute getStepProperty_Stepping() { return (EAttribute)stepPropertyEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + public EReference getStepProperty_TargetProvider() { + return (EReference)stepPropertyEClass.getEStructuralFeatures().get(1); + } + /** * * @@ -777,6 +786,7 @@ public void createPackageContents() { stepPropertyEClass = createEClass(STEP_PROPERTY); createEAttribute(stepPropertyEClass, STEP_PROPERTY__STEPPING); + createEReference(stepPropertyEClass, STEP_PROPERTY__TARGET_PROVIDER); createEOperation(stepPropertyEClass, STEP_PROPERTY___GET_OPERATION); propertyReferenceEClass = createEClass(PROPERTY_REFERENCE); @@ -832,6 +842,7 @@ public void initializePackageContents() { ETypeParameter booleanAttributePropertyEClass_T = addETypeParameter(booleanAttributePropertyEClass, "T"); ETypeParameter integerAttributePropertyEClass_T = addETypeParameter(integerAttributePropertyEClass, "T"); ETypeParameter stringAttributePropertyEClass_T = addETypeParameter(stringAttributePropertyEClass, "T"); + ETypeParameter stepPropertyEClass_T = addETypeParameter(stepPropertyEClass, "T"); // Set bounds for type parameters EGenericType g1 = createEGenericType(this.getStateProperty()); @@ -965,6 +976,10 @@ public void initializePackageContents() { initEClass(stepPropertyEClass, StepProperty.class, "StepProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getStepProperty_Stepping(), this.getStepping(), "stepping", null, 0, 1, StepProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(theScenarioPackage.getElementProvider()); + g2 = createEGenericType(stepPropertyEClass_T); + g1.getETypeArguments().add(g2); + initEReference(getStepProperty_TargetProvider(), g1, null, "targetProvider", null, 0, 1, StepProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEOperation(getStepProperty__GetOperation(), theEcorePackage.getEOperation(), "getOperation", 0, 1, IS_UNIQUE, IS_ORDERED); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java index b54339f5a..24712c9c9 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StepPropertyImpl.java @@ -6,11 +6,14 @@ import fr.inria.diverse.event.commons.model.property.StepProperty; import fr.inria.diverse.event.commons.model.property.Stepping; +import fr.inria.diverse.event.commons.model.scenario.ElementProvider; import java.lang.reflect.InvocationTargetException; 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.EOperation; +import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** @@ -22,11 +25,12 @@ *

    *
      *
    • {@link fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl#getStepping Stepping}
    • + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl#getTargetProvider Target Provider}
    • *
    * * @generated */ -public abstract class StepPropertyImpl extends PropertyImpl implements StepProperty { +public abstract class StepPropertyImpl extends PropertyImpl implements StepProperty { /** * The default value of the '{@link #getStepping() Stepping}' attribute. * @@ -46,6 +50,15 @@ public abstract class StepPropertyImpl extends PropertyImpl implements StepPrope */ protected Stepping stepping = STEPPING_EDEFAULT; + /** + * The cached value of the '{@link #getTargetProvider() Target Provider}' containment reference. + * + * + * @see #getTargetProvider() + * @generated + * @ordered + */ + protected ElementProvider targetProvider; /** * * @@ -76,6 +89,20 @@ public EOperation getOperation() { throw new UnsupportedOperationException(); } + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.STEP_PROPERTY__TARGET_PROVIDER: + return basicSetTargetProvider(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + /** * * @@ -97,6 +124,50 @@ public void setStepping(Stepping newStepping) { eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.STEP_PROPERTY__STEPPING, oldStepping, stepping)); } + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public ElementProvider getTargetProvider() { + return targetProvider; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTargetProvider(ElementProvider newTargetProvider, NotificationChain msgs) { + ElementProvider oldTargetProvider = targetProvider; + targetProvider = newTargetProvider; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.STEP_PROPERTY__TARGET_PROVIDER, oldTargetProvider, newTargetProvider); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setTargetProvider(ElementProvider newTargetProvider) { + if (newTargetProvider != targetProvider) { + NotificationChain msgs = null; + if (targetProvider != null) + msgs = ((InternalEObject)targetProvider).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.STEP_PROPERTY__TARGET_PROVIDER, null, msgs); + if (newTargetProvider != null) + msgs = ((InternalEObject)newTargetProvider).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.STEP_PROPERTY__TARGET_PROVIDER, null, msgs); + msgs = basicSetTargetProvider(newTargetProvider, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.STEP_PROPERTY__TARGET_PROVIDER, newTargetProvider, newTargetProvider)); + } + /** * * @@ -107,6 +178,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case PropertyPackage.STEP_PROPERTY__STEPPING: return getStepping(); + case PropertyPackage.STEP_PROPERTY__TARGET_PROVIDER: + return getTargetProvider(); } return super.eGet(featureID, resolve, coreType); } @@ -116,12 +189,16 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { * * @generated */ + @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case PropertyPackage.STEP_PROPERTY__STEPPING: setStepping((Stepping)newValue); return; + case PropertyPackage.STEP_PROPERTY__TARGET_PROVIDER: + setTargetProvider((ElementProvider)newValue); + return; } super.eSet(featureID, newValue); } @@ -137,6 +214,9 @@ public void eUnset(int featureID) { case PropertyPackage.STEP_PROPERTY__STEPPING: setStepping(STEPPING_EDEFAULT); return; + case PropertyPackage.STEP_PROPERTY__TARGET_PROVIDER: + setTargetProvider((ElementProvider)null); + return; } super.eUnset(featureID); } @@ -151,6 +231,8 @@ public boolean eIsSet(int featureID) { switch (featureID) { case PropertyPackage.STEP_PROPERTY__STEPPING: return stepping != STEPPING_EDEFAULT; + case PropertyPackage.STEP_PROPERTY__TARGET_PROVIDER: + return targetProvider != null; } return super.eIsSet(featureID); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java index 7da1f38ed..bd6e49488 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java @@ -124,7 +124,7 @@ public Adapter caseStringAttributeProperty(StringAttributeProperty object return createStringAttributePropertyAdapter(); } @Override - public Adapter caseStepProperty(StepProperty object) { + public Adapter caseStepProperty(StepProperty object) { return createStepPropertyAdapter(); } @Override diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java index 88654c06a..62ab641a7 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java @@ -174,7 +174,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { return result; } case PropertyPackage.STEP_PROPERTY: { - StepProperty stepProperty = (StepProperty)theEObject; + StepProperty stepProperty = (StepProperty)theEObject; T1 result = caseStepProperty(stepProperty); if (result == null) result = caseProperty(stepProperty); if (result == null) result = defaultCase(theEObject); @@ -367,7 +367,7 @@ public T1 caseStringAttributeProperty(StringAttributeProperty object) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public T1 caseStepProperty(StepProperty object) { + public T1 caseStepProperty(StepProperty object) { return null; } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Arbiter.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Arbiter.java new file mode 100644 index 000000000..3e0b5b4da --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/Arbiter.java @@ -0,0 +1,129 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import fr.inria.diverse.event.commons.model.property.Property; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Arbiter'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getStates States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getTransitions Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getInitialState Initial State}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getAcceptingStates Accepting States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getName Name}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiter() + * @model abstract="true" + * @generated + */ +public interface Arbiter

    , T extends ArbiterTransition> extends EObject { + /** + * Returns the value of the 'States' containment reference list. + * + *

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

    + * + * @return the value of the 'States' containment reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiter_States() + * @model containment="true" + * @generated + */ + EList getStates(); + + /** + * Returns the value of the 'Transitions' containment reference list. + * + *

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

    + * + * @return the value of the 'Transitions' containment reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiter_Transitions() + * @model containment="true" + * @generated + */ + EList getTransitions(); + + /** + * Returns the value of the 'Initial State' reference. + * + *

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

    + * + * @return the value of the 'Initial State' reference. + * @see #setInitialState(ArbiterState) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiter_InitialState() + * @model + * @generated + */ + S getInitialState(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getInitialState Initial State}' reference. + * + * + * @param value the new value of the 'Initial State' reference. + * @see #getInitialState() + * @generated + */ + void setInitialState(S value); + + /** + * Returns the value of the 'Accepting States' reference list. + * + *

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

    + * + * @return the value of the 'Accepting States' reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiter_AcceptingStates() + * @model + * @generated + */ + EList getAcceptingStates(); + + /** + * 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 fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiter_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Arbiter diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ArbiterState.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ArbiterState.java new file mode 100644 index 000000000..21851b176 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ArbiterState.java @@ -0,0 +1,120 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import fr.inria.diverse.event.commons.model.property.Property; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Arbiter State'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getIncomingTransitions Incoming Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getOutgoingTransitions Outgoing Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getTruthValue Truth Value}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getName Name}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterState() + * @model + * @generated + */ +public interface ArbiterState

    > extends EObject { + /** + * Returns the value of the 'Incoming Transitions' reference list. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getTarget Target}'. + * + *

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

    + * + * @return the value of the 'Incoming Transitions' reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterState_IncomingTransitions() + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getTarget + * @model opposite="target" + * @generated + */ + EList getIncomingTransitions(); + + /** + * Returns the value of the 'Outgoing Transitions' reference list. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getSource Source}'. + * + *

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

    + * + * @return the value of the 'Outgoing Transitions' reference list. + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterState_OutgoingTransitions() + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getSource + * @model opposite="source" + * @generated + */ + EList getOutgoingTransitions(); + + /** + * Returns the value of the 'Truth Value' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.scenario.TruthValue}. + * + *

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

    + * + * @return the value of the 'Truth Value' attribute. + * @see fr.inria.diverse.event.commons.model.scenario.TruthValue + * @see #setTruthValue(TruthValue) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterState_TruthValue() + * @model required="true" + * @generated + */ + TruthValue getTruthValue(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getTruthValue Truth Value}' attribute. + * + * + * @param value the new value of the 'Truth Value' attribute. + * @see fr.inria.diverse.event.commons.model.scenario.TruthValue + * @see #getTruthValue() + * @generated + */ + void setTruthValue(TruthValue 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 fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterState_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // ArbiterState diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ArbiterTransition.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ArbiterTransition.java new file mode 100644 index 000000000..084d6d17b --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ArbiterTransition.java @@ -0,0 +1,137 @@ +/** + */ +package fr.inria.diverse.event.commons.model.scenario; + +import fr.inria.diverse.event.commons.model.property.Property; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Arbiter Transition'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getGuard Guard}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getSource Source}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getTarget Target}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getName Name}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterTransition() + * @model + * @generated + */ +public interface ArbiterTransition

    > extends EObject { + /** + * Returns the value of the 'Guard' containment reference. + * + *

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

    + * + * @return the value of the 'Guard' containment reference. + * @see #setGuard(Property) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterTransition_Guard() + * @model containment="true" + * @generated + */ + P getGuard(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getGuard Guard}' containment reference. + * + * + * @param value the new value of the 'Guard' containment reference. + * @see #getGuard() + * @generated + */ + void setGuard(P value); + + /** + * Returns the value of the 'Source' reference. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getOutgoingTransitions Outgoing Transitions}'. + * + *

    + * 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(ArbiterState) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterTransition_Source() + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterState#getOutgoingTransitions + * @model opposite="outgoingTransitions" required="true" + * @generated + */ + S getSource(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getSource Source}' reference. + * + * + * @param value the new value of the 'Source' reference. + * @see #getSource() + * @generated + */ + void setSource(S value); + + /** + * Returns the value of the 'Target' reference. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getIncomingTransitions Incoming Transitions}'. + * + *

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

    + * + * @return the value of the 'Target' reference. + * @see #setTarget(ArbiterState) + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterTransition_Target() + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterState#getIncomingTransitions + * @model opposite="incomingTransitions" required="true" + * @generated + */ + S getTarget(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(S 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 fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getArbiterTransition_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // ArbiterTransition diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFactory.java index 585ac29a6..402bceb84 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioFactory.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.scenario; +import fr.inria.diverse.event.commons.model.property.Property; import org.eclipse.emf.ecore.EFactory; /** @@ -21,6 +22,24 @@ public interface ScenarioFactory extends EFactory { */ ScenarioFactory eINSTANCE = fr.inria.diverse.event.commons.model.scenario.impl.ScenarioFactoryImpl.init(); + /** + * Returns a new object of class 'Arbiter State'. + * + * + * @return a new object of class 'Arbiter State'. + * @generated + */ +

    > ArbiterState createArbiterState(); + + /** + * Returns a new object of class 'Arbiter Transition'. + * + * + * @return a new object of class 'Arbiter Transition'. + * @generated + */ +

    > ArbiterTransition createArbiterTransition(); + /** * Returns the package supported by this factory. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java index ce85f4138..f6eaf8546 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/ScenarioPackage.java @@ -4,6 +4,7 @@ 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; @@ -562,6 +563,218 @@ public interface ScenarioPackage extends EPackage { int SCENARIO_FSM_TRANSITION_OPERATION_COUNT = 0; + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterImpl Arbiter}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ArbiterImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getArbiter() + * @generated + */ + int ARBITER = 10; + + /** + * The feature id for the 'States' containment reference list. + * + * + * @generated + * @ordered + */ + int ARBITER__STATES = 0; + + /** + * The feature id for the 'Transitions' containment reference list. + * + * + * @generated + * @ordered + */ + int ARBITER__TRANSITIONS = 1; + + /** + * The feature id for the 'Initial State' reference. + * + * + * @generated + * @ordered + */ + int ARBITER__INITIAL_STATE = 2; + + /** + * The feature id for the 'Accepting States' reference list. + * + * + * @generated + * @ordered + */ + int ARBITER__ACCEPTING_STATES = 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int ARBITER__NAME = 4; + + /** + * The number of structural features of the 'Arbiter' class. + * + * + * @generated + * @ordered + */ + int ARBITER_FEATURE_COUNT = 5; + + /** + * The number of operations of the 'Arbiter' class. + * + * + * @generated + * @ordered + */ + int ARBITER_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterStateImpl Arbiter State}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ArbiterStateImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getArbiterState() + * @generated + */ + int ARBITER_STATE = 11; + + /** + * The feature id for the 'Incoming Transitions' reference list. + * + * + * @generated + * @ordered + */ + int ARBITER_STATE__INCOMING_TRANSITIONS = 0; + + /** + * The feature id for the 'Outgoing Transitions' reference list. + * + * + * @generated + * @ordered + */ + int ARBITER_STATE__OUTGOING_TRANSITIONS = 1; + + /** + * The feature id for the 'Truth Value' attribute. + * + * + * @generated + * @ordered + */ + int ARBITER_STATE__TRUTH_VALUE = 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int ARBITER_STATE__NAME = 3; + + /** + * The number of structural features of the 'Arbiter State' class. + * + * + * @generated + * @ordered + */ + int ARBITER_STATE_FEATURE_COUNT = 4; + + /** + * The number of operations of the 'Arbiter State' class. + * + * + * @generated + * @ordered + */ + int ARBITER_STATE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterTransitionImpl Arbiter Transition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ArbiterTransitionImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getArbiterTransition() + * @generated + */ + int ARBITER_TRANSITION = 12; + + /** + * The feature id for the 'Guard' containment reference. + * + * + * @generated + * @ordered + */ + int ARBITER_TRANSITION__GUARD = 0; + + /** + * The feature id for the 'Source' reference. + * + * + * @generated + * @ordered + */ + int ARBITER_TRANSITION__SOURCE = 1; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int ARBITER_TRANSITION__TARGET = 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int ARBITER_TRANSITION__NAME = 3; + + /** + * The number of structural features of the 'Arbiter Transition' class. + * + * + * @generated + * @ordered + */ + int ARBITER_TRANSITION_FEATURE_COUNT = 4; + + /** + * The number of operations of the 'Arbiter Transition' class. + * + * + * @generated + * @ordered + */ + int ARBITER_TRANSITION_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.scenario.TruthValue Truth Value}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.TruthValue + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getTruthValue() + * @generated + */ + int TRUTH_VALUE = 13; + + /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Scenario Scenario}'. * @@ -893,6 +1106,189 @@ public interface ScenarioPackage extends EPackage { */ EAttribute getScenarioFSMTransition_Name(); + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.Arbiter Arbiter}'. + * + * + * @return the meta object for class 'Arbiter'. + * @see fr.inria.diverse.event.commons.model.scenario.Arbiter + * @generated + */ + EClass getArbiter(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getStates States}'. + * + * + * @return the meta object for the containment reference list 'States'. + * @see fr.inria.diverse.event.commons.model.scenario.Arbiter#getStates() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_States(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getTransitions Transitions}'. + * + * + * @return the meta object for the containment reference list 'Transitions'. + * @see fr.inria.diverse.event.commons.model.scenario.Arbiter#getTransitions() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_Transitions(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getInitialState Initial State}'. + * + * + * @return the meta object for the reference 'Initial State'. + * @see fr.inria.diverse.event.commons.model.scenario.Arbiter#getInitialState() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_InitialState(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getAcceptingStates Accepting States}'. + * + * + * @return the meta object for the reference list 'Accepting States'. + * @see fr.inria.diverse.event.commons.model.scenario.Arbiter#getAcceptingStates() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_AcceptingStates(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.Arbiter#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see fr.inria.diverse.event.commons.model.scenario.Arbiter#getName() + * @see #getArbiter() + * @generated + */ + EAttribute getArbiter_Name(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState Arbiter State}'. + * + * + * @return the meta object for class 'Arbiter State'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterState + * @generated + */ + EClass getArbiterState(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getIncomingTransitions Incoming Transitions}'. + * + * + * @return the meta object for the reference list 'Incoming Transitions'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterState#getIncomingTransitions() + * @see #getArbiterState() + * @generated + */ + EReference getArbiterState_IncomingTransitions(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getOutgoingTransitions Outgoing Transitions}'. + * + * + * @return the meta object for the reference list 'Outgoing Transitions'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterState#getOutgoingTransitions() + * @see #getArbiterState() + * @generated + */ + EReference getArbiterState_OutgoingTransitions(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getTruthValue Truth Value}'. + * + * + * @return the meta object for the attribute 'Truth Value'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterState#getTruthValue() + * @see #getArbiterState() + * @generated + */ + EAttribute getArbiterState_TruthValue(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterState#getName() + * @see #getArbiterState() + * @generated + */ + EAttribute getArbiterState_Name(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition Arbiter Transition}'. + * + * + * @return the meta object for class 'Arbiter Transition'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterTransition + * @generated + */ + EClass getArbiterTransition(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getGuard Guard}'. + * + * + * @return the meta object for the containment reference 'Guard'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getGuard() + * @see #getArbiterTransition() + * @generated + */ + EReference getArbiterTransition_Guard(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getSource Source}'. + * + * + * @return the meta object for the reference 'Source'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getSource() + * @see #getArbiterTransition() + * @generated + */ + EReference getArbiterTransition_Source(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getTarget() + * @see #getArbiterTransition() + * @generated + */ + EReference getArbiterTransition_Target(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see fr.inria.diverse.event.commons.model.scenario.ArbiterTransition#getName() + * @see #getArbiterTransition() + * @generated + */ + EAttribute getArbiterTransition_Name(); + + /** + * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.scenario.TruthValue Truth Value}'. + * + * + * @return the meta object for enum 'Truth Value'. + * @see fr.inria.diverse.event.commons.model.scenario.TruthValue + * @generated + */ + EEnum getTruthValue(); + /** * Returns the factory that creates the instances of the model. * @@ -1184,6 +1580,150 @@ interface Literals { */ EAttribute SCENARIO_FSM_TRANSITION__NAME = eINSTANCE.getScenarioFSMTransition_Name(); + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterImpl Arbiter}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ArbiterImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getArbiter() + * @generated + */ + EClass ARBITER = eINSTANCE.getArbiter(); + + /** + * The meta object literal for the 'States' containment reference list feature. + * + * + * @generated + */ + EReference ARBITER__STATES = eINSTANCE.getArbiter_States(); + + /** + * The meta object literal for the 'Transitions' containment reference list feature. + * + * + * @generated + */ + EReference ARBITER__TRANSITIONS = eINSTANCE.getArbiter_Transitions(); + + /** + * The meta object literal for the 'Initial State' reference feature. + * + * + * @generated + */ + EReference ARBITER__INITIAL_STATE = eINSTANCE.getArbiter_InitialState(); + + /** + * The meta object literal for the 'Accepting States' reference list feature. + * + * + * @generated + */ + EReference ARBITER__ACCEPTING_STATES = eINSTANCE.getArbiter_AcceptingStates(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute ARBITER__NAME = eINSTANCE.getArbiter_Name(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterStateImpl Arbiter State}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ArbiterStateImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getArbiterState() + * @generated + */ + EClass ARBITER_STATE = eINSTANCE.getArbiterState(); + + /** + * The meta object literal for the 'Incoming Transitions' reference list feature. + * + * + * @generated + */ + EReference ARBITER_STATE__INCOMING_TRANSITIONS = eINSTANCE.getArbiterState_IncomingTransitions(); + + /** + * The meta object literal for the 'Outgoing Transitions' reference list feature. + * + * + * @generated + */ + EReference ARBITER_STATE__OUTGOING_TRANSITIONS = eINSTANCE.getArbiterState_OutgoingTransitions(); + + /** + * The meta object literal for the 'Truth Value' attribute feature. + * + * + * @generated + */ + EAttribute ARBITER_STATE__TRUTH_VALUE = eINSTANCE.getArbiterState_TruthValue(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute ARBITER_STATE__NAME = eINSTANCE.getArbiterState_Name(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterTransitionImpl Arbiter Transition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.impl.ArbiterTransitionImpl + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getArbiterTransition() + * @generated + */ + EClass ARBITER_TRANSITION = eINSTANCE.getArbiterTransition(); + + /** + * The meta object literal for the 'Guard' containment reference feature. + * + * + * @generated + */ + EReference ARBITER_TRANSITION__GUARD = eINSTANCE.getArbiterTransition_Guard(); + + /** + * The meta object literal for the 'Source' reference feature. + * + * + * @generated + */ + EReference ARBITER_TRANSITION__SOURCE = eINSTANCE.getArbiterTransition_Source(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference ARBITER_TRANSITION__TARGET = eINSTANCE.getArbiterTransition_Target(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute ARBITER_TRANSITION__NAME = eINSTANCE.getArbiterTransition_Name(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.scenario.TruthValue Truth Value}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.scenario.TruthValue + * @see fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl#getTruthValue() + * @generated + */ + EEnum TRUTH_VALUE = eINSTANCE.getTruthValue(); + } } //ScenarioPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TruthValue.java similarity index 92% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TruthValue.java index 07ecc3ae0..654179257 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/TruthValue.java @@ -1,6 +1,6 @@ /** */ -package fr.inria.diverse.event.commons.model.arbiter; +package fr.inria.diverse.event.commons.model.scenario; import java.util.Arrays; import java.util.Collections; @@ -13,12 +13,20 @@ * A representation of the literals of the enumeration 'Truth Value', * and utility methods for working with them. * - * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTruthValue() + * @see fr.inria.diverse.event.commons.model.scenario.ScenarioPackage#getTruthValue() * @model * @generated */ public enum TruthValue implements Enumerator { /** + * The 'INCONCLUSIVE' literal object. + * + * + * @see #INCONCLUSIVE_VALUE + * @generated + * @ordered + */ + INCONCLUSIVE(0, "INCONCLUSIVE", "INCONCLUSIVE"), /** * The 'TRUE' literal object. * * @@ -26,9 +34,7 @@ public enum TruthValue implements Enumerator { * @generated * @ordered */ - TRUE(0, "TRUE", "TRUE"), - - /** + TRUE(1, "TRUE", "TRUE"), /** * The 'FALSE' literal object. * * @@ -36,19 +42,25 @@ public enum TruthValue implements Enumerator { * @generated * @ordered */ - FALSE(1, "FALSE", "FALSE"), + FALSE(2, "FALSE", "FALSE") + ; /** - * The 'INCONCLUSIVE' literal object. + * The 'INCONCLUSIVE' literal value. * + *

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

    * - * @see #INCONCLUSIVE_VALUE + * @see #INCONCLUSIVE + * @model * @generated * @ordered */ - INCONCLUSIVE(2, "INCONCLUSIVE", "INCONCLUSIVE"); + public static final int INCONCLUSIVE_VALUE = 0; - /** +/** * The 'TRUE' literal value. * *

    @@ -61,9 +73,9 @@ public enum TruthValue implements Enumerator { * @generated * @ordered */ - public static final int TRUE_VALUE = 0; + public static final int TRUE_VALUE = 1; - /** +/** * The 'FALSE' literal value. * *

    @@ -76,22 +88,7 @@ public enum TruthValue implements Enumerator { * @generated * @ordered */ - public static final int FALSE_VALUE = 1; - - /** - * The 'INCONCLUSIVE' literal value. - * - *

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

    - * - * @see #INCONCLUSIVE - * @model - * @generated - * @ordered - */ - public static final int INCONCLUSIVE_VALUE = 2; + public static final int FALSE_VALUE = 2; /** * An array of all the 'Truth Value' enumerators. @@ -101,9 +98,9 @@ public enum TruthValue implements Enumerator { */ private static final TruthValue[] VALUES_ARRAY = new TruthValue[] { + INCONCLUSIVE, TRUE, FALSE, - INCONCLUSIVE, }; /** @@ -160,9 +157,9 @@ public static TruthValue getByName(String name) { */ public static TruthValue get(int value) { switch (value) { + case INCONCLUSIVE_VALUE: return INCONCLUSIVE; case TRUE_VALUE: return TRUE; case FALSE_VALUE: return FALSE; - case INCONCLUSIVE_VALUE: return INCONCLUSIVE; } return null; } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ArbiterImpl.java similarity index 50% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ArbiterImpl.java index 924cd6d02..554c5bc6f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ArbiterImpl.java @@ -1,13 +1,14 @@ /** */ -package fr.inria.diverse.event.commons.model.arbiter.impl; - -import fr.inria.diverse.event.commons.model.arbiter.Arbiter; -import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; -import fr.inria.diverse.event.commons.model.arbiter.State; -import fr.inria.diverse.event.commons.model.arbiter.Transition; +package fr.inria.diverse.event.commons.model.scenario.impl; import fr.inria.diverse.event.commons.model.property.Property; + +import fr.inria.diverse.event.commons.model.scenario.Arbiter; +import fr.inria.diverse.event.commons.model.scenario.ArbiterState; +import fr.inria.diverse.event.commons.model.scenario.ArbiterTransition; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + import java.util.Collection; import org.eclipse.emf.common.notify.Notification; @@ -22,6 +23,7 @@ import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; import org.eclipse.emf.ecore.util.InternalEList; /** @@ -32,14 +34,16 @@ * The following features are implemented: *

    *
      - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl#getStates States}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl#getTransitions Transitions}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl#getInitialState Initial State}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterImpl#getStates States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterImpl#getTransitions Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterImpl#getInitialState Initial State}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterImpl#getAcceptingStates Accepting States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterImpl#getName Name}
    • *
    * * @generated */ -public abstract class ArbiterImpl

    , T extends Transition> extends MinimalEObjectImpl.Container implements Arbiter { +public abstract class ArbiterImpl

    , T extends ArbiterTransition> extends MinimalEObjectImpl.Container implements Arbiter { /** * The cached value of the '{@link #getStates() States}' containment reference list. * @@ -70,6 +74,36 @@ public abstract class ArbiterImpl

    , T e */ protected S initialState; + /** + * The cached value of the '{@link #getAcceptingStates() Accepting States}' reference list. + * + * + * @see #getAcceptingStates() + * @generated + * @ordered + */ + protected EList acceptingStates; + + /** + * 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; + /** * * @@ -86,7 +120,7 @@ protected ArbiterImpl() { */ @Override protected EClass eStaticClass() { - return ArbiterPackage.Literals.ARBITER; + return ScenarioPackage.Literals.ARBITER; } /** @@ -96,7 +130,7 @@ protected EClass eStaticClass() { */ public EList getStates() { if (states == null) { - states = new EObjectContainmentEList(State.class, this, ArbiterPackage.ARBITER__STATES); + states = new EObjectContainmentEList(ArbiterState.class, this, ScenarioPackage.ARBITER__STATES); } return states; } @@ -108,7 +142,7 @@ public EList getStates() { */ public EList getTransitions() { if (transitions == null) { - transitions = new EObjectContainmentEList(Transition.class, this, ArbiterPackage.ARBITER__TRANSITIONS); + transitions = new EObjectContainmentEList(ArbiterTransition.class, this, ScenarioPackage.ARBITER__TRANSITIONS); } return transitions; } @@ -125,7 +159,7 @@ public S getInitialState() { initialState = (S)eResolveProxy(oldInitialState); if (initialState != oldInitialState) { if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArbiterPackage.ARBITER__INITIAL_STATE, oldInitialState, initialState)); + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScenarioPackage.ARBITER__INITIAL_STATE, oldInitialState, initialState)); } } return initialState; @@ -149,7 +183,41 @@ public void setInitialState(S newInitialState) { S oldInitialState = initialState; initialState = newInitialState; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.ARBITER__INITIAL_STATE, oldInitialState, initialState)); + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER__INITIAL_STATE, oldInitialState, initialState)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public EList getAcceptingStates() { + if (acceptingStates == null) { + acceptingStates = new EObjectResolvingEList(ArbiterState.class, this, ScenarioPackage.ARBITER__ACCEPTING_STATES); + } + return acceptingStates; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER__NAME, oldName, name)); } /** @@ -160,9 +228,9 @@ public void setInitialState(S newInitialState) { @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case ArbiterPackage.ARBITER__STATES: + case ScenarioPackage.ARBITER__STATES: return ((InternalEList)getStates()).basicRemove(otherEnd, msgs); - case ArbiterPackage.ARBITER__TRANSITIONS: + case ScenarioPackage.ARBITER__TRANSITIONS: return ((InternalEList)getTransitions()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); @@ -176,13 +244,17 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case ArbiterPackage.ARBITER__STATES: + case ScenarioPackage.ARBITER__STATES: return getStates(); - case ArbiterPackage.ARBITER__TRANSITIONS: + case ScenarioPackage.ARBITER__TRANSITIONS: return getTransitions(); - case ArbiterPackage.ARBITER__INITIAL_STATE: + case ScenarioPackage.ARBITER__INITIAL_STATE: if (resolve) return getInitialState(); return basicGetInitialState(); + case ScenarioPackage.ARBITER__ACCEPTING_STATES: + return getAcceptingStates(); + case ScenarioPackage.ARBITER__NAME: + return getName(); } return super.eGet(featureID, resolve, coreType); } @@ -196,17 +268,24 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case ArbiterPackage.ARBITER__STATES: + case ScenarioPackage.ARBITER__STATES: getStates().clear(); getStates().addAll((Collection)newValue); return; - case ArbiterPackage.ARBITER__TRANSITIONS: + case ScenarioPackage.ARBITER__TRANSITIONS: getTransitions().clear(); getTransitions().addAll((Collection)newValue); return; - case ArbiterPackage.ARBITER__INITIAL_STATE: + case ScenarioPackage.ARBITER__INITIAL_STATE: setInitialState((S)newValue); return; + case ScenarioPackage.ARBITER__ACCEPTING_STATES: + getAcceptingStates().clear(); + getAcceptingStates().addAll((Collection)newValue); + return; + case ScenarioPackage.ARBITER__NAME: + setName((String)newValue); + return; } super.eSet(featureID, newValue); } @@ -219,15 +298,21 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case ArbiterPackage.ARBITER__STATES: + case ScenarioPackage.ARBITER__STATES: getStates().clear(); return; - case ArbiterPackage.ARBITER__TRANSITIONS: + case ScenarioPackage.ARBITER__TRANSITIONS: getTransitions().clear(); return; - case ArbiterPackage.ARBITER__INITIAL_STATE: + case ScenarioPackage.ARBITER__INITIAL_STATE: setInitialState((S)null); return; + case ScenarioPackage.ARBITER__ACCEPTING_STATES: + getAcceptingStates().clear(); + return; + case ScenarioPackage.ARBITER__NAME: + setName(NAME_EDEFAULT); + return; } super.eUnset(featureID); } @@ -240,14 +325,34 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case ArbiterPackage.ARBITER__STATES: + case ScenarioPackage.ARBITER__STATES: return states != null && !states.isEmpty(); - case ArbiterPackage.ARBITER__TRANSITIONS: + case ScenarioPackage.ARBITER__TRANSITIONS: return transitions != null && !transitions.isEmpty(); - case ArbiterPackage.ARBITER__INITIAL_STATE: + case ScenarioPackage.ARBITER__INITIAL_STATE: return initialState != null; + case ScenarioPackage.ARBITER__ACCEPTING_STATES: + return acceptingStates != null && !acceptingStates.isEmpty(); + case ScenarioPackage.ARBITER__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } 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(); + } + } //ArbiterImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ArbiterStateImpl.java similarity index 60% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ArbiterStateImpl.java index 49c094171..76740dbcd 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ArbiterStateImpl.java @@ -1,45 +1,66 @@ /** */ -package fr.inria.diverse.event.commons.model.arbiter.impl; - -import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; -import fr.inria.diverse.event.commons.model.arbiter.State; -import fr.inria.diverse.event.commons.model.arbiter.Transition; -import fr.inria.diverse.event.commons.model.arbiter.TruthValue; +package fr.inria.diverse.event.commons.model.scenario.impl; import fr.inria.diverse.event.commons.model.property.Property; + +import fr.inria.diverse.event.commons.model.scenario.ArbiterState; +import fr.inria.diverse.event.commons.model.scenario.ArbiterTransition; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.TruthValue; + import java.util.Collection; import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; +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.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; import org.eclipse.emf.ecore.util.InternalEList; /** * - * An implementation of the model object 'State'. + * An implementation of the model object 'Arbiter State'. * *

    * The following features are implemented: *

    *
      - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl#getTruthValue Truth Value}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl#getOutgoingTransitions Outgoing Transitions}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl#getIncomingTransitions Incoming Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterStateImpl#getIncomingTransitions Incoming Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterStateImpl#getOutgoingTransitions Outgoing Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterStateImpl#getTruthValue Truth Value}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterStateImpl#getName Name}
    • *
    * * @generated */ -public abstract class StateImpl

    > extends MinimalEObjectImpl.Container implements State { +public class ArbiterStateImpl

    > extends MinimalEObjectImpl.Container implements ArbiterState { + /** + * The cached value of the '{@link #getIncomingTransitions() Incoming Transitions}' reference list. + * + * + * @see #getIncomingTransitions() + * @generated + * @ordered + */ + protected EList incomingTransitions; + + /** + * The cached value of the '{@link #getOutgoingTransitions() Outgoing Transitions}' reference list. + * + * + * @see #getOutgoingTransitions() + * @generated + * @ordered + */ + protected EList outgoingTransitions; + /** * The default value of the '{@link #getTruthValue() Truth Value}' attribute. * @@ -48,7 +69,7 @@ public abstract class StateImpl

    > * @generated * @ordered */ - protected static final TruthValue TRUTH_VALUE_EDEFAULT = TruthValue.TRUE; + protected static final TruthValue TRUTH_VALUE_EDEFAULT = TruthValue.INCONCLUSIVE; /** * The cached value of the '{@link #getTruthValue() Truth Value}' attribute. @@ -61,31 +82,31 @@ public abstract class StateImpl

    > protected TruthValue truthValue = TRUTH_VALUE_EDEFAULT; /** - * The cached value of the '{@link #getOutgoingTransitions() Outgoing Transitions}' reference list. + * The default value of the '{@link #getName() Name}' attribute. * * - * @see #getOutgoingTransitions() + * @see #getName() * @generated * @ordered */ - protected EList outgoingTransitions; + protected static final String NAME_EDEFAULT = null; /** - * The cached value of the '{@link #getIncomingTransitions() Incoming Transitions}' reference list. + * The cached value of the '{@link #getName() Name}' attribute. * * - * @see #getIncomingTransitions() + * @see #getName() * @generated * @ordered */ - protected EList incomingTransitions; + protected String name = NAME_EDEFAULT; /** * * * @generated */ - protected StateImpl() { + protected ArbiterStateImpl() { super(); } @@ -96,7 +117,31 @@ protected StateImpl() { */ @Override protected EClass eStaticClass() { - return ArbiterPackage.Literals.STATE; + return ScenarioPackage.Literals.ARBITER_STATE; + } + + /** + * + * + * @generated + */ + public EList getIncomingTransitions() { + if (incomingTransitions == null) { + incomingTransitions = new EObjectWithInverseResolvingEList(ArbiterTransition.class, this, ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS, ScenarioPackage.ARBITER_TRANSITION__TARGET); + } + return incomingTransitions; + } + + /** + * + * + * @generated + */ + public EList getOutgoingTransitions() { + if (outgoingTransitions == null) { + outgoingTransitions = new EObjectWithInverseResolvingEList(ArbiterTransition.class, this, ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS, ScenarioPackage.ARBITER_TRANSITION__SOURCE); + } + return outgoingTransitions; } /** @@ -117,7 +162,7 @@ public void setTruthValue(TruthValue newTruthValue) { TruthValue oldTruthValue = truthValue; truthValue = newTruthValue == null ? TRUTH_VALUE_EDEFAULT : newTruthValue; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.STATE__TRUTH_VALUE, oldTruthValue, truthValue)); + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER_STATE__TRUTH_VALUE, oldTruthValue, truthValue)); } /** @@ -125,11 +170,8 @@ public void setTruthValue(TruthValue newTruthValue) { * * @generated */ - public EList getOutgoingTransitions() { - if (outgoingTransitions == null) { - outgoingTransitions = new EObjectWithInverseResolvingEList(Transition.class, this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, ArbiterPackage.TRANSITION__SOURCE); - } - return outgoingTransitions; + public String getName() { + return name; } /** @@ -137,11 +179,11 @@ public EList getOutgoingTransitions() { * * @generated */ - public EList getIncomingTransitions() { - if (incomingTransitions == null) { - incomingTransitions = new EObjectWithInverseResolvingEList(Transition.class, this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, ArbiterPackage.TRANSITION__TARGET); - } - return incomingTransitions; + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER_STATE__NAME, oldName, name)); } /** @@ -153,10 +195,10 @@ public EList getIncomingTransitions() { @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: - return ((InternalEList)(InternalEList)getOutgoingTransitions()).basicAdd(otherEnd, msgs); - case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + case ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS: return ((InternalEList)(InternalEList)getIncomingTransitions()).basicAdd(otherEnd, msgs); + case ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS: + return ((InternalEList)(InternalEList)getOutgoingTransitions()).basicAdd(otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } @@ -169,10 +211,10 @@ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, No @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: - return ((InternalEList)getOutgoingTransitions()).basicRemove(otherEnd, msgs); - case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + case ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS: return ((InternalEList)getIncomingTransitions()).basicRemove(otherEnd, msgs); + case ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS: + return ((InternalEList)getOutgoingTransitions()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -185,12 +227,14 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case ArbiterPackage.STATE__TRUTH_VALUE: - return getTruthValue(); - case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: - return getOutgoingTransitions(); - case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + case ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS: return getIncomingTransitions(); + case ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS: + return getOutgoingTransitions(); + case ScenarioPackage.ARBITER_STATE__TRUTH_VALUE: + return getTruthValue(); + case ScenarioPackage.ARBITER_STATE__NAME: + return getName(); } return super.eGet(featureID, resolve, coreType); } @@ -204,16 +248,19 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case ArbiterPackage.STATE__TRUTH_VALUE: - setTruthValue((TruthValue)newValue); + case ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS: + getIncomingTransitions().clear(); + getIncomingTransitions().addAll((Collection)newValue); return; - case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + case ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS: getOutgoingTransitions().clear(); getOutgoingTransitions().addAll((Collection)newValue); return; - case ArbiterPackage.STATE__INCOMING_TRANSITIONS: - getIncomingTransitions().clear(); - getIncomingTransitions().addAll((Collection)newValue); + case ScenarioPackage.ARBITER_STATE__TRUTH_VALUE: + setTruthValue((TruthValue)newValue); + return; + case ScenarioPackage.ARBITER_STATE__NAME: + setName((String)newValue); return; } super.eSet(featureID, newValue); @@ -227,14 +274,17 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case ArbiterPackage.STATE__TRUTH_VALUE: - setTruthValue(TRUTH_VALUE_EDEFAULT); + case ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS: + getIncomingTransitions().clear(); return; - case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + case ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS: getOutgoingTransitions().clear(); return; - case ArbiterPackage.STATE__INCOMING_TRANSITIONS: - getIncomingTransitions().clear(); + case ScenarioPackage.ARBITER_STATE__TRUTH_VALUE: + setTruthValue(TRUTH_VALUE_EDEFAULT); + return; + case ScenarioPackage.ARBITER_STATE__NAME: + setName(NAME_EDEFAULT); return; } super.eUnset(featureID); @@ -248,12 +298,14 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case ArbiterPackage.STATE__TRUTH_VALUE: - return truthValue != TRUTH_VALUE_EDEFAULT; - case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: - return outgoingTransitions != null && !outgoingTransitions.isEmpty(); - case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + case ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS: return incomingTransitions != null && !incomingTransitions.isEmpty(); + case ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS: + return outgoingTransitions != null && !outgoingTransitions.isEmpty(); + case ScenarioPackage.ARBITER_STATE__TRUTH_VALUE: + return truthValue != TRUTH_VALUE_EDEFAULT; + case ScenarioPackage.ARBITER_STATE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID); } @@ -270,8 +322,10 @@ public String toString() { StringBuffer result = new StringBuffer(super.toString()); result.append(" (truthValue: "); result.append(truthValue); + result.append(", name: "); + result.append(name); result.append(')'); return result.toString(); } -} //StateImpl +} //ArbiterStateImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ArbiterTransitionImpl.java similarity index 56% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ArbiterTransitionImpl.java index 5dffaad07..ba18cb7e0 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ArbiterTransitionImpl.java @@ -1,12 +1,13 @@ /** */ -package fr.inria.diverse.event.commons.model.arbiter.impl; - -import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; -import fr.inria.diverse.event.commons.model.arbiter.State; -import fr.inria.diverse.event.commons.model.arbiter.Transition; +package fr.inria.diverse.event.commons.model.scenario.impl; import fr.inria.diverse.event.commons.model.property.Property; + +import fr.inria.diverse.event.commons.model.scenario.ArbiterState; +import fr.inria.diverse.event.commons.model.scenario.ArbiterTransition; +import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; @@ -18,20 +19,31 @@ /** * - * An implementation of the model object 'Transition'. + * An implementation of the model object 'Arbiter Transition'. * *

    * The following features are implemented: *

    *
      - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl#getSource Source}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl#getTarget Target}
    • - *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl#getGuard Guard}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterTransitionImpl#getGuard Guard}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterTransitionImpl#getSource Source}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterTransitionImpl#getTarget Target}
    • + *
    • {@link fr.inria.diverse.event.commons.model.scenario.impl.ArbiterTransitionImpl#getName Name}
    • *
    * * @generated */ -public abstract class TransitionImpl

    > extends MinimalEObjectImpl.Container implements Transition { +public class ArbiterTransitionImpl

    > extends MinimalEObjectImpl.Container implements ArbiterTransition { + /** + * The cached value of the '{@link #getGuard() Guard}' containment reference. + * + * + * @see #getGuard() + * @generated + * @ordered + */ + protected P guard; + /** * The cached value of the '{@link #getSource() Source}' reference. * @@ -53,21 +65,31 @@ public abstract class TransitionImpl

    > protected S target; /** - * The cached value of the '{@link #getGuard() Guard}' containment reference. + * The default value of the '{@link #getName() Name}' attribute. * * - * @see #getGuard() + * @see #getName() * @generated * @ordered */ - protected P guard; + 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; /** * * * @generated */ - protected TransitionImpl() { + protected ArbiterTransitionImpl() { super(); } @@ -78,7 +100,50 @@ protected TransitionImpl() { */ @Override protected EClass eStaticClass() { - return ArbiterPackage.Literals.TRANSITION; + return ScenarioPackage.Literals.ARBITER_TRANSITION; + } + + /** + * + * + * @generated + */ + public P getGuard() { + return guard; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGuard(P newGuard, NotificationChain msgs) { + P oldGuard = guard; + guard = newGuard; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER_TRANSITION__GUARD, oldGuard, newGuard); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setGuard(P newGuard) { + if (newGuard != guard) { + NotificationChain msgs = null; + if (guard != null) + msgs = ((InternalEObject)guard).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.ARBITER_TRANSITION__GUARD, null, msgs); + if (newGuard != null) + msgs = ((InternalEObject)newGuard).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.ARBITER_TRANSITION__GUARD, null, msgs); + msgs = basicSetGuard(newGuard, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER_TRANSITION__GUARD, newGuard, newGuard)); } /** @@ -93,7 +158,7 @@ public S getSource() { source = (S)eResolveProxy(oldSource); if (source != oldSource) { if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArbiterPackage.TRANSITION__SOURCE, oldSource, source)); + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScenarioPackage.ARBITER_TRANSITION__SOURCE, oldSource, source)); } } return source; @@ -117,7 +182,7 @@ public NotificationChain basicSetSource(S newSource, NotificationChain msgs) { S oldSource = source; source = newSource; if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__SOURCE, oldSource, newSource); + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER_TRANSITION__SOURCE, oldSource, newSource); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; @@ -132,14 +197,14 @@ public void setSource(S newSource) { if (newSource != source) { NotificationChain msgs = null; if (source != null) - msgs = ((InternalEObject)source).eInverseRemove(this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, State.class, msgs); + msgs = ((InternalEObject)source).eInverseRemove(this, ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS, ArbiterState.class, msgs); if (newSource != null) - msgs = ((InternalEObject)newSource).eInverseAdd(this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, State.class, msgs); + msgs = ((InternalEObject)newSource).eInverseAdd(this, ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS, ArbiterState.class, msgs); msgs = basicSetSource(newSource, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__SOURCE, newSource, newSource)); + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER_TRANSITION__SOURCE, newSource, newSource)); } /** @@ -154,7 +219,7 @@ public S getTarget() { target = (S)eResolveProxy(oldTarget); if (target != oldTarget) { if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArbiterPackage.TRANSITION__TARGET, oldTarget, target)); + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScenarioPackage.ARBITER_TRANSITION__TARGET, oldTarget, target)); } } return target; @@ -178,7 +243,7 @@ public NotificationChain basicSetTarget(S newTarget, NotificationChain msgs) { S oldTarget = target; target = newTarget; if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__TARGET, oldTarget, newTarget); + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER_TRANSITION__TARGET, oldTarget, newTarget); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; @@ -193,14 +258,14 @@ public void setTarget(S newTarget) { if (newTarget != target) { NotificationChain msgs = null; if (target != null) - msgs = ((InternalEObject)target).eInverseRemove(this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, State.class, msgs); + msgs = ((InternalEObject)target).eInverseRemove(this, ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS, ArbiterState.class, msgs); if (newTarget != null) - msgs = ((InternalEObject)newTarget).eInverseAdd(this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, State.class, msgs); + msgs = ((InternalEObject)newTarget).eInverseAdd(this, ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS, ArbiterState.class, msgs); msgs = basicSetTarget(newTarget, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__TARGET, newTarget, newTarget)); + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER_TRANSITION__TARGET, newTarget, newTarget)); } /** @@ -208,9 +273,8 @@ else if (eNotificationRequired()) * * @generated */ - @SuppressWarnings("unchecked") - public P getGuard() { - return guard; + public String getName() { + return name; } /** @@ -218,33 +282,11 @@ public P getGuard() { * * @generated */ - public NotificationChain basicSetGuard(P newGuard, NotificationChain msgs) { - P oldGuard = guard; - guard = newGuard; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__GUARD, oldGuard, newGuard); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setGuard(P newGuard) { - if (newGuard != guard) { - NotificationChain msgs = null; - if (guard != null) - msgs = ((InternalEObject)guard).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ArbiterPackage.TRANSITION__GUARD, null, msgs); - if (newGuard != null) - msgs = ((InternalEObject)newGuard).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ArbiterPackage.TRANSITION__GUARD, null, msgs); - msgs = basicSetGuard(newGuard, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__GUARD, newGuard, newGuard)); + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.ARBITER_TRANSITION__NAME, oldName, name)); } /** @@ -256,13 +298,13 @@ else if (eNotificationRequired()) @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case ArbiterPackage.TRANSITION__SOURCE: + case ScenarioPackage.ARBITER_TRANSITION__SOURCE: if (source != null) - msgs = ((InternalEObject)source).eInverseRemove(this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, State.class, msgs); + msgs = ((InternalEObject)source).eInverseRemove(this, ScenarioPackage.ARBITER_STATE__OUTGOING_TRANSITIONS, ArbiterState.class, msgs); return basicSetSource((S)otherEnd, msgs); - case ArbiterPackage.TRANSITION__TARGET: + case ScenarioPackage.ARBITER_TRANSITION__TARGET: if (target != null) - msgs = ((InternalEObject)target).eInverseRemove(this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, State.class, msgs); + msgs = ((InternalEObject)target).eInverseRemove(this, ScenarioPackage.ARBITER_STATE__INCOMING_TRANSITIONS, ArbiterState.class, msgs); return basicSetTarget((S)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); @@ -276,12 +318,12 @@ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, No @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case ArbiterPackage.TRANSITION__SOURCE: + case ScenarioPackage.ARBITER_TRANSITION__GUARD: + return basicSetGuard(null, msgs); + case ScenarioPackage.ARBITER_TRANSITION__SOURCE: return basicSetSource(null, msgs); - case ArbiterPackage.TRANSITION__TARGET: + case ScenarioPackage.ARBITER_TRANSITION__TARGET: return basicSetTarget(null, msgs); - case ArbiterPackage.TRANSITION__GUARD: - return basicSetGuard(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -294,14 +336,16 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case ArbiterPackage.TRANSITION__SOURCE: + case ScenarioPackage.ARBITER_TRANSITION__GUARD: + return getGuard(); + case ScenarioPackage.ARBITER_TRANSITION__SOURCE: if (resolve) return getSource(); return basicGetSource(); - case ArbiterPackage.TRANSITION__TARGET: + case ScenarioPackage.ARBITER_TRANSITION__TARGET: if (resolve) return getTarget(); return basicGetTarget(); - case ArbiterPackage.TRANSITION__GUARD: - return getGuard(); + case ScenarioPackage.ARBITER_TRANSITION__NAME: + return getName(); } return super.eGet(featureID, resolve, coreType); } @@ -315,14 +359,17 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case ArbiterPackage.TRANSITION__SOURCE: + case ScenarioPackage.ARBITER_TRANSITION__GUARD: + setGuard((P)newValue); + return; + case ScenarioPackage.ARBITER_TRANSITION__SOURCE: setSource((S)newValue); return; - case ArbiterPackage.TRANSITION__TARGET: + case ScenarioPackage.ARBITER_TRANSITION__TARGET: setTarget((S)newValue); return; - case ArbiterPackage.TRANSITION__GUARD: - setGuard((P)newValue); + case ScenarioPackage.ARBITER_TRANSITION__NAME: + setName((String)newValue); return; } super.eSet(featureID, newValue); @@ -336,14 +383,17 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case ArbiterPackage.TRANSITION__SOURCE: + case ScenarioPackage.ARBITER_TRANSITION__GUARD: + setGuard((P)null); + return; + case ScenarioPackage.ARBITER_TRANSITION__SOURCE: setSource((S)null); return; - case ArbiterPackage.TRANSITION__TARGET: + case ScenarioPackage.ARBITER_TRANSITION__TARGET: setTarget((S)null); return; - case ArbiterPackage.TRANSITION__GUARD: - setGuard((P)null); + case ScenarioPackage.ARBITER_TRANSITION__NAME: + setName(NAME_EDEFAULT); return; } super.eUnset(featureID); @@ -357,14 +407,32 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case ArbiterPackage.TRANSITION__SOURCE: + case ScenarioPackage.ARBITER_TRANSITION__GUARD: + return guard != null; + case ScenarioPackage.ARBITER_TRANSITION__SOURCE: return source != null; - case ArbiterPackage.TRANSITION__TARGET: + case ScenarioPackage.ARBITER_TRANSITION__TARGET: return target != null; - case ArbiterPackage.TRANSITION__GUARD: - return guard != null; + case ScenarioPackage.ARBITER_TRANSITION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID); } -} //TransitionImpl + /** + * + * + * @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(); + } + +} //ArbiterTransitionImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFactoryImpl.java index 522db3a74..6511f0271 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFactoryImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioFactoryImpl.java @@ -2,9 +2,11 @@ */ package fr.inria.diverse.event.commons.model.scenario.impl; +import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.scenario.*; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; @@ -56,11 +58,83 @@ public ScenarioFactoryImpl() { @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { + case ScenarioPackage.ARBITER_STATE: return createArbiterState(); + case ScenarioPackage.ARBITER_TRANSITION: return createArbiterTransition(); 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 ScenarioPackage.TRUTH_VALUE: + return createTruthValueFromString(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 ScenarioPackage.TRUTH_VALUE: + return convertTruthValueToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public

    > ArbiterState createArbiterState() { + ArbiterStateImpl arbiterState = new ArbiterStateImpl(); + return arbiterState; + } + + /** + * + * + * @generated + */ + public

    > ArbiterTransition createArbiterTransition() { + ArbiterTransitionImpl arbiterTransition = new ArbiterTransitionImpl(); + return arbiterTransition; + } + + /** + * + * + * @generated + */ + public TruthValue createTruthValueFromString(EDataType eDataType, String initialValue) { + TruthValue result = TruthValue.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertTruthValueToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + /** * * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java index 569334644..3f42f8d49 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/impl/ScenarioPackageImpl.java @@ -5,6 +5,9 @@ import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl; +import fr.inria.diverse.event.commons.model.scenario.Arbiter; +import fr.inria.diverse.event.commons.model.scenario.ArbiterState; +import fr.inria.diverse.event.commons.model.scenario.ArbiterTransition; import fr.inria.diverse.event.commons.model.scenario.ElementProvider; import fr.inria.diverse.event.commons.model.scenario.ElementQuery; import fr.inria.diverse.event.commons.model.scenario.ElementReference; @@ -18,8 +21,10 @@ import fr.inria.diverse.event.commons.model.scenario.ScenarioFactory; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; +import fr.inria.diverse.event.commons.model.scenario.TruthValue; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; import org.eclipse.emf.ecore.EGenericType; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; @@ -104,6 +109,34 @@ public class ScenarioPackageImpl extends EPackageImpl implements ScenarioPackage */ private EClass scenarioFSMTransitionEClass = null; + /** + * + * + * @generated + */ + private EClass arbiterEClass = null; + + /** + * + * + * @generated + */ + private EClass arbiterStateEClass = null; + + /** + * + * + * @generated + */ + private EClass arbiterTransitionEClass = null; + + /** + * + * + * @generated + */ + private EEnum truthValueEEnum = null; + /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package @@ -449,6 +482,159 @@ public EAttribute getScenarioFSMTransition_Name() { return (EAttribute)scenarioFSMTransitionEClass.getEStructuralFeatures().get(3); } + /** + * + * + * @generated + */ + public EClass getArbiter() { + return arbiterEClass; + } + + /** + * + * + * @generated + */ + public EReference getArbiter_States() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getArbiter_Transitions() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getArbiter_InitialState() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EReference getArbiter_AcceptingStates() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + public EAttribute getArbiter_Name() { + return (EAttribute)arbiterEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + public EClass getArbiterState() { + return arbiterStateEClass; + } + + /** + * + * + * @generated + */ + public EReference getArbiterState_IncomingTransitions() { + return (EReference)arbiterStateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getArbiterState_OutgoingTransitions() { + return (EReference)arbiterStateEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getArbiterState_TruthValue() { + return (EAttribute)arbiterStateEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EAttribute getArbiterState_Name() { + return (EAttribute)arbiterStateEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + public EClass getArbiterTransition() { + return arbiterTransitionEClass; + } + + /** + * + * + * @generated + */ + public EReference getArbiterTransition_Guard() { + return (EReference)arbiterTransitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getArbiterTransition_Source() { + return (EReference)arbiterTransitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getArbiterTransition_Target() { + return (EReference)arbiterTransitionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EAttribute getArbiterTransition_Name() { + return (EAttribute)arbiterTransitionEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + public EEnum getTruthValue() { + return truthValueEEnum; + } + /** * * @@ -517,6 +703,28 @@ public void createPackageContents() { createEReference(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__SOURCE); createEReference(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__TARGET); createEAttribute(scenarioFSMTransitionEClass, SCENARIO_FSM_TRANSITION__NAME); + + arbiterEClass = createEClass(ARBITER); + createEReference(arbiterEClass, ARBITER__STATES); + createEReference(arbiterEClass, ARBITER__TRANSITIONS); + createEReference(arbiterEClass, ARBITER__INITIAL_STATE); + createEReference(arbiterEClass, ARBITER__ACCEPTING_STATES); + createEAttribute(arbiterEClass, ARBITER__NAME); + + arbiterStateEClass = createEClass(ARBITER_STATE); + createEReference(arbiterStateEClass, ARBITER_STATE__INCOMING_TRANSITIONS); + createEReference(arbiterStateEClass, ARBITER_STATE__OUTGOING_TRANSITIONS); + createEAttribute(arbiterStateEClass, ARBITER_STATE__TRUTH_VALUE); + createEAttribute(arbiterStateEClass, ARBITER_STATE__NAME); + + arbiterTransitionEClass = createEClass(ARBITER_TRANSITION); + createEReference(arbiterTransitionEClass, ARBITER_TRANSITION__GUARD); + createEReference(arbiterTransitionEClass, ARBITER_TRANSITION__SOURCE); + createEReference(arbiterTransitionEClass, ARBITER_TRANSITION__TARGET); + createEAttribute(arbiterTransitionEClass, ARBITER_TRANSITION__NAME); + + // Create enums + truthValueEEnum = createEEnum(TRUTH_VALUE); } /** @@ -563,6 +771,13 @@ public void initializePackageContents() { ETypeParameter scenarioFSMStateEClass_T = addETypeParameter(scenarioFSMStateEClass, "T"); ETypeParameter scenarioFSMTransitionEClass_P = addETypeParameter(scenarioFSMTransitionEClass, "P"); ETypeParameter scenarioFSMTransitionEClass_S = addETypeParameter(scenarioFSMTransitionEClass, "S"); + ETypeParameter arbiterEClass_P = addETypeParameter(arbiterEClass, "P"); + ETypeParameter arbiterEClass_S = addETypeParameter(arbiterEClass, "S"); + ETypeParameter arbiterEClass_T = addETypeParameter(arbiterEClass, "T"); + ETypeParameter arbiterStateEClass_P = addETypeParameter(arbiterStateEClass, "P"); + ETypeParameter arbiterStateEClass_T = addETypeParameter(arbiterStateEClass, "T"); + ETypeParameter arbiterTransitionEClass_P = addETypeParameter(arbiterTransitionEClass, "P"); + ETypeParameter arbiterTransitionEClass_S = addETypeParameter(arbiterTransitionEClass, "S"); // Set bounds for type parameters EGenericType g1 = createEGenericType(this.getScenarioElement()); @@ -617,6 +832,36 @@ public void initializePackageContents() { g2 = createEGenericType(); g1.getETypeArguments().add(g2); scenarioFSMTransitionEClass_S.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getProperty()); + arbiterEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getArbiterState()); + g2 = createEGenericType(arbiterEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(arbiterEClass_T); + g1.getETypeArguments().add(g2); + arbiterEClass_S.getEBounds().add(g1); + g1 = createEGenericType(this.getArbiterTransition()); + g2 = createEGenericType(arbiterEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(arbiterEClass_S); + g1.getETypeArguments().add(g2); + arbiterEClass_T.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getProperty()); + arbiterStateEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getArbiterTransition()); + g2 = createEGenericType(arbiterStateEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + arbiterStateEClass_T.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getProperty()); + arbiterTransitionEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getArbiterState()); + g2 = createEGenericType(arbiterTransitionEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + arbiterTransitionEClass_S.getEBounds().add(g1); // Add supertypes to classes g1 = createEGenericType(this.getElementProvider()); @@ -699,6 +944,40 @@ public void initializePackageContents() { initEReference(getScenarioFSMTransition_Target(), g1, this.getScenarioFSMState_IncomingTransitions(), "target", null, 1, 1, ScenarioFSMTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getScenarioFSMTransition_Name(), ecorePackage.getEString(), "name", null, 0, 1, ScenarioFSMTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(arbiterEClass, Arbiter.class, "Arbiter", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(arbiterEClass_S); + initEReference(getArbiter_States(), g1, null, "states", null, 0, -1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterEClass_T); + initEReference(getArbiter_Transitions(), g1, null, "transitions", null, 0, -1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterEClass_S); + initEReference(getArbiter_InitialState(), g1, null, "initialState", null, 0, 1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterEClass_S); + initEReference(getArbiter_AcceptingStates(), g1, null, "acceptingStates", null, 0, -1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getArbiter_Name(), ecorePackage.getEString(), "name", null, 0, 1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(arbiterStateEClass, ArbiterState.class, "ArbiterState", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(arbiterStateEClass_T); + initEReference(getArbiterState_IncomingTransitions(), g1, this.getArbiterTransition_Target(), "incomingTransitions", null, 0, -1, ArbiterState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterStateEClass_T); + initEReference(getArbiterState_OutgoingTransitions(), g1, this.getArbiterTransition_Source(), "outgoingTransitions", null, 0, -1, ArbiterState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getArbiterState_TruthValue(), this.getTruthValue(), "truthValue", null, 1, 1, ArbiterState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getArbiterState_Name(), ecorePackage.getEString(), "name", null, 0, 1, ArbiterState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(arbiterTransitionEClass, ArbiterTransition.class, "ArbiterTransition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(arbiterTransitionEClass_P); + initEReference(getArbiterTransition_Guard(), g1, null, "guard", null, 0, 1, ArbiterTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterTransitionEClass_S); + initEReference(getArbiterTransition_Source(), g1, this.getArbiterState_OutgoingTransitions(), "source", null, 1, 1, ArbiterTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterTransitionEClass_S); + initEReference(getArbiterTransition_Target(), g1, this.getArbiterState_IncomingTransitions(), "target", null, 1, 1, ArbiterTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getArbiterTransition_Name(), ecorePackage.getEString(), "name", null, 0, 1, ArbiterTransition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(truthValueEEnum, TruthValue.class, "TruthValue"); + addEEnumLiteral(truthValueEEnum, TruthValue.INCONCLUSIVE); + addEEnumLiteral(truthValueEEnum, TruthValue.TRUE); + addEEnumLiteral(truthValueEEnum, TruthValue.FALSE); + // Create resource createResource(eNS_URI); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java index ab40afcf9..bfea0b019 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioAdapterFactory.java @@ -111,6 +111,18 @@ public

    , S extends ScenarioFSMState return createScenarioFSMTransitionAdapter(); } @Override + public

    , T extends ArbiterTransition> Adapter caseArbiter(Arbiter object) { + return createArbiterAdapter(); + } + @Override + public

    > Adapter caseArbiterState(ArbiterState object) { + return createArbiterStateAdapter(); + } + @Override + public

    > Adapter caseArbiterTransition(ArbiterTransition object) { + return createArbiterTransitionAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -270,6 +282,48 @@ public Adapter createScenarioFSMTransitionAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.Arbiter Arbiter}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.Arbiter + * @generated + */ + public Adapter createArbiterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterState Arbiter State}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.ArbiterState + * @generated + */ + public Adapter createArbiterStateAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.scenario.ArbiterTransition Arbiter Transition}'. + * + * 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 fr.inria.diverse.event.commons.model.scenario.ArbiterTransition + * @generated + */ + public Adapter createArbiterTransitionAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java index a44b0867e..770ef2782 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/scenario/util/ScenarioSwitch.java @@ -133,6 +133,24 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } + case ScenarioPackage.ARBITER: { + Arbiter arbiter = (Arbiter)theEObject; + T1 result = caseArbiter(arbiter); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.ARBITER_STATE: { + ArbiterState arbiterState = (ArbiterState)theEObject; + T1 result = caseArbiterState(arbiterState); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ScenarioPackage.ARBITER_TRANSITION: { + ArbiterTransition arbiterTransition = (ArbiterTransition)theEObject; + T1 result = caseArbiterTransition(arbiterTransition); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -287,6 +305,51 @@ public

    , S extends ScenarioFSMState return null; } + /** + * Returns the result of interpreting the object as an instance of 'Arbiter'. + * + * 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 'Arbiter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    , T extends ArbiterTransition> T1 caseArbiter(Arbiter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Arbiter State'. + * + * 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 'Arbiter State'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    > T1 caseArbiterState(ArbiterState object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Arbiter Transition'. + * + * 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 'Arbiter Transition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    > T1 caseArbiterTransition(ArbiterTransition object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java index 28472def4..5a23a20e7 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine.ui/src/org/gemoc/executionframework/engine/ui/commons/RunConfiguration.java @@ -50,6 +50,8 @@ protected void extractInformation() throws CoreException { _modelInitializationArguments = getAttribute(LAUNCH_INITIALIZATION_ARGUMENTS, ""); String scenarioPath = getAttribute(LAUNCH_SCENARIO_URI, ""); _scenarioURI = scenarioPath.length() > 0 ? URI.createPlatformResourceURI(scenarioPath, true) : null; + String arbiterPath = getAttribute(LAUNCH_ARBITER_URI, ""); + _arbiterURI = arbiterPath.length() > 0 ? URI.createPlatformResourceURI(arbiterPath, true) : null; _melangeQuery = getAttribute(LAUNCH_MELANGE_QUERY, ""); for (EngineAddonSpecificationExtension extension : EngineAddonSpecificationExtensionPoint.getSpecifications()) { diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java index 480781cf2..16e18712d 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java @@ -86,7 +86,7 @@ public final void performInitialize(IExecutionContext executionContext) { if (scenarioURI != null) { eventManagerAddon.loadScenario(scenarioURI, executionContext.getResourceModel().getResourceSet()); } - URI arbiterURI = executionContext.getRunConfiguration().getScenarioURI(); + URI arbiterURI = executionContext.getRunConfiguration().getArbiterURI(); if (arbiterURI != null) { eventManagerAddon.loadArbiter(arbiterURI, executionContext.getResourceModel().getResourceSet()); } From 3d9cecde5c8956a35753e8c2daa84ba8c1ee94f9 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Wed, 14 Jun 2017 11:10:27 +0200 Subject: [PATCH 07/31] [EngineAddon] Add empty default operations to IEngineAddon --- .../api/engine_addon/DefaultEngineAddon.java | 6 +++ .../api/engine_addon/IEngineAddon.java | 44 ++++++++++++------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/engine_addon/DefaultEngineAddon.java b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/engine_addon/DefaultEngineAddon.java index 2c7327a25..68c2f16f1 100644 --- a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/engine_addon/DefaultEngineAddon.java +++ b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/engine_addon/DefaultEngineAddon.java @@ -19,6 +19,12 @@ import fr.inria.diverse.trace.commons.model.trace.Step; +@Deprecated() +/** + * Engine addon with no behavior at all. + * + * @deprecated Use {@link IEngineAddon} directly instead, as all operations have default empty implementations. + */ public class DefaultEngineAddon implements IEngineAddon { @Override diff --git a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java index 72f057020..13e62d855 100644 --- a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java +++ b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/engine_addon/IEngineAddon.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.gemoc.xdsmlframework.api.engine_addon; +import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -23,49 +24,58 @@ public interface IEngineAddon { /** * Operation called before the engine starts */ - public void engineAboutToStart(IExecutionEngine engine); + default public void engineAboutToStart(IExecutionEngine engine) { + }; /** * Operation called after the engine have started */ - public void engineStarted(IExecutionEngine executionEngine); + default public void engineStarted(IExecutionEngine executionEngine) { + }; default public void engineInitialized(IExecutionEngine executionEngine) { - - } - - public void engineAboutToStop(IExecutionEngine engine); + }; + + default public void engineAboutToStop(IExecutionEngine engine) { + }; /** * Operation called after the engine has been stopped */ - public void engineStopped(IExecutionEngine engine); + default public void engineStopped(IExecutionEngine engine) { + }; - /** * Operation before the engine has been disposed (and after the engine has * been stopped) */ - public void engineAboutToDispose(IExecutionEngine engine); + default public void engineAboutToDispose(IExecutionEngine engine) { + }; /** * Operation called before the Step has been chosen */ - public void aboutToSelectStep(IExecutionEngine engine, Collection> steps); + default public void aboutToSelectStep(IExecutionEngine engine, Collection> steps) { + }; - public void proposedStepsChanged(IExecutionEngine engine, Collection> steps); + default public void proposedStepsChanged(IExecutionEngine engine, Collection> steps) { + }; /** * Operation called after the Step has been chosen It also returns the * chosen Step */ - public void stepSelected(IExecutionEngine engine, Step selectedStep); + default public void stepSelected(IExecutionEngine engine, Step selectedStep) { + }; - public void aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute); + default public void aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute) { + }; - public void stepExecuted(IExecutionEngine engine, Step stepExecuted); + default public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { + }; - public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus); + default public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { + }; /** * This operation check the current addon compatibility with elements in @@ -74,6 +84,8 @@ default public void engineInitialized(IExecutionEngine executionEngine) { * @return A list of error messages if the check failed or an empty list * otherwise. */ - public List validate(List otherAddons); + default public List validate(List otherAddons) { + return new ArrayList(); + }; } From 5367ba21911da1422e8e93946dd07f7b1c4e6ae8 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 11:45:47 +0200 Subject: [PATCH 08/31] [AbstractEngine] Add new method startSynchronous without thread --- .../engine/core/AbstractExecutionEngine.java | 67 ++++++++++--------- .../api/core/IExecutionEngine.java | 4 +- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractExecutionEngine.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractExecutionEngine.java index 461e7beb1..78e38c89e 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractExecutionEngine.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractExecutionEngine.java @@ -310,45 +310,50 @@ public final void start() { if (!_started) { _started = true; Runnable r = new Runnable() { - @Override public void run() { - try { - notifyEngineAboutToStart(); - Activator.getDefault().gemocRunningEngineRegistry.registerEngine(getName(), AbstractExecutionEngine.this); - setEngineStatus(EngineStatus.RunStatus.Running); - beforeStart(); - notifyEngineStarted(); - try { - performStart(); - } finally { - // We always try to commit the last remaining - // transaction - commitCurrentTransaction(); - } - - } catch (EngineStoppedException stopException) { - // not really an error, simply print the stop exception - // message - Activator.getDefault().info("Engine stopped by the user : " + stopException.getMessage()); - - } catch (Throwable e) { - error = e; - e.printStackTrace(); - Activator.getDefault().error("Exception received " + e.getMessage() + ", stopping engine.", e); - } finally { - // make sure to notify the stop if this wasn't an - // external call to stop() that lead us here. - // ie. normal end of the mode execution - stop(); - Activator.getDefault().info("*** " + AbstractExecutionEngine.this.getName() + " stopped ***"); - } + startSynchronous(); } }; thread = new Thread(r, engineKindName() + " " + _executionContext.getRunConfiguration().getExecutedModelURI()); thread.start(); } } + + + @Override + public final void startSynchronous() { + try { + notifyEngineAboutToStart(); + Activator.getDefault().gemocRunningEngineRegistry.registerEngine(getName(), AbstractExecutionEngine.this); + setEngineStatus(EngineStatus.RunStatus.Running); + beforeStart(); + notifyEngineStarted(); + try { + performStart(); + } finally { + // We always try to commit the last remaining + // transaction + commitCurrentTransaction(); + } + + } catch (EngineStoppedException stopException) { + // not really an error, simply print the stop exception + // message + Activator.getDefault().info("Engine stopped by the user : " + stopException.getMessage()); + + } catch (Throwable e) { + error = e; + e.printStackTrace(); + Activator.getDefault().error("Exception received " + e.getMessage() + ", stopping engine.", e); + } finally { + // make sure to notify the stop if this wasn't an + // external call to stop() that lead us here. + // ie. normal end of the mode execution + stop(); + Activator.getDefault().info("*** " + AbstractExecutionEngine.this.getName() + " stopped ***"); + } + } @Override public final void stop() { diff --git a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IExecutionEngine.java b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IExecutionEngine.java index 54d4160b8..b14b568b3 100644 --- a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IExecutionEngine.java +++ b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IExecutionEngine.java @@ -44,10 +44,12 @@ public interface IExecutionEngine extends IDisposable { MSEOccurrence getCurrentMSEOccurrence(); /** - * Starts the {@link IExecutionEngine}. + * Starts the {@link IExecutionEngine} in a new thread (non-blocking). */ void start(); + void startSynchronous(); + /** * Asks the engine to stop */ From 47a7be9381b8761dd61e19a7a91d3a2bcb729a35 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 11:54:57 +0200 Subject: [PATCH 09/31] [DefaultModelLoader] Delay the ResourceSet configuration Previously, when Melange was solving a cross-ref of the model, a Melange query was always added to the URI of the cross-ref although Melange needed to access to the resource without any query. This PR delays the configuration of the ResourceSet with the XMLURIHandler and the MelangeURIConverter, until after the model was entirely loaded, which includes the MelangeResource creation, and avoids the aforementioned problem. --- .../modelloader/DefaultModelLoader.java | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.extensions.sirius/src/org/gemoc/executionframework/extensions/sirius/modelloader/DefaultModelLoader.java b/framework/execution_framework/plugins/org.gemoc.executionframework.extensions.sirius/src/org/gemoc/executionframework/extensions/sirius/modelloader/DefaultModelLoader.java index 5e55a0517..a702dc96c 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.extensions.sirius/src/org/gemoc/executionframework/extensions/sirius/modelloader/DefaultModelLoader.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.extensions.sirius/src/org/gemoc/executionframework/extensions/sirius/modelloader/DefaultModelLoader.java @@ -92,7 +92,7 @@ */ @SuppressWarnings("restriction") public class DefaultModelLoader implements IModelLoader { - + IProgressMonitor progressMonitor; @Override @@ -156,7 +156,7 @@ private static Resource loadModel(IExecutionContext context, boolean withAnimati modelURI = context.getRunConfiguration().getExecutedModelURI(); } HashMap nsURIMapping = getnsURIMapping(context); - ResourceSet resourceSet = createAndConfigureResourceSet(modelURI, nsURIMapping, subMonitor); + ResourceSet resourceSet = createResourceSet(modelURI, nsURIMapping, subMonitor); // If there is animation, we ask sirius to create the resource if (withAnimation && context.getRunConfiguration().getAnimatorURI() != null) { @@ -165,7 +165,7 @@ private static Resource loadModel(IExecutionContext context, boolean withAnimati // Killing + restarting Sirius session for animation killPreviousSiriusSession(context.getRunConfiguration().getAnimatorURI()); openNewSiriusSession(context, context.getRunConfiguration().getAnimatorURI(), resourceSet, modelURI, - subMonitor); + subMonitor,nsURIMapping); // At this point Sirius has loaded the model, we just need to // find it @@ -182,13 +182,7 @@ private static Resource loadModel(IExecutionContext context, boolean withAnimati // If there is no animation, we create a resource ourselves else { - Resource resource = resourceSet.createResource(modelURI); - try { - resource.load(null); - } catch (IOException e) { - new RuntimeException("The model could not be loaded.", e); - } - return resource; + return loadModelThenConfigureResourceSet(resourceSet, modelURI, nsURIMapping, subMonitor); } } @@ -231,14 +225,14 @@ public void run() { } private static Session openNewSiriusSession(final IExecutionContext context, URI sessionResourceURI, ResourceSet rs, - URI modelURI, SubMonitor subMonitor) throws CoreException { + URI modelURI, SubMonitor subMonitor, HashMap nsURIMapping) throws CoreException { subMonitor.subTask("Loading model"); subMonitor.newChild(3); // load model resource and resolve all proxies - Resource r = rs.getResource(modelURI, true); - EcoreUtil.resolveAll(rs); + + Resource r = loadModelThenConfigureResourceSet(rs, modelURI, nsURIMapping, subMonitor); // force adaptee model resource in the main ResourceSet if (r instanceof MelangeResourceImpl) { @@ -373,13 +367,31 @@ protected void doExecute() { return session; } - private static ResourceSet createAndConfigureResourceSet(URI modelURI, HashMap nsURIMapping, + private static ResourceSet createResourceSet(URI modelURI, HashMap nsURIMapping, + SubMonitor subMonitor) { + + final ResourceSet rs = ResourceSetFactory.createFactory().createResourceSet(modelURI); + + return rs; + } + + private static Resource loadModelThenConfigureResourceSet(ResourceSet rs, URI modelURI, HashMap nsURIMapping, + SubMonitor subMonitor) { + + Resource resource = rs.getResource(modelURI, true); + EcoreUtil.resolveAll(rs); + configureResourceSet(rs,modelURI,nsURIMapping,subMonitor); + + return resource; + + } + + private static void configureResourceSet(ResourceSet rs, URI modelURI, HashMap nsURIMapping, SubMonitor subMonitor) { subMonitor.subTask("Configuring ResourceSet"); subMonitor.newChild(1); - final ResourceSet rs = ResourceSetFactory.createFactory().createResourceSet(modelURI); final String fileExtension = modelURI.fileExtension(); // indicates which melange query should be added to the xml uri handler // for a given extension @@ -393,7 +405,6 @@ private static ResourceSet createAndConfigureResourceSet(URI modelURI, HashMap Date: Mon, 17 Jul 2017 12:05:02 +0200 Subject: [PATCH 10/31] [TestRunConfiguration] Automatically compute melange query --- .../test/lib/impl/TestRunConfiguration.xtend | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestRunConfiguration.xtend b/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestRunConfiguration.xtend index 67c05bf63..82979147b 100644 --- a/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestRunConfiguration.xtend +++ b/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestRunConfiguration.xtend @@ -69,7 +69,10 @@ class TestRunConfiguration implements IRunConfiguration { } override getMelangeQuery() { - model.melangeQuery + if (model.melangeQuery == null) + "?lang=" + languageName + else + model.melangeQuery } override getBreakStart() { From 1f746da46792cdd44d891fc50a071f2ab3ee710d Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 12:06:08 +0200 Subject: [PATCH 11/31] [tests] Move tests results in class + move asserts out --- .../META-INF/MANIFEST.MF | 3 +- .../test/lib/impl/TestEngineAddon.xtend | 61 ++++-------- .../test/lib/impl/TestHelper.xtend | 94 ++++++++++++++----- .../JavaEngineTests.launch | 4 +- 4 files changed, 94 insertions(+), 68 deletions(-) diff --git a/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/META-INF/MANIFEST.MF b/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/META-INF/MANIFEST.MF index 142138e5b..9174a549b 100644 --- a/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/META-INF/MANIFEST.MF +++ b/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/META-INF/MANIFEST.MF @@ -16,7 +16,8 @@ Require-Bundle: com.google.guava, org.eclipse.swt;bundle-version="3.105.3", org.eclipse.ui;bundle-version="3.108.1", fr.inria.diverse.trace.gemoc;bundle-version="2.3.0", - org.gemoc.executionframework.engine;bundle-version="2.3.0" + org.gemoc.executionframework.engine;bundle-version="2.3.0", + fr.inria.diverse.trace.gemoc.api;bundle-version="2.3.0" Export-Package: org.gemoc.executionframework.test.lib, org.gemoc.executionframework.test.lib.impl diff --git a/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestEngineAddon.xtend b/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestEngineAddon.xtend index d4e87d1c1..ba56e5309 100644 --- a/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestEngineAddon.xtend +++ b/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestEngineAddon.xtend @@ -1,77 +1,52 @@ package org.gemoc.executionframework.test.lib.impl -import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon -import org.gemoc.xdsmlframework.api.core.IExecutionEngine import fr.inria.diverse.trace.commons.model.trace.Step -import java.util.Collection -import org.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus -import java.util.List +import org.gemoc.executionframework.test.lib.impl.TestHelper.TestResult +import org.gemoc.xdsmlframework.api.core.IExecutionEngine +import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon import org.eclipse.xtend.lib.annotations.Accessors class TestEngineAddon implements IEngineAddon { - @Accessors(PRIVATE_SETTER,PUBLIC_GETTER) - var int amountOfStepsExecuted = 0 - @Accessors(PRIVATE_SETTER,PUBLIC_GETTER) - var boolean engineAboutToStart = false - @Accessors(PRIVATE_SETTER,PUBLIC_GETTER) - var boolean engineAboutToStop = false - @Accessors(PRIVATE_SETTER,PUBLIC_GETTER) - var boolean engineStarted = false - @Accessors(PRIVATE_SETTER,PUBLIC_GETTER) - var boolean engineStopped = false - @Accessors(PRIVATE_SETTER,PUBLIC_GETTER) - var boolean engineAboutToDispose = false - val int shouldStopAfter + var long timeStart + + @Accessors(PRIVATE_SETTER,PUBLIC_GETTER) + val TestResult testResult new(int shouldStopAfter) { this.shouldStopAfter = shouldStopAfter - } - - override aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute) { - } - - override aboutToSelectStep(IExecutionEngine engine, Collection> steps) { + this.testResult = new TestResult } override engineAboutToDispose(IExecutionEngine engine) { - engineAboutToDispose = true + testResult.engineAboutToDispose = true } override engineAboutToStart(IExecutionEngine engine) { - engineAboutToStart = true + testResult.engineAboutToStart = true } override engineAboutToStop(IExecutionEngine engine) { - engineAboutToStop = true + testResult.engineAboutToStop = true + val timeEnd = System.nanoTime + testResult.executionDuration = timeEnd - timeStart } override engineStarted(IExecutionEngine executionEngine) { - engineStarted = true - } - - override engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { + testResult.engineStarted = true + timeStart = System.nanoTime } override engineStopped(IExecutionEngine engine) { - engineStopped = true - } - - override proposedStepsChanged(IExecutionEngine engine, Collection> steps) { + testResult.engineStopped = true } override stepExecuted(IExecutionEngine engine, Step stepExecuted) { - amountOfStepsExecuted++ - if (shouldStopAfter != -1 && shouldStopAfter < amountOfStepsExecuted) { + testResult.amountOfStepsExecuted++ + if (shouldStopAfter != -1 && shouldStopAfter < testResult.amountOfStepsExecuted) { engine.stop } } - override stepSelected(IExecutionEngine engine, Step selectedStep) { - } - - override validate(List otherAddons) { - } - } diff --git a/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestHelper.xtend b/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestHelper.xtend index f65906331..2643c5280 100644 --- a/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestHelper.xtend +++ b/framework/execution_framework/tests/org.gemoc.executionframework.test.lib/src/org/gemoc/executionframework/test/lib/impl/TestHelper.xtend @@ -1,8 +1,12 @@ package org.gemoc.executionframework.test.lib.impl +import fr.inria.diverse.trace.commons.model.trace.Trace +import fr.inria.diverse.trace.gemoc.api.IMultiDimensionalTraceAddon +import fr.inria.diverse.trace.gemoc.traceaddon.GenericTraceEngineAddon import java.io.File import java.io.PrintWriter import java.io.StringWriter +import java.util.HashSet import java.util.Random import java.util.Set import org.eclipse.core.resources.IFile @@ -14,16 +18,28 @@ import org.eclipse.emf.common.util.URI import org.gemoc.executionframework.test.lib.IEngineWrapper import org.gemoc.executionframework.test.lib.IExecutableModel import org.gemoc.executionframework.test.lib.ILanguageWrapper +import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon import static org.junit.Assert.* class TestHelper { - private static def testInternal(IProgressMonitor m, IEngineWrapper engine, ILanguageWrapper language, - Set addons, IExecutableModel model) { + static class TestResult { + public var long executionDuration + public var Trace trace + public var int amountOfStepsExecuted = 0 + public var boolean engineAboutToStart = false + public var boolean engineAboutToStop = false + public var boolean engineStarted = false + public var boolean engineStopped = false + public var boolean engineAboutToDispose = false + } + private static def testInternal(IProgressMonitor m, IEngineWrapper engine, ILanguageWrapper language, + Set addons, Set otherAddons, IExecutableModel model, boolean cleanup) { // Create eclipse project in test WS - val eclipseProject = ResourcesPlugin::getWorkspace().getRoot().getProject(Math::abs(new Random().nextInt).toString); + val eclipseProject = ResourcesPlugin::getWorkspace().getRoot().getProject( + Math::abs(new Random().nextInt).toString); if (eclipseProject.exists) eclipseProject.delete(true, m) eclipseProject.create(m) @@ -41,37 +57,42 @@ class TestHelper { val TestEngineAddon testAddon = new TestEngineAddon(model.shouldStopAfter) engine.prepare(language, model, addons, modelURI) engine.realEngine.executionContext.executionPlatform.addEngineAddon(testAddon) + for (otherAddon : otherAddons) { + engine.realEngine.executionContext.executionPlatform.addEngineAddon(otherAddon) + } // Execute engine engine.run - + // Dispose engine engine.realEngine.dispose - + // Generic oracle using test addon - assertTrue("No steps were executed", testAddon.amountOfStepsExecuted > 0) - assertTrue("engineAboutToStart never performed", testAddon.engineAboutToStart) - assertTrue("engineStarted never performed", testAddon.engineStarted) - assertTrue("engineAboutToStop never performed", testAddon.engineAboutToStop) - assertTrue("engineStopped never performed", testAddon.engineStopped) - assertTrue("engineAboutToDispose never performed", testAddon.engineAboutToDispose) - - // Done - return Status.OK_STATUS + val testResult = testAddon.testResult +// genericAsserts(testResult) + if (cleanup) { + eclipseProject.delete(true, true, m) + } + + // Return + return testResult } - def static void testWithAddons(IEngineWrapper engine, ILanguageWrapper language, Set addons, - IExecutableModel model) { + def static testWithJob(IEngineWrapper engine, ILanguageWrapper language, Set addons, + Set otherAddons, IExecutableModel model, boolean cleanup) { + val Set out = new HashSet val job = new Job("single test case") { override protected run(IProgressMonitor m) { try { - return testInternal(m, engine, language, addons, model) + val testResult = testInternal(m, engine, language, addons, otherAddons, model, cleanup) + out.add(testResult) + return Status.OK_STATUS } catch (Throwable t) { t.printStackTrace val StringWriter sw = new StringWriter(); t.printStackTrace(new PrintWriter(sw)); - val errorStatus = new Status(Status.ERROR, "trace test", "An error occured in the test case", t) + val errorStatus = new Status(Status.ERROR, "test", "An error occured in the test case", t) return errorStatus } } @@ -81,14 +102,43 @@ class TestHelper { if (job.result != null && job.result.exception != null) { throw job.result.exception } + return out.head } - def static void testWithGenericTrace(IEngineWrapper engine, ILanguageWrapper language, IExecutableModel model) { - testWithAddons(engine, language, #{"Generic MultiDimensional Trace"}, model) + def static testWithGenericTrace(IEngineWrapper engine, ILanguageWrapper language, IExecutableModel model, + boolean cleanup) { + val IMultiDimensionalTraceAddon traceAddon = new GenericTraceEngineAddon() + val testResult = testWithJob(engine, language, #{}, #{traceAddon}, model, cleanup) + testResult.trace = traceAddon.trace + return testResult + } + + def static testWithGenericTrace(IEngineWrapper engine, ILanguageWrapper language, IExecutableModel model) { + testWithGenericTrace(engine, language, model, false) + } + + def static testWithoutExtraAddons(IEngineWrapper engine, ILanguageWrapper language, IExecutableModel model, + boolean cleanup) { + return testWithJob(engine, language, #{}, #{}, model, cleanup) + } + + def static testWithoutExtraAddons(IEngineWrapper engine, ILanguageWrapper language, IExecutableModel model) { + return testWithoutExtraAddons(engine, language, model, false) + } + + def static testNoAssert(IEngineWrapper engine, ILanguageWrapper language, IExecutableModel model, boolean cleanup) { + val res = testWithJob(engine, language, #{}, #{}, model, cleanup) + + return res } - def static void testWithoutExtraAddons(IEngineWrapper engine, ILanguageWrapper language, IExecutableModel model) { - testWithAddons(engine, language, #{}, model) + public def static genericAsserts(TestResult testResult) { + assertTrue("No steps were executed", testResult.amountOfStepsExecuted > 0) + assertTrue("engineAboutToStart never performed", testResult.engineAboutToStart) + assertTrue("engineStarted never performed", testResult.engineStarted) + assertTrue("engineAboutToStop never performed", testResult.engineAboutToStop) + assertTrue("engineStopped never performed", testResult.engineStopped) + assertTrue("engineAboutToDispose never performed", testResult.engineAboutToDispose) } } diff --git a/java_execution/java_engine/tests/org.gemoc.execution.sequential.javaengine.tests/JavaEngineTests.launch b/java_execution/java_engine/tests/org.gemoc.execution.sequential.javaengine.tests/JavaEngineTests.launch index 462477f8c..a7288fa7d 100644 --- a/java_execution/java_engine/tests/org.gemoc.execution.sequential.javaengine.tests/JavaEngineTests.launch +++ b/java_execution/java_engine/tests/org.gemoc.execution.sequential.javaengine.tests/JavaEngineTests.launch @@ -14,10 +14,10 @@ - + - + From 83d359b5adb4cc6282f719d85e3d6e7cb0fcdacb Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 12:11:28 +0200 Subject: [PATCH 12/31] [TraceAddon] Add 'getTrace' public operation --- .../api/IMultiDimensionalTraceAddon.java | 3 + .../gemoc/traceaddon/AbstractTraceAddon.xtend | 60 ++++++++++++------- 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/trace/commons/plugins/fr.inria.diverse.trace.gemoc.api/src/fr/inria/diverse/trace/gemoc/api/IMultiDimensionalTraceAddon.java b/trace/commons/plugins/fr.inria.diverse.trace.gemoc.api/src/fr/inria/diverse/trace/gemoc/api/IMultiDimensionalTraceAddon.java index b4037783d..2c3c408b3 100644 --- a/trace/commons/plugins/fr.inria.diverse.trace.gemoc.api/src/fr/inria/diverse/trace/gemoc/api/IMultiDimensionalTraceAddon.java +++ b/trace/commons/plugins/fr.inria.diverse.trace.gemoc.api/src/fr/inria/diverse/trace/gemoc/api/IMultiDimensionalTraceAddon.java @@ -17,6 +17,7 @@ import fr.inria.diverse.trace.commons.model.trace.Dimension; import fr.inria.diverse.trace.commons.model.trace.State; import fr.inria.diverse.trace.commons.model.trace.Step; +import fr.inria.diverse.trace.commons.model.trace.Trace; import fr.inria.diverse.trace.commons.model.trace.TracedObject; import fr.inria.diverse.trace.commons.model.trace.Value; @@ -35,4 +36,6 @@ public interface IMultiDimensionalTraceAddon, StateS void load(Resource traceResource); boolean isAddonForTrace(EObject traceRoot); + + Trace getTrace(); } diff --git a/trace/generator/plugins/fr.inria.diverse.trace.gemoc/src/fr/inria/diverse/trace/gemoc/traceaddon/AbstractTraceAddon.xtend b/trace/generator/plugins/fr.inria.diverse.trace.gemoc/src/fr/inria/diverse/trace/gemoc/traceaddon/AbstractTraceAddon.xtend index 70f6e9e10..4aaf97bed 100644 --- a/trace/generator/plugins/fr.inria.diverse.trace.gemoc/src/fr/inria/diverse/trace/gemoc/traceaddon/AbstractTraceAddon.xtend +++ b/trace/generator/plugins/fr.inria.diverse.trace.gemoc/src/fr/inria/diverse/trace/gemoc/traceaddon/AbstractTraceAddon.xtend @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Inria - initial API and implementation *******************************************************************************/ @@ -12,7 +12,14 @@ package fr.inria.diverse.trace.gemoc.traceaddon import com.google.common.collect.BiMap import com.google.common.collect.HashBiMap +import fr.inria.diverse.melange.resource.MelangeResource +import fr.inria.diverse.trace.commons.model.generictrace.GenericDimension +import fr.inria.diverse.trace.commons.model.generictrace.GenericTracedObject +import fr.inria.diverse.trace.commons.model.generictrace.ManyReferenceValue +import fr.inria.diverse.trace.commons.model.generictrace.SingleReferenceValue import fr.inria.diverse.trace.commons.model.trace.Dimension +import fr.inria.diverse.trace.commons.model.trace.GenericMSE +import fr.inria.diverse.trace.commons.model.trace.MSEModel import fr.inria.diverse.trace.commons.model.trace.State import fr.inria.diverse.trace.commons.model.trace.Step import fr.inria.diverse.trace.commons.model.trace.Trace @@ -46,21 +53,23 @@ import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon import org.gemoc.xdsmlframework.api.engine_addon.modelchangelistener.BatchModelChangeListener import org.gemoc.xdsmlframework.api.extensions.engine_addon.EngineAddonSpecificationExtensionPoint -abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDimensionalTraceAddon, State, TracedObject, Dimension, Value> { +abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDimensionalTraceAddon, State, TracedObject, Dimension, Value> { private IExecutionContext _executionContext - private ITraceExplorer, State, TracedObject, Dimension, Value> traceExplorer - private ITraceExtractor, State, TracedObject, Dimension, Value> traceExtractor + private ITraceExplorer, State, TracedObject, Dimension, Value> traceExplorer + private ITraceExtractor, State, TracedObject, Dimension, Value> traceExtractor private ITraceConstructor traceConstructor private ITraceNotifier traceNotifier private BatchModelChangeListener traceListener - private boolean shouldSave = true private var boolean needTransaction = true private BatchModelChangeListener listenerAddon - - protected abstract def ITraceConstructor constructTraceConstructor(Resource modelResource, Resource traceResource, Map> exeToTraced) - - protected abstract def IStateManager> constructStateManager(Resource modelResource, Map, EObject> tracedToExe) + private Trace, TracedObject, State> trace + + protected abstract def ITraceConstructor constructTraceConstructor(Resource modelResource, Resource traceResource, + Map> exeToTraced) + + protected abstract def IStateManager> constructStateManager(Resource modelResource, + Map, EObject> tracedToExe) override getTraceExplorer() { return traceExplorer @@ -73,15 +82,15 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi override getTraceExtractor() { return traceExtractor } - + override getTraceNotifier() { return traceNotifier } - + public override void load(Resource traceResource) { val root = traceResource.contents.head - if (root instanceof Trace) { - val trace = root as Trace,TracedObject,State> + if (root instanceof Trace) { + trace = root as Trace, TracedObject, State> traceExplorer = new GenericTraceExplorer(trace) traceExtractor = new GenericTraceExtractor(trace) } else { @@ -111,13 +120,13 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi if (step != null) { modifyTrace([ traceConstructor.addState(listenerAddon.getChanges(this)) - + if (add) { traceConstructor.addStep(step) } else { traceConstructor.endStep(step) } - + // Updating the trace extractor and explorer with the last changes traceNotifier.notifyListener(traceExtractor) traceNotifier.notifyListener(traceExplorer) @@ -127,9 +136,10 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi traceExplorer.updateCallStack(step) ]) - if (shouldSave) { -// traceConstructor.save() - } + /*try { + traceConstructor.save() + } catch (Throwable t) { + }*/ } } @@ -155,7 +165,8 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi val Resource traceResource = rs.createResource(traceModelURI) // We construct a new listener addon if required - this.listenerAddon = new BatchModelChangeListener(EMFResource.getRelatedResources(engine.executionContext.resourceModel)) + this.listenerAddon = new BatchModelChangeListener( + EMFResource.getRelatedResources(engine.executionContext.resourceModel)) listenerAddon.registerObserver(this) val launchConfiguration = engine.extractLaunchConfiguration @@ -170,8 +181,8 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi // And we enable trace exploration by loading it in a new trace explorer val root = traceResource.contents.head - if (root instanceof Trace) { - val trace = root as Trace,TracedObject,State> + if (root instanceof Trace) { + trace = root as Trace, TracedObject, State> val stateManager = constructStateManager(modelResource, exeToTraced.inverse) traceExplorer = new GenericTraceExplorer(trace, stateManager) traceExtractor = new GenericTraceExtractor(trace) @@ -235,4 +246,11 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi return errors } + override getTrace() { + return trace + } + + override engineStopped(IExecutionEngine engine) { + } + } From fa44011a8ae80ba444a6eacdf234a177284be88d Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 12:12:02 +0200 Subject: [PATCH 13/31] [EMFCompareUtil] Make it usable without assertions --- .../diverse/trace/commons/EMFCompareUtil.xtend | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/trace/commons/plugins/fr.inria.diverse.trace.commons/src/fr/inria/diverse/trace/commons/EMFCompareUtil.xtend b/trace/commons/plugins/fr.inria.diverse.trace.commons/src/fr/inria/diverse/trace/commons/EMFCompareUtil.xtend index 6c9f21095..c930325a7 100644 --- a/trace/commons/plugins/fr.inria.diverse.trace.commons/src/fr/inria/diverse/trace/commons/EMFCompareUtil.xtend +++ b/trace/commons/plugins/fr.inria.diverse.trace.commons/src/fr/inria/diverse/trace/commons/EMFCompareUtil.xtend @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Inria - initial API and implementation *******************************************************************************/ @@ -22,22 +22,27 @@ import static org.junit.Assert.* class EMFCompareUtil { - public def static void assertEqualsEMF(String message, EObject rootCurrent, EObject rootExpected) { - val DefaultComparisonScope _defaultComparisonScope = new DefaultComparisonScope(rootCurrent, rootExpected, null); + public def static List compare(EObject rootCurrent, EObject rootExpected) { + val DefaultComparisonScope _defaultComparisonScope = new DefaultComparisonScope(rootCurrent, rootExpected, + null); val IComparisonScope scope = _defaultComparisonScope; val _builder = EMFCompare.builder(); val EMFCompare _build = _builder.build(); val Comparison comparison = _build.compare(scope); - val List differences = comparison.getDifferences(); + return comparison.differences + + } + + public def static void assertEqualsEMF(String message, EObject rootCurrent, EObject rootExpected) { + val List differences = compare(rootCurrent, rootExpected); for (d : differences) { val String _string = d.toString(); val String _plus = ("Checking:[" + _string); val String _plus_1 = (_plus + "]"); val DifferenceKind _kind = d.getKind(); println(_plus_1) - assertEquals(message+" - "+_plus_1, DifferenceKind.MOVE, _kind); + assertEquals(message + " - " + _plus_1, DifferenceKind.MOVE, _kind); } - } } From d8982a50c679cca10ee9d08d8d68c1742cf4fad5 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 12:34:45 +0200 Subject: [PATCH 14/31] Remove files added by mistake when merging --- .../engine/core/AbstractExecutionEngine.java | 559 ------------------ .../api/core/IExecutionEngine.java | 129 ---- 2 files changed, 688 deletions(-) delete mode 100644 framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractExecutionEngine.java delete mode 100644 framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IExecutionEngine.java diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractExecutionEngine.java b/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractExecutionEngine.java deleted file mode 100644 index 78e38c89e..000000000 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.engine/src/org/gemoc/executionframework/engine/core/AbstractExecutionEngine.java +++ /dev/null @@ -1,559 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016 Inria 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: - * Inria - initial API and implementation - *******************************************************************************/ -package org.gemoc.executionframework.engine.core; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayDeque; -import java.util.Deque; -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.RollbackException; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.transaction.impl.EMFCommandTransaction; -import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; -import org.gemoc.executionframework.engine.Activator; -import org.gemoc.xdsmlframework.api.core.EngineStatus; -import org.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; -import org.gemoc.xdsmlframework.api.core.IDisposable; -import org.gemoc.xdsmlframework.api.core.IExecutionContext; -import org.gemoc.xdsmlframework.api.core.IExecutionEngine; -import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; - -import fr.inria.diverse.trace.commons.model.trace.MSEOccurrence; -import fr.inria.diverse.trace.commons.model.trace.Step; - - - -/** - * Common implementation of {@link IExecutionEngine}. - * It provides the following services: - *

      - *
    • a basic implementation of the notification for the engine addons ({@link IEngineAddon}).
    • - *
    • registration into the engine registry.
    • - *
    • basic step service (with transaction)
    • - *
    - * This class is intended to be subclassed. - * @author Didier Vojtisek - * - */ -public abstract class AbstractExecutionEngine implements IExecutionEngine, IDisposable { - - private RunStatus _runningStatus = RunStatus.Initializing; - - protected EngineStatus engineStatus = new EngineStatus(); - - protected IExecutionContext _executionContext; - - protected boolean _started = false; - protected boolean _isStopped = false; - - public Thread thread; - public boolean stopOnAddonError = false; - public Throwable error = null; - protected InternalTransactionalEditingDomain editingDomain; - private EMFCommandTransaction currentTransaction; - private Deque> currentSteps = new ArrayDeque<>(); - - abstract protected void performStart(); - - abstract protected void performStop(); - - abstract protected void performInitialize(IExecutionContext executionContext); - - abstract protected void beforeStart(); - - abstract protected void finishDispose(); - - @Override - public final void initialize(IExecutionContext executionContext) { - if (executionContext == null) - throw new IllegalArgumentException("executionContext"); - _executionContext = executionContext; - this.editingDomain = getEditingDomain(executionContext.getResourceModel().getResourceSet()); - setEngineStatus(EngineStatus.RunStatus.Initializing); - performInitialize(executionContext); - }; - - /* - * (non-Javadoc) - * - * @see org.gemoc.executionframework.engine.core.IExecutionEngine# - * getExecutionContext() - */ - @Override - public final IExecutionContext getExecutionContext() { - return _executionContext; - } - - /* - * (non-Javadoc) - * - * @see - * org.gemoc.executionframework.engine.core.IExecutionEngine#getEngineStatus - * () - */ - @Override - public final EngineStatus getEngineStatus() { - return engineStatus; - } - - @Override - public final void dispose() { - - try { - stop(); - notifyEngineAboutToDispose(); - getExecutionContext().dispose(); - finishDispose(); - } finally { - Activator.getDefault().gemocRunningEngineRegistry.unregisterEngine(getName()); - } - } - - - - - public String getName() { - return engineKindName() + " " + _executionContext.getRunConfiguration().getExecutedModelURI(); - } - - private void addonError(IEngineAddon addon, Exception e) { - StringWriter sw = new StringWriter(); - e.printStackTrace(new PrintWriter(sw)); - String exceptionAsString = sw.toString(); - Activator.getDefault().error("Exception in Addon (" + addon + "), " + exceptionAsString, e); - if (stopOnAddonError) { - throw new RuntimeException(e); - } - } - - protected void notifyEngineAboutToStart() { - for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - try { - addon.engineAboutToStart(this); - } catch (Exception e) { - addonError(addon, e); - } - } - } - - protected void notifyEngineStarted() { - for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - try { - addon.engineStarted(this); - } catch (Exception e) { - addonError(addon, e); - } - } - } - - protected void notifyEngineInitialized() { - for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - try { - addon.engineInitialized(this); - } catch (Exception e) { - addonError(addon, e); - } - } - } - - protected final void notifyAboutToStop() { - for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - try { - addon.engineAboutToStop(this); - } catch (Exception e) { - addonError(addon, e); - } - } - } - - protected final void notifyEngineStopped() { - for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - try { - addon.engineStopped(this); - } catch (Exception e) { - addonError(addon, e); - } - } - } - - protected final void notifyEngineAboutToDispose() { - for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - try { - addon.engineAboutToDispose(this); - } catch (Exception e) { - addonError(addon, e); - } - } - } - - protected void notifyEngineStatusChanged(RunStatus newStatus) { - for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - try { - addon.engineStatusChanged(this, newStatus); - } catch (Exception e) { - addonError(addon, e); - } - } - } - - protected void notifyAboutToExecuteLogicalStep(Step l) { - for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - try { - addon.aboutToExecuteStep(this, l); - } catch (EngineStoppedException ese) { - Activator.getDefault().debug("Addon (" + addon.getClass().getSimpleName() + "@" + addon.hashCode() + ") has received stop command with message : " + ese.getMessage()); - stop(); - throw ese; // do not continue to execute anything, forward - // exception - } catch (Exception e) { - addonError(addon, e); - } - } - } - - protected void notifyLogicalStepExecuted(Step l) { - for (IEngineAddon addon : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - try { - addon.stepExecuted(this, l); - } catch (EngineStoppedException ese) { - Activator.getDefault().debug("Addon (" + addon.getClass().getSimpleName() + "@" + addon.hashCode() + ") has received stop command with message : " + ese.getMessage()); - stop(); - } catch (Exception e) { - addonError(addon, e); - } - } - } - - /* - * (non-Javadoc) - * - * @see - * org.gemoc.executionframework.engine.core.IExecutionEngine#hasAddon(java. - * lang.Class) - */ - @Override - public final boolean hasAddon(Class type) { - for (IEngineAddon c : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - if (c.getClass().equals(type)) - return true; - } - return false; - } - - /* - * (non-Javadoc) - * - * @see - * org.gemoc.executionframework.engine.core.IExecutionEngine#getAddon(java. - * lang.Class) - */ - @SuppressWarnings("unchecked") - @Override - public final T getAddon(Class type) { - for (IEngineAddon c : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - if (c.getClass().equals(type)) - return (T) c; - } - return null; - } - - /* - * (non-Javadoc) - * - * @see org.gemoc.executionframework.engine.core.IExecutionEngine# - * getAddonsTypedBy(java.lang.Class) - */ - @SuppressWarnings("unchecked") - @Override - public final Set getAddonsTypedBy(Class type) { - Set result = new HashSet(); - for (IEngineAddon c : getExecutionContext().getExecutionPlatform().getEngineAddons()) { - if (type.isAssignableFrom(c.getClass())) - result.add((T) c); - } - return result; - } - - public final void setEngineStatus(RunStatus newStatus) { - _runningStatus = newStatus; - notifyEngineStatusChanged(newStatus); - } - - @Override - public final RunStatus getRunningStatus() { - return _runningStatus; - } - - public final void joinThread() { - try { - thread.join(); - } catch (InterruptedException e) { - Activator.getDefault().warn("InterruptedException received", e); - } - } - - @Override - public final void start() { - if (!_started) { - _started = true; - Runnable r = new Runnable() { - @Override - public void run() { - startSynchronous(); - } - }; - thread = new Thread(r, engineKindName() + " " + _executionContext.getRunConfiguration().getExecutedModelURI()); - thread.start(); - } - } - - - @Override - public final void startSynchronous() { - try { - notifyEngineAboutToStart(); - Activator.getDefault().gemocRunningEngineRegistry.registerEngine(getName(), AbstractExecutionEngine.this); - setEngineStatus(EngineStatus.RunStatus.Running); - beforeStart(); - notifyEngineStarted(); - try { - performStart(); - } finally { - // We always try to commit the last remaining - // transaction - commitCurrentTransaction(); - } - - } catch (EngineStoppedException stopException) { - // not really an error, simply print the stop exception - // message - Activator.getDefault().info("Engine stopped by the user : " + stopException.getMessage()); - - } catch (Throwable e) { - error = e; - e.printStackTrace(); - Activator.getDefault().error("Exception received " + e.getMessage() + ", stopping engine.", e); - } finally { - // make sure to notify the stop if this wasn't an - // external call to stop() that lead us here. - // ie. normal end of the mode execution - stop(); - Activator.getDefault().info("*** " + AbstractExecutionEngine.this.getName() + " stopped ***"); - } - } - - @Override - public final void stop() { - if (!_isStopped) { - notifyAboutToStop(); - _isStopped = true; - performStop(); - setEngineStatus(RunStatus.Stopped); - notifyEngineStopped(); - } - } - - private void cleanCurrentTransactionCommand() { - if (currentTransaction != null && currentTransaction.getCommand() != null) - currentTransaction.getCommand().dispose(); - } - - private void commitCurrentTransaction() { - if (currentTransaction != null) { - try { - currentTransaction.commit(); - } catch (RollbackException t) { - - cleanCurrentTransactionCommand(); - - // Extracting the real error from the RollbackException - Throwable realT = t.getStatus().getException(); - - // And we put it inside our own sort of exception, as a cause - SequentialExecutionException enclosingException = new SequentialExecutionException(getCurrentMSEOccurrence(), realT); - enclosingException.initCause(realT); - throw enclosingException; - } - currentTransaction = null; - } - } - - @Override - public final Deque getCurrentStack() { - Deque result = new ArrayDeque(); - for (Step ls : currentSteps) { - result.add(ls.getMseoccurrence()); - } - return result; - } - - private EMFCommandTransaction createTransaction(InternalTransactionalEditingDomain editingDomain, RecordingCommand command) { - return new EMFCommandTransaction(command, editingDomain, null); - } - - - /* (non-Javadoc) - * @see org.gemoc.xdsmlframework.api.core.IExecutionEngine#getCurrentMSEOccurrence() - */ - @Override - public final MSEOccurrence getCurrentMSEOccurrence() { - if (currentSteps.size() > 0) - return currentSteps.getFirst().getMseoccurrence(); - else - return null; - } - - private void startNewTransaction(InternalTransactionalEditingDomain editingDomain, RecordingCommand command) { - currentTransaction = createTransaction(editingDomain, command); - try { - currentTransaction.start(); - } catch (InterruptedException e) { - cleanCurrentTransactionCommand(); - command.dispose(); - SequentialExecutionException enclosingException = new SequentialExecutionException(getCurrentMSEOccurrence(), e); - enclosingException.initCause(e); - throw enclosingException; - } - } - - protected final void stopExecutionIfAsked() { - // If the engine is stopped, we use this call to stop the execution - if (_isStopped) { - // notification occurs only if not already stopped - notifyAboutToStop(); - throw new EngineStoppedException("Execution stopped."); - } - } - - protected final void beforeExecutionStep(Step step) { - - // We will trick the transaction with an empty command. This most - // probably make rollbacks impossible, but at least we can manage - // transactions the way we want. - RecordingCommand rc = new RecordingCommand(editingDomain) { - @Override - protected void doExecute() { - } - }; - - beforeExecutionStep(step, rc); - rc.execute(); - } - - /** - * To be called just after each execution step by an implementing engine. If - * the step was done through a RecordingCommand, it can be given. - */ - protected final void beforeExecutionStep(Step step, RecordingCommand rc) { - - try { - - currentSteps.push(step); - - stopExecutionIfAsked(); - - // We end any running transaction - commitCurrentTransaction(); - - // We notify addons - notifyAboutToExecuteLogicalStep(step); - - // We start a new transaction - startNewTransaction(editingDomain, rc); - - } - - // In case of error, we dispose recording commands to be sure to remove - // notifiers - catch (Throwable t) { - cleanCurrentTransactionCommand(); - rc.dispose(); - throw t; - } - - } - - private boolean isInStep() { - - boolean containsNotNull = false; - - for (Step ls : currentSteps) { - if (ls != null && ls.getMseoccurrence() != null) { - containsNotNull = true; - break; - } - } - - return !currentSteps.isEmpty() && containsNotNull; - - } - - /** - * To be called just after each execution step by an implementing engine. - */ - protected void afterExecutionStep() { - - RecordingCommand emptyrc = null; - - try { - - Step step = currentSteps.pop(); - - // We commit the transaction (which might be a different one - // than the one created earlier, or null if two operations - // end successively) - commitCurrentTransaction(); - - // We notify addons that the step ended. - notifyLogicalStepExecuted(step); - - // If we are still in the middle of a step, we start a new - // transaction with an empty command (since we can't have command - // containing the remainder of the previous step), - if (isInStep()) { - emptyrc = new RecordingCommand(editingDomain) { - @Override - protected void doExecute() { - } - }; - startNewTransaction(editingDomain, emptyrc); - emptyrc.execute(); - } - engineStatus.incrementNbLogicalStepRun(); - - stopExecutionIfAsked(); - } - - // In case of error, we dispose recording commands to be sure to remove - // notifiers - catch (Throwable t) { - cleanCurrentTransactionCommand(); - if (emptyrc != null) - emptyrc.dispose(); - throw t; - } - - } - - private static InternalTransactionalEditingDomain getEditingDomain(ResourceSet rs) { - TransactionalEditingDomain edomain = org.eclipse.emf.transaction.TransactionalEditingDomain.Factory.INSTANCE.getEditingDomain(rs); - if (edomain instanceof InternalTransactionalEditingDomain) - return (InternalTransactionalEditingDomain) edomain; - else - return null; - } - -} diff --git a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IExecutionEngine.java b/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IExecutionEngine.java deleted file mode 100644 index b14b568b3..000000000 --- a/framework/framework_commons/plugins/org.gemoc.xdsmlframework.api/src/org/gemoc/xdsmlframework/api/core/IExecutionEngine.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016 Inria 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: - * Inria - initial API and implementation - *******************************************************************************/ -package org.gemoc.xdsmlframework.api.core; - -import java.util.Deque; -import java.util.Set; - -import org.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; -import org.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; - -import fr.inria.diverse.trace.commons.model.launchconfiguration.LaunchConfiguration; -import fr.inria.diverse.trace.commons.model.trace.MSEOccurrence; - -/** - * The interface of the GEMOC Execution Engine. The Execution Engine is an - * entity able to execute models conforming to an xDSML as defined in the GEMOC - * ANR INS project. This API allows the caller to initialize the engine for a - * given model, and to run the engine in different ways. It also allows the - * caller to influence the constraints of the MoC at runtime. - * - * @author Didier Vojtisek - * - */ -public interface IExecutionEngine extends IDisposable { - - /** - * In case of nested calls, indicate the current stack of model specific event occurrences. - * @return the current stack of {@link MSEOccurrence} - */ - Deque getCurrentStack(); - - /** - * Provides the model specific event occurrence of the current step - * @return the current MSEOccurrence - */ - MSEOccurrence getCurrentMSEOccurrence(); - - /** - * Starts the {@link IExecutionEngine} in a new thread (non-blocking). - */ - void start(); - - void startSynchronous(); - - /** - * Asks the engine to stop - */ - void stop(); - - /** - * indicates the engine status {@link EngineStatus} - * @return the engine status - */ - EngineStatus getEngineStatus(); - - /** - * set the engine status {@link EngineStatus} - * @param status the new status - */ - void setEngineStatus(RunStatus status); - - /** - * Indicates if an {@link IEngineAddon} of the given type is linked to the engine - * @param type of the searched addon - * @return true if the engine has the addon, false otherwise. - */ - boolean hasAddon(Class type); - - /** - * get the first {@link IEngineAddon} of the required type associated to this engine. - * @param type searched type - * @return The {@link IEngineAddon} of the given type if it exists. - */ - T getAddon(Class type); - - /** - * get the execution context - * @return the {@link IExecutionContext} - */ - IExecutionContext getExecutionContext(); - - /** - * get the run status - * @return the {@link RunStatus} - */ - RunStatus getRunningStatus(); - - /** - * get all the {@link IEngineAddon} of the required type associated to this engine. - * @param type searched type - * @return a set of {@link IEngineAddon} of the given type. - */ - Set getAddonsTypedBy(Class type); - - /** - * Ask the engine to initialize - * @param executionContext the {@link IExecutionContext} - */ - void initialize(IExecutionContext executionContext); - - /** - * Create a {@link LaunchConfiguration} for the Trace based on the engine RunConfiguration. - * @return a {@link fr.inria.diverse.trace.commons.model.trace.LaunchConfiguration} - */ - default LaunchConfiguration extractLaunchConfiguration() { - return null; - } - - /** - * get the engine kind name - * @return a user display name for the engine kind (will be used to compute - * the full name of the engine instance) - */ - String engineKindName(); - - /** - * get the engine name - * @return a display name to identify this engine - */ - String getName(); -} From 20f88b14179ef2ec20ed4b7b2e3c1bb4ee81a108 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 13:15:35 +0200 Subject: [PATCH 15/31] Re-add @Deprecated to DefaultEngineAddon (merge mistake) --- .../api/engine_addon/DefaultEngineAddon.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/DefaultEngineAddon.java b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/DefaultEngineAddon.java index e180f7f2a..01091f182 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/DefaultEngineAddon.java +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/DefaultEngineAddon.java @@ -10,6 +10,13 @@ *******************************************************************************/ package org.eclipse.gemoc.xdsmlframework.api.engine_addon; +@Deprecated() +/** + * Engine addon with no behavior at all. + * + * @deprecated Use {@link IEngineAddon} directly instead, as all operations have + * default empty implementations. + */ public class DefaultEngineAddon implements IEngineAddon { } From 2b79f3375de3599585199681060853cd4119dd53 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 13:41:32 +0200 Subject: [PATCH 16/31] [GenericTrace] make 'tracedObjects' and 'values' unordered --- .../model/GenericTrace.ecore | 8 ++++---- .../eclipse/gemoc/trace/commons/model/trace/State.java | 2 +- .../eclipse/gemoc/trace/commons/model/trace/Trace.java | 2 +- .../gemoc/trace/commons/model/trace/TracedObject.java | 2 +- .../trace/commons/model/trace/impl/TracePackageImpl.java | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore index a2c748cfa..f89b6b9aa 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore @@ -134,8 +134,8 @@ containment="true"> - + - + diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/State.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/State.java index 9e2d5222f..0d0fe4a45 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/State.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/State.java @@ -81,7 +81,7 @@ public interface State, ValueSubType extends ValueValues' reference list. * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#getState_Values() * @see org.eclipse.gemoc.trace.commons.model.trace.Value#getStates - * @model opposite="states" + * @model opposite="states" ordered="false" * @generated */ EList getValues(); diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/Trace.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/Trace.java index f4fda9321..025fa761e 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/Trace.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/Trace.java @@ -74,7 +74,7 @@ public interface Trace, TracedObjectSubtype extends * * @return the value of the 'Traced Objects' containment reference list. * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#getTrace_TracedObjects() - * @model containment="true" + * @model containment="true" ordered="false" * @generated */ EList getTracedObjects(); diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java index a7ec07181..301ab4ccc 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracedObject.java @@ -43,7 +43,7 @@ public interface TracedObject> extends EOb * * @return the value of the 'Dimensions' reference list. * @see org.eclipse.gemoc.trace.commons.model.trace.TracePackage#getTracedObject_Dimensions() - * @model transient="true" volatile="true" + * @model transient="true" volatile="true" derived="true" * annotation="http://www.eclipse.org/emf/2002/GenModel get='return getDimensionsInternal();'" * @generated */ diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java index 0a430861b..1b2f2860f 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/impl/TracePackageImpl.java @@ -857,14 +857,14 @@ public void initializePackageContents() { g1 = createEGenericType(traceEClass_StepSubType); initEReference(getTrace_RootStep(), g1, null, "rootStep", null, 1, 1, Trace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(traceEClass_TracedObjectSubtype); - initEReference(getTrace_TracedObjects(), g1, null, "tracedObjects", null, 0, -1, Trace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTrace_TracedObjects(), g1, null, "tracedObjects", null, 0, -1, Trace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); g1 = createEGenericType(traceEClass_StateSubType); initEReference(getTrace_States(), g1, null, "states", null, 0, -1, Trace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getTrace_Launchconfiguration(), theLaunchconfigurationPackage.getLaunchConfiguration(), null, "launchconfiguration", null, 1, 1, Trace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(tracedObjectEClass, TracedObject.class, "TracedObject", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(tracedObjectEClass_DimensionSubType); - initEReference(getTracedObject_Dimensions(), g1, null, "dimensions", null, 0, -1, TracedObject.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTracedObject_Dimensions(), g1, null, "dimensions", null, 0, -1, TracedObject.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); EOperation op = initEOperation(getTracedObject__GetDimensionsInternal(), null, "getDimensionsInternal", 0, -1, IS_UNIQUE, IS_ORDERED); g1 = createEGenericType(tracedObjectEClass_DimensionSubType); @@ -884,7 +884,7 @@ public void initializePackageContents() { g1 = createEGenericType(stateEClass_StepSubType); initEReference(getState_EndedSteps(), g1, this.getStep_EndingState(), "endedSteps", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(stateEClass_ValueSubType); - initEReference(getState_Values(), g1, this.getValue_States(), "values", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getState_Values(), g1, this.getValue_States(), "values", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); // Initialize data types initEDataType(iSerializableEDataType, byte[].class, "ISerializable", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); From 50e1095d796bda372c4207ed5de76c32fe768818 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 13:42:00 +0200 Subject: [PATCH 17/31] Replace some 'fr.inria.diverse' by 'org.eclipse.gemoc' --- .../model/GenericTrace.genmodel | 4 ++-- .../model/GenericTraceImpl.genmodel | 4 ++-- .../model/LaunchConfiguration.genmodel | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel index 42c7c957b..c0e605f5b 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel @@ -1,12 +1,12 @@ GenericTrace.ecore - diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel index 0872efdde..e07d2f170 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel @@ -1,12 +1,12 @@ GenericTraceImpl.ecore - diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel index d05c54c03..129920f1e 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel @@ -1,11 +1,11 @@ LaunchConfiguration.ecore - From e7f9773b59c3b27d26fe8a26ece588ef97929439 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 14:31:15 +0200 Subject: [PATCH 18/31] Replace several "fr.inria.diverse" by "org.eclipse.gemoc" --- .../model/GemocExecutionEngineTrace.aird | 22 ++-- .../model/GemocExecutionEngineTrace.ecore | 4 +- .../model/GemocExecutionEngineTrace.genmodel | 2 +- .../JavaEngineTests.launch | 2 +- .../model/GenericTrace.genmodel | 4 +- .../model/GenericTraceImpl.genmodel | 4 +- .../model/LaunchConfiguration.genmodel | 4 +- .../model/base.aird | 118 +++++++++--------- .../model/base.ecore | 18 +-- .../model/base.genmodel | 2 +- 10 files changed, 90 insertions(+), 90 deletions(-) diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird index 8ff0c774d..40338cfa6 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird @@ -1,7 +1,7 @@ GemocExecutionEngineTrace.ecore - platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore + platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore http://www.eclipse.org/emf/2002/Ecore platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore @@ -575,8 +575,8 @@ - - + + @@ -588,16 +588,16 @@ - - + + - - + + @@ -605,8 +605,8 @@ - - + + @@ -647,8 +647,8 @@ - - + + labelSize diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore index 1e4ddcc54..618a3c0cd 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore @@ -6,9 +6,9 @@ - + GemocExecutionEngineTrace.ecore - + diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel index 42c7c957b..c0e605f5b 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel @@ -1,12 +1,12 @@ GenericTrace.ecore - diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel index 0872efdde..e07d2f170 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel @@ -1,12 +1,12 @@ GenericTraceImpl.ecore - diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel index d05c54c03..129920f1e 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel @@ -1,11 +1,11 @@ LaunchConfiguration.ecore - diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird index 7e151f9c2..18625232f 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird @@ -2,10 +2,10 @@ base.ecore - platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore + platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore http://www.eclipse.org/emf/2002/Ecore - platform:/resource/fr.inria.diverse.trace.commons.model/model/LaunchConfiguration.ecore + platform:/resource/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.ecore @@ -799,14 +799,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -816,8 +816,8 @@ - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -827,8 +827,8 @@ - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -846,8 +846,8 @@ - - + + bold @@ -855,8 +855,8 @@ - - + + labelSize @@ -869,8 +869,8 @@ - - + + @@ -878,8 +878,8 @@ - - + + labelSize @@ -907,14 +907,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -932,8 +932,8 @@ - - + + @@ -941,8 +941,8 @@ - - + + @@ -967,14 +967,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -993,8 +993,8 @@ - - + + labelSize @@ -1023,14 +1023,14 @@ - - + + - - + + @@ -1046,14 +1046,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -1063,8 +1063,8 @@ - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -1163,14 +1163,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -1188,8 +1188,8 @@ - - + + @@ -1242,8 +1242,8 @@ - - + + italic @@ -1282,9 +1282,9 @@ - - - + + + routingStyle @@ -1294,9 +1294,9 @@ - - - + + + @@ -1305,9 +1305,9 @@ - - - + + + diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore index c09a76ff7..2cf771b85 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore @@ -2,8 +2,8 @@ - - + + @@ -25,17 +25,17 @@ - + - + - + @@ -44,7 +44,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -76,7 +76,7 @@ - + diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel index 6092c9546..cfcc145cb 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel @@ -3,7 +3,7 @@ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/fr.inria.diverse.trace.metamodel.generator/src" modelPluginID="fr.inria.diverse.trace.metamodel.generator" modelName="Base" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false" - usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../fr.inria.diverse.trace.commons.model/model/GenericTrace.genmodel#//trace" + usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel#//trace" operationReflection="true" importOrganizing="true"> base.ecore From 1f7ef6547f4c31c674613b7066ca915b844eb1de Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 17 Jul 2017 17:05:26 +0200 Subject: [PATCH 19/31] Remove confusion AbstractDSLLaunchConfigurationDelegateUI classes To better distinguish the classes org.eclipse.gemoc.dsl.debug.ide.sirius.ui.launch .AbstractDSLLaunchConfigurationDelegateUI and org.eclipse.gemoc.dsl.debug.ide.ui.launch .AbstractDSLLaunchConfigurationDelegateUI this commit renames the former to AbstractDSLLaunchConfigurationDelegateUI2 For some reason, this caused me really strange compilation errors in Eclipse, while probably tycho is not bothered. --- .../engine/ui/launcher/AbstractGemocLauncher.java | 2 +- ...> AbstractDSLLaunchConfigurationDelegateUI2.java} | 12 ++++++------ .../sirius/ui/launch/DSLLaunchConfigurationTab.java | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) rename simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/{AbstractDSLLaunchConfigurationDelegateUI.java => AbstractDSLLaunchConfigurationDelegateUI2.java} (94%) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine.ui/src/org/eclipse/gemoc/executionframework/engine/ui/launcher/AbstractGemocLauncher.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine.ui/src/org/eclipse/gemoc/executionframework/engine/ui/launcher/AbstractGemocLauncher.java index 075b8b2bc..aec3d3716 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine.ui/src/org/eclipse/gemoc/executionframework/engine/ui/launcher/AbstractGemocLauncher.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine.ui/src/org/eclipse/gemoc/executionframework/engine/ui/launcher/AbstractGemocLauncher.java @@ -20,7 +20,7 @@ import org.eclipse.gemoc.trace.commons.model.launchconfiguration.LaunchConfiguration; -abstract public class AbstractGemocLauncher extends org.eclipse.gemoc.dsl.debug.ide.sirius.ui.launch.AbstractDSLLaunchConfigurationDelegateUI { +abstract public class AbstractGemocLauncher extends org.eclipse.gemoc.dsl.debug.ide.sirius.ui.launch.AbstractDSLLaunchConfigurationDelegateUI2 { // warning this MODEL_ID must be the same as the one in the ModelLoader in order to enable correctly the breakpoints public final static String MODEL_ID = org.eclipse.gemoc.executionframework.engine.ui.Activator.PLUGIN_ID+".debugModel"; diff --git a/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateUI.java b/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateUI2.java similarity index 94% rename from simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateUI.java rename to simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateUI2.java index def5c52b7..5c21b9790 100644 --- a/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateUI.java +++ b/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateUI2.java @@ -10,10 +10,6 @@ *******************************************************************************/ package org.eclipse.gemoc.dsl.debug.ide.sirius.ui.launch; -import org.eclipse.gemoc.dsl.debug.ide.adapter.IDSLCurrentInstructionListener; -import org.eclipse.gemoc.dsl.debug.ide.sirius.ui.services.AbstractDSLDebuggerServices; -import org.eclipse.gemoc.dsl.debug.ide.ui.launch.DSLLaunchConfigurationTab; - import java.util.Arrays; import java.util.List; @@ -24,6 +20,9 @@ import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; +import org.eclipse.gemoc.dsl.debug.ide.adapter.IDSLCurrentInstructionListener; +import org.eclipse.gemoc.dsl.debug.ide.sirius.ui.services.AbstractDSLDebuggerServices; +import org.eclipse.gemoc.dsl.debug.ide.ui.launch.DSLLaunchConfigurationTab; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.sirius.business.api.helper.SiriusUtil; import org.eclipse.sirius.business.api.session.Session; @@ -31,13 +30,14 @@ import org.eclipse.ui.PlatformUI; /** - * A Sirius implementation of {@link org.eclipse.gemoc.dsl.debug.ide.launch.AbstractDSLLaunchConfigurationDelegate + * A Sirius implementation of + * {@link org.eclipse.gemoc.dsl.debug.ide.launch.AbstractDSLLaunchConfigurationDelegate * AbstractDSLLaunchConfigurationDelegate} with {@link org.eclipse.debug.ui.ILaunchShortcut ILaunchShortcut} * support. * * @author Yvan Lussaud */ -public abstract class AbstractDSLLaunchConfigurationDelegateUI extends org.eclipse.gemoc.dsl.debug.ide.ui.launch.AbstractDSLLaunchConfigurationDelegateUI { +public abstract class AbstractDSLLaunchConfigurationDelegateUI2 extends org.eclipse.gemoc.dsl.debug.ide.ui.launch.AbstractDSLLaunchConfigurationDelegateUI { /** * The Sirius {@link org.eclipse.emf.ecore.resource.Resource Resource} diff --git a/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/DSLLaunchConfigurationTab.java b/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/DSLLaunchConfigurationTab.java index fcdff2a8b..bc27cf2d5 100644 --- a/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/DSLLaunchConfigurationTab.java +++ b/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/DSLLaunchConfigurationTab.java @@ -50,7 +50,7 @@ public class DSLLaunchConfigurationTab extends org.eclipse.gemoc.dsl.debug.ide.ui.launch.DSLLaunchConfigurationTab { /** - * The {@link Text} used for the {@link AbstractDSLLaunchConfigurationDelegateUI#SIRIUS_RESOURCE_URI}. + * The {@link Text} used for the {@link AbstractDSLLaunchConfigurationDelegateUI2#SIRIUS_RESOURCE_URI}. */ private Text siriusResourceURIText; @@ -67,7 +67,7 @@ public DSLLaunchConfigurationTab(String[] extensions) { @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { super.setDefaults(configuration); - configuration.setAttribute(AbstractDSLLaunchConfigurationDelegateUI.SIRIUS_RESOURCE_URI, ""); + configuration.setAttribute(AbstractDSLLaunchConfigurationDelegateUI2.SIRIUS_RESOURCE_URI, ""); } /** @@ -94,7 +94,7 @@ public void initializeFrom(final ILaunchConfiguration configuration) { @Override public void performApply(ILaunchConfigurationWorkingCopy configuration) { super.performApply(configuration); - configuration.setAttribute(AbstractDSLLaunchConfigurationDelegateUI.SIRIUS_RESOURCE_URI, + configuration.setAttribute(AbstractDSLLaunchConfigurationDelegateUI2.SIRIUS_RESOURCE_URI, siriusResourceURIText.getText()); } @@ -106,7 +106,7 @@ public boolean isValid(ILaunchConfiguration launchConfig) { try { if (res) { String siriusResourceURI = launchConfig.getAttribute( - AbstractDSLLaunchConfigurationDelegateUI.SIRIUS_RESOURCE_URI, ""); + AbstractDSLLaunchConfigurationDelegateUI2.SIRIUS_RESOURCE_URI, ""); IFile resourceFile = ResourcesPlugin.getWorkspace().getRoot().getFile( new Path(siriusResourceURI)); Resource resource = null; From 9e7eb0b8e66b6e30b6625116ae10a1c37c46e192 Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Tue, 18 Jul 2017 10:56:11 +0200 Subject: [PATCH 20/31] Rename AbstractDSLLaunchConfigurationDelegateUI2 to AbstractDSLLaunchConfigurationDelegateSiriusUI --- .../engine/ui/launcher/AbstractGemocLauncher.java | 2 +- .../ui/launcher/tabs/LaunchConfigurationMainTab.java | 4 ++-- ...> AbstractDSLLaunchConfigurationDelegateSiriusUI.java} | 2 +- .../ide/sirius/ui/launch/DSLLaunchConfigurationTab.java | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) rename simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/{AbstractDSLLaunchConfigurationDelegateUI2.java => AbstractDSLLaunchConfigurationDelegateSiriusUI.java} (96%) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine.ui/src/org/eclipse/gemoc/executionframework/engine/ui/launcher/AbstractGemocLauncher.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine.ui/src/org/eclipse/gemoc/executionframework/engine/ui/launcher/AbstractGemocLauncher.java index aec3d3716..9f2f89fd1 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine.ui/src/org/eclipse/gemoc/executionframework/engine/ui/launcher/AbstractGemocLauncher.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine.ui/src/org/eclipse/gemoc/executionframework/engine/ui/launcher/AbstractGemocLauncher.java @@ -20,7 +20,7 @@ import org.eclipse.gemoc.trace.commons.model.launchconfiguration.LaunchConfiguration; -abstract public class AbstractGemocLauncher extends org.eclipse.gemoc.dsl.debug.ide.sirius.ui.launch.AbstractDSLLaunchConfigurationDelegateUI2 { +abstract public class AbstractGemocLauncher extends org.eclipse.gemoc.dsl.debug.ide.sirius.ui.launch.AbstractDSLLaunchConfigurationDelegateSiriusUI { // warning this MODEL_ID must be the same as the one in the ModelLoader in order to enable correctly the breakpoints public final static String MODEL_ID = org.eclipse.gemoc.executionframework.engine.ui.Activator.PLUGIN_ID+".debugModel"; diff --git a/java_execution/java_engine/plugins/org.eclipse.gemoc.execution.sequential.javaengine.ui/src/org/eclipse/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java b/java_execution/java_engine/plugins/org.eclipse.gemoc.execution.sequential.javaengine.ui/src/org/eclipse/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java index 4e8ea13ce..8a3ac34f4 100644 --- a/java_execution/java_engine/plugins/org.eclipse.gemoc.execution.sequential.javaengine.ui/src/org/eclipse/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java +++ b/java_execution/java_engine/plugins/org.eclipse.gemoc.execution.sequential.javaengine.ui/src/org/eclipse/gemoc/execution/sequential/javaengine/ui/launcher/tabs/LaunchConfigurationMainTab.java @@ -59,7 +59,7 @@ import org.osgi.framework.Bundle; import org.eclipse.gemoc.dsl.debug.ide.launch.AbstractDSLLaunchConfigurationDelegate; -import org.eclipse.gemoc.dsl.debug.ide.sirius.ui.launch.AbstractDSLLaunchConfigurationDelegateUI; +import org.eclipse.gemoc.dsl.debug.ide.sirius.ui.launch.AbstractDSLLaunchConfigurationDelegateSiriusUI; /** * Sequential engine launch configuration main tab @@ -168,7 +168,7 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) { AbstractDSLLaunchConfigurationDelegate.RESOURCE_URI, this._modelLocationText.getText()); configuration.setAttribute( - AbstractDSLLaunchConfigurationDelegateUI.SIRIUS_RESOURCE_URI, + AbstractDSLLaunchConfigurationDelegateSiriusUI.SIRIUS_RESOURCE_URI, this._siriusRepresentationLocationText.getText()); configuration.setAttribute(RunConfiguration.LAUNCH_DELAY, Integer.parseInt(_delayText.getText())); diff --git a/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateUI2.java b/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateSiriusUI.java similarity index 96% rename from simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateUI2.java rename to simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateSiriusUI.java index 5c21b9790..7544509d8 100644 --- a/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateUI2.java +++ b/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/AbstractDSLLaunchConfigurationDelegateSiriusUI.java @@ -37,7 +37,7 @@ * * @author Yvan Lussaud */ -public abstract class AbstractDSLLaunchConfigurationDelegateUI2 extends org.eclipse.gemoc.dsl.debug.ide.ui.launch.AbstractDSLLaunchConfigurationDelegateUI { +public abstract class AbstractDSLLaunchConfigurationDelegateSiriusUI extends org.eclipse.gemoc.dsl.debug.ide.ui.launch.AbstractDSLLaunchConfigurationDelegateUI { /** * The Sirius {@link org.eclipse.emf.ecore.resource.Resource Resource} diff --git a/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/DSLLaunchConfigurationTab.java b/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/DSLLaunchConfigurationTab.java index bc27cf2d5..9e7bb07b4 100644 --- a/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/DSLLaunchConfigurationTab.java +++ b/simulationmodelanimation/plugins/org.eclipse.gemoc.dsl.debug.ide.sirius.ui/src/org/eclipse/gemoc/dsl/debug/ide/sirius/ui/launch/DSLLaunchConfigurationTab.java @@ -50,7 +50,7 @@ public class DSLLaunchConfigurationTab extends org.eclipse.gemoc.dsl.debug.ide.ui.launch.DSLLaunchConfigurationTab { /** - * The {@link Text} used for the {@link AbstractDSLLaunchConfigurationDelegateUI2#SIRIUS_RESOURCE_URI}. + * The {@link Text} used for the {@link AbstractDSLLaunchConfigurationDelegateSiriusUI#SIRIUS_RESOURCE_URI}. */ private Text siriusResourceURIText; @@ -67,7 +67,7 @@ public DSLLaunchConfigurationTab(String[] extensions) { @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { super.setDefaults(configuration); - configuration.setAttribute(AbstractDSLLaunchConfigurationDelegateUI2.SIRIUS_RESOURCE_URI, ""); + configuration.setAttribute(AbstractDSLLaunchConfigurationDelegateSiriusUI.SIRIUS_RESOURCE_URI, ""); } /** @@ -94,7 +94,7 @@ public void initializeFrom(final ILaunchConfiguration configuration) { @Override public void performApply(ILaunchConfigurationWorkingCopy configuration) { super.performApply(configuration); - configuration.setAttribute(AbstractDSLLaunchConfigurationDelegateUI2.SIRIUS_RESOURCE_URI, + configuration.setAttribute(AbstractDSLLaunchConfigurationDelegateSiriusUI.SIRIUS_RESOURCE_URI, siriusResourceURIText.getText()); } @@ -106,7 +106,7 @@ public boolean isValid(ILaunchConfiguration launchConfig) { try { if (res) { String siriusResourceURI = launchConfig.getAttribute( - AbstractDSLLaunchConfigurationDelegateUI2.SIRIUS_RESOURCE_URI, ""); + AbstractDSLLaunchConfigurationDelegateSiriusUI.SIRIUS_RESOURCE_URI, ""); IFile resourceFile = ResourcesPlugin.getWorkspace().getRoot().getFile( new Path(siriusResourceURI)); Resource resource = null; From 8699534f6f4198ac24160081efccbb85a2b0ed8c Mon Sep 17 00:00:00 2001 From: Erwan Bousse Date: Mon, 24 Jul 2017 08:55:06 +0200 Subject: [PATCH 21/31] Mass rename 'fr.inria.diverse.trace' to 'org.eclipse.gemoc.trace' --- .../model/GemocExecutionEngineTrace.aird | 22 +- .../model/GemocExecutionEngineTrace.ecore | 4 +- .../model/GemocExecutionEngineTrace.genmodel | 2 +- .../JavaEngineTests.launch | 4 +- .../model/GenericTrace.genmodel | 4 +- .../model/GenericTraceImpl.genmodel | 4 +- .../model/LaunchConfiguration.genmodel | 4 +- trace/generator/README.md | 8 +- .../model/tracingannotations.genmodel | 2 +- .../model/base.aird | 118 +-- .../model/base.ecore | 18 +- .../model/base.genmodel | 6 +- .../2557-1_4-Clone.launch | 2 +- .../2557-1_4-Generated.launch | 2 +- .../2557-1_4-Generic.launch | 2 +- .../2557-1_4-None.launch | 2 +- .../hs_err_pid8464.log | 835 ------------------ 17 files changed, 102 insertions(+), 937 deletions(-) delete mode 100644 trace/tests_and_benchmarks/org.eclipse.gemoc.trace.metamodel.generator.test/hs_err_pid8464.log diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird index 8ff0c774d..40338cfa6 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird @@ -1,7 +1,7 @@ GemocExecutionEngineTrace.ecore - platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore + platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore http://www.eclipse.org/emf/2002/Ecore platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore @@ -575,8 +575,8 @@ - - + + @@ -588,16 +588,16 @@ - - + + - - + + @@ -605,8 +605,8 @@ - - + + @@ -647,8 +647,8 @@ - - + + labelSize diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore index 1e4ddcc54..618a3c0cd 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore @@ -6,9 +6,9 @@ - + GemocExecutionEngineTrace.ecore - - + + diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel index 42c7c957b..c0e605f5b 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel @@ -1,12 +1,12 @@ GenericTrace.ecore - diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel index 0872efdde..e07d2f170 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel @@ -1,12 +1,12 @@ GenericTraceImpl.ecore - diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel index d05c54c03..129920f1e 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel @@ -1,11 +1,11 @@ LaunchConfiguration.ecore - diff --git a/trace/generator/README.md b/trace/generator/README.md index 5dd46182e..75316baeb 100644 --- a/trace/generator/README.md +++ b/trace/generator/README.md @@ -14,12 +14,12 @@ The generation process is divided in three steps: 1. Because operation semantics can be defined in using any language(s), we first extract the execution extension into an intermediate representation in order to then generically process it with the generator. The intermediate representation is defined using the Ecore metamodel that can be found in the plugin `fr.inria.diverse.opsemanticsview.model`. An conforming model is composed of new `EStructuralFeature` added to classes of the abstract classes, of new `EClass` objects, and of transformation rules specified as `EOperation` objects. Two extractors are provided for now: - - One for Kermeta in the plugin `fr.inria.diverse.trace.plaink3.tracematerialextractor`. - - One for xMOF in the plugin `fr.inria.diverse.trace.xmof.tracematerialextractor`. + - One for Kermeta in the plugin `org.eclipse.gemoc.trace.plaink3.tracematerialextractor`. + - One for xMOF in the plugin `org.eclipse.gemoc.trace.xmof.tracematerialextractor`. -2. A generic generator is called to process the intermediate representation and to produce an Ecore multidimensional domain-specific trace metamodel. The generator can be found in the plugin `fr.inria.diverse.trace.metamodel.generator`. +2. A generic generator is called to process the intermediate representation and to produce an Ecore multidimensional domain-specific trace metamodel. The generator can be found in the plugin `org.eclipse.gemoc.trace.metamodel.generator`. -3. A GEMOC engine addon generator is called, to process the intermediate representation, the generated trace metamodel and some traceability links in order to produce a trace management plugin that contains the trace metamodel and a trace manager (in Java). The *state manager* provides services to construct a trace, and to restore the executed model into a former state in order to create a Java class to integrate the trace plugin into a GEMOC engine addon. Contrary to the previous steps, this last step is specific and dependent to the GEMOC Studio plugins. The generator can be found in `fr.inria.diverse.trace.gemoc.generator`. +3. A GEMOC engine addon generator is called, to process the intermediate representation, the generated trace metamodel and some traceability links in order to produce a trace management plugin that contains the trace metamodel and a trace manager (in Java). The *state manager* provides services to construct a trace, and to restore the executed model into a former state in order to create a Java class to integrate the trace plugin into a GEMOC engine addon. Contrary to the previous steps, this last step is specific and dependent to the GEMOC Studio plugins. The generator can be found in `org.eclipse.gemoc.trace.gemoc.generator`. ## Publication diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.annotations/model/tracingannotations.genmodel b/trace/generator/plugins/org.eclipse.gemoc.trace.annotations/model/tracingannotations.genmodel index 9382fda8a..8032adfcb 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.annotations/model/tracingannotations.genmodel +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.annotations/model/tracingannotations.genmodel @@ -1,5 +1,5 @@ - + tracingannotations.ecore diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird index 7e151f9c2..18625232f 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird @@ -2,10 +2,10 @@ base.ecore - platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore + platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore http://www.eclipse.org/emf/2002/Ecore - platform:/resource/fr.inria.diverse.trace.commons.model/model/LaunchConfiguration.ecore + platform:/resource/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.ecore @@ -799,14 +799,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -816,8 +816,8 @@ - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -827,8 +827,8 @@ - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -846,8 +846,8 @@ - - + + bold @@ -855,8 +855,8 @@ - - + + labelSize @@ -869,8 +869,8 @@ - - + + @@ -878,8 +878,8 @@ - - + + labelSize @@ -907,14 +907,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -932,8 +932,8 @@ - - + + @@ -941,8 +941,8 @@ - - + + @@ -967,14 +967,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -993,8 +993,8 @@ - - + + labelSize @@ -1023,14 +1023,14 @@ - - + + - - + + @@ -1046,14 +1046,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -1063,8 +1063,8 @@ - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -1163,14 +1163,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -1188,8 +1188,8 @@ - - + + @@ -1242,8 +1242,8 @@ - - + + italic @@ -1282,9 +1282,9 @@ - - - + + + routingStyle @@ -1294,9 +1294,9 @@ - - - + + + @@ -1305,9 +1305,9 @@ - - - + + + diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore index c09a76ff7..2cf771b85 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore @@ -2,8 +2,8 @@ - - + + @@ -25,17 +25,17 @@ - + - + - + @@ -44,7 +44,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -76,7 +76,7 @@ - + diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel index 6092c9546..1baae2c51 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel @@ -1,9 +1,9 @@ base.ecore diff --git a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Clone.launch b/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Clone.launch index 3cf1f4354..f0afc04a9 100644 --- a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Clone.launch +++ b/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Clone.launch @@ -11,7 +11,7 @@ - + diff --git a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Generated.launch b/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Generated.launch index acb69f856..789f916a4 100644 --- a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Generated.launch +++ b/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Generated.launch @@ -11,7 +11,7 @@ - + diff --git a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Generic.launch b/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Generic.launch index b9e0be063..a0d1b3a88 100644 --- a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Generic.launch +++ b/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-Generic.launch @@ -11,7 +11,7 @@ - + diff --git a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-None.launch b/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-None.launch index 9ba8b3fed..2ab4a58d7 100644 --- a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-None.launch +++ b/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.benchmark/2557-1_4-None.launch @@ -11,7 +11,7 @@ - + diff --git a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.metamodel.generator.test/hs_err_pid8464.log b/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.metamodel.generator.test/hs_err_pid8464.log deleted file mode 100644 index 998a66bac..000000000 --- a/trace/tests_and_benchmarks/org.eclipse.gemoc.trace.metamodel.generator.test/hs_err_pid8464.log +++ /dev/null @@ -1,835 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x0000000000000000, pid=8464, tid=140599452133120 -# -# JRE version: Java(TM) SE Runtime Environment (8.0_77-b03) (build 1.8.0_77-b03) -# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.77-b03 mixed mode linux-amd64 compressed oops) -# Problematic frame: -# C 0x0000000000000000 -# -# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again -# -# If you would like to submit a bug report, please visit: -# http://bugreport.java.com/bugreport/crash.jsp -# - ---------------- T H R E A D --------------- - -Current thread (0x00007fdff80c5000): JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=8487, stack(0x00007fdfdc566000,0x00007fdfdc667000)] - -siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000 - -Registers: -RAX=0x00007fdfbc08aa70, RBX=0x00007fdfbc0b0040, RCX=0x00007fdfffd4c2e0, RDX=0x00007fdfff32e640 -RSP=0x00007fdfdc665a48, RBP=0x00007fdfdc665a60, RSI=0x00007fdff80c5000, RDI=0x00007fdfbc0b0040 -R8 =0x00007fdfbc0a9ff0, R9 =0x0000000000000000, R10=0x00007fdfbc0a9fe0, R11=0x00007fdfff4e69b0 -R12=0x0000000000000017, R13=0x00007fdfbc000078, R14=0x00007fdff80c5000, R15=0x00007fdfdc665b67 -RIP=0x0000000000000000, EFLAGS=0x0000000000010216, CSGSFS=0x0000000000000033, ERR=0x0000000000000014 - TRAPNO=0x000000000000000e - -Top of Stack: (sp=0x00007fdfdc665a48) -0x00007fdfdc665a48: 00007fdffec1f567 0000000000000074 -0x00007fdfdc665a58: 00007fdff8003c10 00007fdfdc665ad0 -0x00007fdfdc665a68: 00007fdffeaafcae 00007fdfdc665a90 -0x00007fdfdc665a78: 00007fdfdc665a80 00007fdff80c5000 -0x00007fdfdc665a88: 0000000000000000 00007fdf00000000 -0x00007fdfdc665a98: 0000000000000000 00007fdfdc665ac0 -0x00007fdfdc665aa8: 00007fdffda33e40 00007fdfbc000078 -0x00007fdfdc665ab8: 00007fdfdc665b67 0000000000000001 -0x00007fdfdc665ac8: 00007fdfdc665b67 00007fdfdc665b00 -0x00007fdfdc665ad8: 00007fdffd81f8c2 00007fdfdc665b00 -0x00007fdfdc665ae8: 00007fdfbc000078 00007fdfdc665bd0 -0x00007fdfdc665af8: 0000000000000008 00007fdfdc665b90 -0x00007fdfdc665b08: 00007fdffd800aa0 00007fdfdc665b48 -0x00007fdfdc665b18: 00007fdfdc665b40 00007fdfdc665b38 -0x00007fdfdc665b28: 00007fdfdc665b5c 00000001bc0226d0 -0x00007fdfdc665b38: 0000000000000000 0000000000000000 -0x00007fdfdc665b48: 0000000000000000 00007fdfbc022870 -0x00007fdfdc665b58: 00000002dc665bd0 000000000000000d -0x00007fdfdc665b68: 0000000000000002 000000000000000f -0x00007fdfdc665b78: 0000000000000002 00000000000f0200 -0x00007fdfdc665b88: 000000000000000f 00007fdfdc665de0 -0x00007fdfdc665b98: 00007fdffd80b9c6 0000825800000013 -0x00007fdfdc665ba8: 00007fdffe0f0200 00007fdfb0000ba0 -0x00007fdfdc665bb8: 0000000000000000 00007fdfdc665bd0 -0x00007fdfdc665bc8: 00007fdfdc665d60 00007fdfdc665c46 -0x00007fdfdc665bd8: 00007fdf00000106 00007fdfdc665be8 -0x00007fdfdc665be8: 0000000000000026 00007fdfdc665c20 -0x00007fdfdc665bf8: 0000000000000000 00007f0000000000 -0x00007fdfdc665c08: 00008258000007c2 00007fdf00005d80 -0x00007fdfdc665c18: 0000000000000000 df7f00000d000000 -0x00007fdfdc665c28: 0700000088f200bc 0070756e61656c63 -0x00007fdfdc665c38: 0000562928030000 6574020000000000 - -Instructions: (pc=0x0000000000000000) -0xffffffffffffffe0: - -Register to memory mapping: - -RAX=0x00007fdfbc08aa70 is an unknown value -RBX=0x00007fdfbc0b0040 is an unknown value -RCX=0x00007fdfffd4c2e0: in /lib64/libpthread.so.0 at 0x00007fdfffb34000 -RDX=0x00007fdfff32e640: in /usr/java/jdk1.8.0_77/jre/lib/amd64/server/libjvm.so at 0x00007fdffe379000 -RSP=0x00007fdfdc665a48 is pointing into the stack for thread: 0x00007fdff80c5000 -RBP=0x00007fdfdc665a60 is pointing into the stack for thread: 0x00007fdff80c5000 -RSI=0x00007fdff80c5000 is a thread -RDI=0x00007fdfbc0b0040 is an unknown value -R8 =0x00007fdfbc0a9ff0 is an unknown value -R9 =0x0000000000000000 is an unknown value -R10=0x00007fdfbc0a9fe0 is an unknown value -R11=0x00007fdfff4e69b0: in /lib64/libc.so.6 at 0x00007fdfff359000 -R12=0x0000000000000017 is an unknown value -R13=0x00007fdfbc000078 is an unknown value -R14=0x00007fdff80c5000 is a thread -R15=0x00007fdfdc665b67 is pointing into the stack for thread: 0x00007fdff80c5000 - - -Stack: [0x00007fdfdc566000,0x00007fdfdc667000], sp=0x00007fdfdc665a48, free space=1022k - ---------------- P R O C E S S --------------- - -Java Threads: ( => current thread ) - 0x00007fdf8000b800 JavaThread "[ThreadPool Manager] - Idle Thread" daemon [_thread_blocked, id=8588, stack(0x00007fdfa57dd000,0x00007fdfa58de000)] - 0x00007fdf78012800 JavaThread "Worker-1" [_thread_blocked, id=8547, stack(0x00007fdfa6a5d000,0x00007fdfa6b5e000)] - 0x00007fdff857e000 JavaThread "Worker-0" [_thread_blocked, id=8524, stack(0x00007fdfa62e0000,0x00007fdfa63e1000)] - 0x00007fdff8136000 JavaThread "EMF Reference Cleaner" daemon [_thread_blocked, id=8523, stack(0x00007fdfa5ede000,0x00007fdfa5fdf000)] - 0x00007fdff8134800 JavaThread "ReaderThread" [_thread_in_native, id=8522, stack(0x00007fdfa61df000,0x00007fdfa62e0000)] - 0x00007fdf7c43e000 JavaThread "Worker-JM" [_thread_blocked, id=8520, stack(0x00007fdfa65e1000,0x00007fdfa66e2000)] - 0x00007fdf7c007000 JavaThread "[Timer] - Main Queue Handler" daemon [_thread_blocked, id=8516, stack(0x00007fdfa695c000,0x00007fdfa6a5d000)] - 0x00007fdff8828800 JavaThread "Bundle File Closer" daemon [_thread_blocked, id=8510, stack(0x00007fdfa6e4d000,0x00007fdfa6f4e000)] - 0x00007fdff8403800 JavaThread "Start Level: Equinox Container: 7083cb78-35fb-0015-1141-bece38f4d72a" daemon [_thread_blocked, id=8509, stack(0x00007fdfa709f000,0x00007fdfa71a0000)] - 0x00007fdff83fa000 JavaThread "Refresh Thread: Equinox Container: 7083cb78-35fb-0015-1141-bece38f4d72a" daemon [_thread_blocked, id=8508, stack(0x00007fdfa72b1000,0x00007fdfa73b2000)] - 0x00007fdff83f7000 JavaThread "Framework Event Dispatcher: Equinox Container: 7083cb78-35fb-0015-1141-bece38f4d72a" daemon [_thread_blocked, id=8507, stack(0x00007fdfa73b2000,0x00007fdfa74b3000)] - 0x00007fdff83ce000 JavaThread "Active Thread: Equinox Container: 7083cb78-35fb-0015-1141-bece38f4d72a" [_thread_blocked, id=8506, stack(0x00007fdfa74b3000,0x00007fdfa75b4000)] - 0x00007fdff80d2800 JavaThread "Service Thread" daemon [_thread_blocked, id=8497, stack(0x00007fdfa7eff000,0x00007fdfa8000000)] - 0x00007fdff80cf000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=8496, stack(0x00007fdfdc061000,0x00007fdfdc162000)] - 0x00007fdff80cd800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=8495, stack(0x00007fdfdc162000,0x00007fdfdc263000)] - 0x00007fdff80ca800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=8494, stack(0x00007fdfdc263000,0x00007fdfdc364000)] - 0x00007fdfbc001000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=8491, stack(0x00007fdfdc364000,0x00007fdfdc465000)] - 0x00007fdff80c8800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=8490, stack(0x00007fdfdc465000,0x00007fdfdc566000)] -=>0x00007fdff80c5000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=8487, stack(0x00007fdfdc566000,0x00007fdfdc667000)] - 0x00007fdff80b8800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=8485, stack(0x00007fdfdc86b000,0x00007fdfdc96c000)] - 0x00007fdff8086800 JavaThread "Finalizer" daemon [_thread_blocked, id=8484, stack(0x00007fdfdc96c000,0x00007fdfdca6d000)] - 0x00007fdff8082000 JavaThread "Reference Handler" daemon [_thread_blocked, id=8483, stack(0x00007fdfdca6d000,0x00007fdfdcb6e000)] - 0x00007fdff800c800 JavaThread "main" [_thread_blocked, id=8477, stack(0x00007fdfffe41000,0x00007fdffff42000)] - -Other Threads: - 0x00007fdff807a000 VMThread [stack: 0x00007fdfdcb6e000,0x00007fdfdcc6f000] [id=8482] - 0x00007fdff80d6000 WatcherThread [stack: 0x00007fdfa7dfe000,0x00007fdfa7eff000] [id=8498] - -VM state:not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap: - PSYoungGen total 625152K, used 99173K [0x00000000d6c00000, 0x0000000100000000, 0x0000000100000000) - eden space 605184K, 16% used [0x00000000d6c00000,0x00000000dccd96b8,0x00000000fbb00000) - from space 19968K, 0% used [0x00000000fec80000,0x00000000fec80000,0x0000000100000000) - to space 35328K, 0% used [0x00000000fbb00000,0x00000000fbb00000,0x00000000fdd80000) - ParOldGen total 124416K, used 62214K [0x0000000084400000, 0x000000008bd80000, 0x00000000d6c00000) - object space 124416K, 50% used [0x0000000084400000,0x00000000880c18e8,0x000000008bd80000) - Metaspace used 22413K, capacity 24248K, committed 24448K, reserved 1071104K - class space used 2498K, capacity 3099K, committed 3200K, reserved 1048576K - -Card table byte_map: [0x00007fdffca2b000,0x00007fdffce0a000] byte_map_base: 0x00007fdffc609000 - -Marking Bits: (ParMarkBitMap*) 0x00007fdfff32e100 - Begin Bits: [0x00007fdfde75c000, 0x00007fdfe064c000) - End Bits: [0x00007fdfe064c000, 0x00007fdfe253c000) - -Polling page: 0x00007fdffff6f000 - -CodeCache: size=245760Kb used=12916Kb max_used=12994Kb free=232843Kb - bounds [0x00007fdfe253c000, 0x00007fdfe321c000, 0x00007fdff153c000] - total_blobs=3652 nmethods=3234 adapters=338 - compilation: enabled - -Compilation events (10 events): -Event: 30,653 Thread 0x00007fdff80cd800 nmethod 3946 0x00007fdfe2a452d0 code [0x00007fdfe2a45540, 0x00007fdfe2a46768] -Event: 30,653 Thread 0x00007fdff80cd800 3937 4 java.io.DataOutputStream::writeByte (14 bytes) -Event: 30,654 Thread 0x00007fdff80cd800 nmethod 3937 0x00007fdfe2b5a910 code [0x00007fdfe2b5aa60, 0x00007fdfe2b5ab18] -Event: 30,654 Thread 0x00007fdff80cd800 3940 ! 4 org.eclipse.osgi.container.ModuleRevisions::isUninstalled (17 bytes) -Event: 30,654 Thread 0x00007fdff80cd800 nmethod 3940 0x00007fdfe2a42010 code [0x00007fdfe2a42160, 0x00007fdfe2a423b8] -Event: 30,654 Thread 0x00007fdff80cd800 3935 4 org.eclipse.osgi.container.ModuleDatabase$Persistence::writeQualifier (19 bytes) -Event: 30,656 Thread 0x00007fdff80cd800 nmethod 3935 0x00007fdfe28c1350 code [0x00007fdfe28c14e0, 0x00007fdfe28c1778] -Event: 31,107 Thread 0x00007fdff80ca800 nmethod 3932 0x00007fdfe31f5fd0 code [0x00007fdfe31f6fc0, 0x00007fdfe3206df0] -Event: 438,466 Thread 0x00007fdff80cf000 3947 1 org.eclipse.core.internal.jobs.InternalJob::previous (5 bytes) -Event: 438,467 Thread 0x00007fdff80cf000 nmethod 3947 0x00007fdfe28c1010 code [0x00007fdfe28c1160, 0x00007fdfe28c1270] - -GC Heap History (10 events): -Event: 3,602 GC heap before -{Heap before GC invocations=11 (full 0): - PSYoungGen total 420864K, used 403648K [0x00000000d6c00000, 0x00000000f1c00000, 0x0000000100000000) - eden space 402432K, 100% used [0x00000000d6c00000,0x00000000ef500000,0x00000000ef500000) - from space 18432K, 6% used [0x00000000f0800000,0x00000000f0930000,0x00000000f1a00000) - to space 19456K, 0% used [0x00000000ef500000,0x00000000ef500000,0x00000000f0800000) - ParOldGen total 84992K, used 38011K [0x0000000084400000, 0x0000000089700000, 0x00000000d6c00000) - object space 84992K, 44% used [0x0000000084400000,0x000000008691eff0,0x0000000089700000) - Metaspace used 9048K, capacity 9240K, committed 9472K, reserved 1058816K - class space used 892K, capacity 930K, committed 1024K, reserved 1048576K -Event: 3,617 GC heap after -Heap after GC invocations=11 (full 0): - PSYoungGen total 421888K, used 4672K [0x00000000d6c00000, 0x0000000100000000, 0x0000000100000000) - eden space 402432K, 0% used [0x00000000d6c00000,0x00000000d6c00000,0x00000000ef500000) - from space 19456K, 24% used [0x00000000ef500000,0x00000000ef990000,0x00000000f0800000) - to space 19456K, 0% used [0x00000000fed00000,0x00000000fed00000,0x0000000100000000) - ParOldGen total 84992K, used 38468K [0x0000000084400000, 0x0000000089700000, 0x00000000d6c00000) - object space 84992K, 45% used [0x0000000084400000,0x0000000086991010,0x0000000089700000) - Metaspace used 9048K, capacity 9240K, committed 9472K, reserved 1058816K - class space used 892K, capacity 930K, committed 1024K, reserved 1048576K -} -Event: 4,081 GC heap before -{Heap before GC invocations=12 (full 0): - PSYoungGen total 421888K, used 407104K [0x00000000d6c00000, 0x0000000100000000, 0x0000000100000000) - eden space 402432K, 100% used [0x00000000d6c00000,0x00000000ef500000,0x00000000ef500000) - from space 19456K, 24% used [0x00000000ef500000,0x00000000ef990000,0x00000000f0800000) - to space 19456K, 0% used [0x00000000fed00000,0x00000000fed00000,0x0000000100000000) - ParOldGen total 84992K, used 38468K [0x0000000084400000, 0x0000000089700000, 0x00000000d6c00000) - object space 84992K, 45% used [0x0000000084400000,0x0000000086991010,0x0000000089700000) - Metaspace used 9064K, capacity 9240K, committed 9472K, reserved 1058816K - class space used 892K, capacity 930K, committed 1024K, reserved 1048576K -Event: 4,086 GC heap after -Heap after GC invocations=12 (full 0): - PSYoungGen total 655360K, used 7936K [0x00000000d6c00000, 0x00000000fff00000, 0x0000000100000000) - eden space 636928K, 0% used [0x00000000d6c00000,0x00000000d6c00000,0x00000000fda00000) - from space 18432K, 43% used [0x00000000fed00000,0x00000000ff4c0000,0x00000000fff00000) - to space 18944K, 0% used [0x00000000fda00000,0x00000000fda00000,0x00000000fec80000) - ParOldGen total 84992K, used 38916K [0x0000000084400000, 0x0000000089700000, 0x00000000d6c00000) - object space 84992K, 45% used [0x0000000084400000,0x0000000086a01010,0x0000000089700000) - Metaspace used 9064K, capacity 9240K, committed 9472K, reserved 1058816K - class space used 892K, capacity 930K, committed 1024K, reserved 1048576K -} -Event: 4,826 GC heap before -{Heap before GC invocations=13 (full 0): - PSYoungGen total 655360K, used 644864K [0x00000000d6c00000, 0x00000000fff00000, 0x0000000100000000) - eden space 636928K, 100% used [0x00000000d6c00000,0x00000000fda00000,0x00000000fda00000) - from space 18432K, 43% used [0x00000000fed00000,0x00000000ff4c0000,0x00000000fff00000) - to space 18944K, 0% used [0x00000000fda00000,0x00000000fda00000,0x00000000fec80000) - ParOldGen total 84992K, used 38916K [0x0000000084400000, 0x0000000089700000, 0x00000000d6c00000) - object space 84992K, 45% used [0x0000000084400000,0x0000000086a01010,0x0000000089700000) - Metaspace used 9064K, capacity 9240K, committed 9472K, reserved 1058816K - class space used 892K, capacity 930K, committed 1024K, reserved 1048576K -Event: 4,839 GC heap after -Heap after GC invocations=13 (full 0): - PSYoungGen total 655872K, used 18944K [0x00000000d6c00000, 0x0000000100000000, 0x0000000100000000) - eden space 636928K, 0% used [0x00000000d6c00000,0x00000000d6c00000,0x00000000fda00000) - from space 18944K, 100% used [0x00000000fda00000,0x00000000fec80000,0x00000000fec80000) - to space 19968K, 0% used [0x00000000fec80000,0x00000000fec80000,0x0000000100000000) - ParOldGen total 84992K, used 45052K [0x0000000084400000, 0x0000000089700000, 0x00000000d6c00000) - object space 84992K, 53% used [0x0000000084400000,0x0000000086fff140,0x0000000089700000) - Metaspace used 9064K, capacity 9240K, committed 9472K, reserved 1058816K - class space used 892K, capacity 930K, committed 1024K, reserved 1048576K -} -Event: 8,530 GC heap before -{Heap before GC invocations=14 (full 0): - PSYoungGen total 655872K, used 565687K [0x00000000d6c00000, 0x0000000100000000, 0x0000000100000000) - eden space 636928K, 85% used [0x00000000d6c00000,0x00000000f81edd00,0x00000000fda00000) - from space 18944K, 100% used [0x00000000fda00000,0x00000000fec80000,0x00000000fec80000) - to space 19968K, 0% used [0x00000000fec80000,0x00000000fec80000,0x0000000100000000) - ParOldGen total 84992K, used 45052K [0x0000000084400000, 0x0000000089700000, 0x00000000d6c00000) - object space 84992K, 53% used [0x0000000084400000,0x0000000086fff140,0x0000000089700000) - Metaspace used 19748K, capacity 21180K, committed 21248K, reserved 1069056K - class space used 2113K, capacity 2548K, committed 2560K, reserved 1048576K -Event: 8,559 GC heap after -Heap after GC invocations=14 (full 0): - PSYoungGen total 625152K, used 19948K [0x00000000d6c00000, 0x0000000100000000, 0x0000000100000000) - eden space 605184K, 0% used [0x00000000d6c00000,0x00000000d6c00000,0x00000000fbb00000) - from space 19968K, 99% used [0x00000000fec80000,0x00000000ffffb388,0x0000000100000000) - to space 35328K, 0% used [0x00000000fbb00000,0x00000000fbb00000,0x00000000fdd80000) - ParOldGen total 84992K, used 70869K [0x0000000084400000, 0x0000000089700000, 0x00000000d6c00000) - object space 84992K, 83% used [0x0000000084400000,0x0000000088935688,0x0000000089700000) - Metaspace used 19748K, capacity 21180K, committed 21248K, reserved 1069056K - class space used 2113K, capacity 2548K, committed 2560K, reserved 1048576K -} -Event: 8,559 GC heap before -{Heap before GC invocations=15 (full 1): - PSYoungGen total 625152K, used 19948K [0x00000000d6c00000, 0x0000000100000000, 0x0000000100000000) - eden space 605184K, 0% used [0x00000000d6c00000,0x00000000d6c00000,0x00000000fbb00000) - from space 19968K, 99% used [0x00000000fec80000,0x00000000ffffb388,0x0000000100000000) - to space 35328K, 0% used [0x00000000fbb00000,0x00000000fbb00000,0x00000000fdd80000) - ParOldGen total 84992K, used 70869K [0x0000000084400000, 0x0000000089700000, 0x00000000d6c00000) - object space 84992K, 83% used [0x0000000084400000,0x0000000088935688,0x0000000089700000) - Metaspace used 19748K, capacity 21180K, committed 21248K, reserved 1069056K - class space used 2113K, capacity 2548K, committed 2560K, reserved 1048576K -Event: 8,670 GC heap after -Heap after GC invocations=15 (full 1): - PSYoungGen total 625152K, used 0K [0x00000000d6c00000, 0x0000000100000000, 0x0000000100000000) - eden space 605184K, 0% used [0x00000000d6c00000,0x00000000d6c00000,0x00000000fbb00000) - from space 19968K, 0% used [0x00000000fec80000,0x00000000fec80000,0x0000000100000000) - to space 35328K, 0% used [0x00000000fbb00000,0x00000000fbb00000,0x00000000fdd80000) - ParOldGen total 124416K, used 62214K [0x0000000084400000, 0x000000008bd80000, 0x00000000d6c00000) - object space 124416K, 50% used [0x0000000084400000,0x00000000880c18e8,0x000000008bd80000) - Metaspace used 19748K, capacity 21180K, committed 21248K, reserved 1069056K - class space used 2113K, capacity 2548K, committed 2560K, reserved 1048576K -} - -Deoptimization events (10 events): -Event: 8,785 Thread 0x00007fdff800c800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x00007fdfe2d05288 method=java.util.Collections$UnmodifiableCollection$1.(Ljava/util/Collections$UnmodifiableCollection;)V @ 17 -Event: 8,800 Thread 0x00007fdff800c800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x00007fdfe2d05288 method=java.util.Collections$UnmodifiableCollection$1.(Ljava/util/Collections$UnmodifiableCollection;)V @ 17 -Event: 8,833 Thread 0x00007fdff800c800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fdfe269effc method=java.util.Arrays.equals([B[B)Z @ 2 -Event: 14,090 Thread 0x00007fdff800c800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fdfe2897804 method=java.lang.AbstractStringBuilder.append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder; @ 1 -Event: 18,457 Thread 0x00007fdff800c800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fdfe270a034 method=java.lang.AbstractStringBuilder.append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder; @ 1 -Event: 30,461 Thread 0x00007fdff83ce000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fdfe303a79c method=java.io.BufferedOutputStream.write(I)V @ 9 -Event: 30,514 Thread 0x00007fdff83ce000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fdfe27bf070 method=sun.nio.cs.UTF_8$Encoder.encode([CII[B)I @ 33 -Event: 30,555 Thread 0x00007fdff83ce000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fdfe28c9870 method=org.osgi.framework.Version.equals(Ljava/lang/Object;)Z @ 51 -Event: 30,555 Thread 0x00007fdff83ce000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fdfe28c8654 method=org.osgi.framework.Version.equals(Ljava/lang/Object;)Z @ 51 -Event: 30,635 Thread 0x00007fdff83ce000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fdfe2d1a998 method=java.util.concurrent.locks.AbstractQueuedSynchronizer.release(I)Z @ 14 - -Internal exceptions (10 events): -Event: 8,370 Thread 0x00007fdff800c800 Exception (0x00000000e1c48bd0) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u77/6540/hotspot/src/share/vm/prims/jni.cpp, line 709] -Event: 8,371 Thread 0x00007fdff800c800 Exception (0x00000000e1c55b48) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u77/6540/hotspot/src/share/vm/prims/jni.cpp, line 709] -Event: 8,774 Thread 0x00007fdff800c800 Exception (0x00000000d7039c60) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u77/6540/hotspot/src/share/vm/prims/jni.cpp, line 709] -Event: 8,781 Thread 0x00007fdff800c800 Exception (0x00000000d707f390) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u77/6540/hotspot/src/share/vm/prims/jni.cpp, line 709] -Event: 8,783 Thread 0x00007fdff800c800 Exception (0x00000000d7091cb8) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u77/6540/hotspot/src/share/vm/prims/jni.cpp, line 709] -Event: 8,787 Thread 0x00007fdff800c800 Exception (0x00000000d70b9e20) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u77/6540/hotspot/src/share/vm/runtime/reflection.cpp, line 1092] -Event: 8,823 Thread 0x00007fdff800c800 Exception (0x00000000d71ab0c0) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u77/6540/hotspot/src/share/vm/prims/methodHandles.cpp, line 1146] -Event: 8,825 Thread 0x00007fdff800c800 Exception (0x00000000d71b8b50) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u77/6540/hotspot/src/share/vm/prims/methodHandles.cpp, line 1146] -Event: 14,090 Thread 0x00007fdff800c800 Implicit null exception at 0x00007fdfe289722f to 0x00007fdfe28977ed -Event: 18,457 Thread 0x00007fdff800c800 Implicit null exception at 0x00007fdfe2709bb6 to 0x00007fdfe270a01d - -Events (10 events): -Event: 123,116 Executing VM operation: GetOrSetLocal -Event: 123,116 Executing VM operation: GetOrSetLocal done -Event: 318,466 Executing VM operation: RevokeBias -Event: 318,466 Executing VM operation: RevokeBias done -Event: 318,466 Executing VM operation: RevokeBias -Event: 318,466 Executing VM operation: RevokeBias done -Event: 438,467 Thread 0x00007fdff80cf000 flushing nmethod 0x00007fdfe2669190 -Event: 438,467 Thread 0x00007fdff80cf000 flushing nmethod 0x00007fdfe266fa90 -Event: 451,889 Executing VM operation: RedefineClasses -Event: 451,917 Executing VM operation: RedefineClasses done - - -Dynamic libraries: -00400000-00401000 r-xp 00000000 08:06 689477 /usr/java/jdk1.8.0_77/bin/java -00600000-00601000 rw-p 00000000 08:06 689477 /usr/java/jdk1.8.0_77/bin/java -00b1a000-00b3b000 rw-p 00000000 00:00 0 [heap] -84400000-8bd80000 rw-p 00000000 00:00 0 -8bd80000-d6c00000 ---p 00000000 00:00 0 -d6c00000-100000000 rw-p 00000000 00:00 0 -100000000-100320000 rw-p 00000000 00:00 0 -100320000-140000000 ---p 00000000 00:00 0 -7fdf64000000-7fdf64021000 rw-p 00000000 00:00 0 -7fdf64021000-7fdf68000000 ---p 00000000 00:00 0 -7fdf6c000000-7fdf6c021000 rw-p 00000000 00:00 0 -7fdf6c021000-7fdf70000000 ---p 00000000 00:00 0 -7fdf70000000-7fdf70021000 rw-p 00000000 00:00 0 -7fdf70021000-7fdf74000000 ---p 00000000 00:00 0 -7fdf74000000-7fdf74021000 rw-p 00000000 00:00 0 -7fdf74021000-7fdf78000000 ---p 00000000 00:00 0 -7fdf78000000-7fdf78031000 rw-p 00000000 00:00 0 -7fdf78031000-7fdf7c000000 ---p 00000000 00:00 0 -7fdf7c000000-7fdf7c99e000 rw-p 00000000 00:00 0 -7fdf7c99e000-7fdf80000000 ---p 00000000 00:00 0 -7fdf80000000-7fdf80021000 rw-p 00000000 00:00 0 -7fdf80021000-7fdf84000000 ---p 00000000 00:00 0 -7fdf84000000-7fdf8417b000 rw-p 00000000 00:00 0 -7fdf8417b000-7fdf88000000 ---p 00000000 00:00 0 -7fdf88000000-7fdf88021000 rw-p 00000000 00:00 0 -7fdf88021000-7fdf8c000000 ---p 00000000 00:00 0 -7fdf8c000000-7fdf8c021000 rw-p 00000000 00:00 0 -7fdf8c021000-7fdf90000000 ---p 00000000 00:00 0 -7fdf90000000-7fdf9007a000 rw-p 00000000 00:00 0 -7fdf9007a000-7fdf94000000 ---p 00000000 00:00 0 -7fdf94000000-7fdf94021000 rw-p 00000000 00:00 0 -7fdf94021000-7fdf98000000 ---p 00000000 00:00 0 -7fdf98000000-7fdf980f1000 rw-p 00000000 00:00 0 -7fdf980f1000-7fdf9c000000 ---p 00000000 00:00 0 -7fdf9c000000-7fdf9c021000 rw-p 00000000 00:00 0 -7fdf9c021000-7fdfa0000000 ---p 00000000 00:00 0 -7fdfa0000000-7fdfa0cc0000 rw-p 00000000 00:00 0 -7fdfa0cc0000-7fdfa4000000 ---p 00000000 00:00 0 -7fdfa57dd000-7fdfa57e0000 ---p 00000000 00:00 0 -7fdfa57e0000-7fdfa599e000 rw-p 00000000 00:00 0 [stack:8588] -7fdfa599e000-7fdfa5ade000 ---p 00000000 00:00 0 -7fdfa5ade000-7fdfa5cde000 rw-p 00000000 00:00 0 -7fdfa5cde000-7fdfa5ede000 rw-p 00000000 00:00 0 -7fdfa5ede000-7fdfa5ee1000 ---p 00000000 00:00 0 -7fdfa5ee1000-7fdfa61df000 rw-p 00000000 00:00 0 [stack:8523] -7fdfa61df000-7fdfa61e2000 ---p 00000000 00:00 0 -7fdfa61e2000-7fdfa62e0000 rw-p 00000000 00:00 0 [stack:8522] -7fdfa62e0000-7fdfa62e3000 ---p 00000000 00:00 0 -7fdfa62e3000-7fdfa65e1000 rw-p 00000000 00:00 0 [stack:8524] -7fdfa65e1000-7fdfa65e4000 ---p 00000000 00:00 0 -7fdfa65e4000-7fdfa66e2000 rw-p 00000000 00:00 0 [stack:8520] -7fdfa66e2000-7fdfa671f000 r--s 003a9000 08:08 2500928 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.fsmkernel.model.xtext.fsmdsl_0.1.1.201604011624.jar -7fdfa671f000-7fdfa675c000 r--s 003b2000 08:08 2496204 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.ccslmocc.model.xtext.mocdsl_0.1.1.201604011624.jar -7fdfa675c000-7fdfa695c000 rw-p 00000000 00:00 0 -7fdfa695c000-7fdfa695f000 ---p 00000000 00:00 0 -7fdfa695f000-7fdfa6a5d000 rw-p 00000000 00:00 0 [stack:8516] -7fdfa6a5d000-7fdfa6a60000 ---p 00000000 00:00 0 -7fdfa6a60000-7fdfa6d5e000 rw-p 00000000 00:00 0 [stack:8547] -7fdfa6d74000-7fdfa6d9d000 r--s 00200000 08:08 2496101 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/com.google.guava_15.0.0.v201403281430.jar -7fdfa6d9d000-7fdfa6de1000 r--s 00390000 08:08 2495336 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.ui.workbench_3.106.2.v20150204-1030.jar -7fdfa6de1000-7fdfa6e07000 r--p 00000000 08:06 926394 /usr/share/locale/fr/LC_MESSAGES/libc.mo -7fdfa6e07000-7fdfa6e18000 r--s 00155000 08:08 3540724 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/platform.jar -7fdfa6e18000-7fdfa6e4d000 r--s 003a3000 08:08 3540712 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/svnkit.jar -7fdfa6e4d000-7fdfa6e50000 ---p 00000000 00:00 0 -7fdfa6e50000-7fdfa6f4e000 rw-p 00000000 00:00 0 [stack:8510] -7fdfa6f5e000-7fdfa6fcb000 r--s 008f8000 08:08 274949 /home/zerwan/Work/git/moliz/org.modelexecution.fumldebug/lib/aspectjtools.jar -7fdfa6fcb000-7fdfa6fcd000 r--s 00008000 08:08 2500837 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.weaving.hook_1.1.100.weaving-hook-20140821.jar -7fdfa6fcd000-7fdfa6fe2000 r--s 000e5000 08:08 274950 /home/zerwan/Work/git/moliz/org.modelexecution.fumldebug/lib/moliz-core-v1.0.0.jar -7fdfa6fe2000-7fdfa6ffb000 r--s 00135000 08:08 531245 /home/zerwan/Work/git/gemoc-gits/modelanimation/framework/xdsml_framework/plugins/org.gemoc.xdsmlframework.ide.ui/lib/xercesImpl.jar -7fdfa6ffb000-7fdfa7001000 r--s 00044000 08:08 531242 /home/zerwan/Work/git/gemoc-gits/modelanimation/framework/xdsml_framework/plugins/org.gemoc.xdsmlframework.ide.ui/lib/jdom-2.0.5.jar -7fdfa7001000-7fdfa7016000 r--s 013bf000 08:08 2501935 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gemoc_language_workbench.documentation_2.1.1.201604011643.jar -7fdfa7019000-7fdfa7024000 r--s 000c1000 08:08 2501472 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.core.resources_3.9.1.v20140825-1431.jar -7fdfa7024000-7fdfa702b000 r--s 00050000 08:08 2501727 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.emf.common_2.10.1.v20150123-0348.jar -7fdfa702b000-7fdfa703d000 r--s 00111000 08:08 2498921 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.emf.ecore_2.10.2.v20150123-0348.jar -7fdfa703d000-7fdfa704d000 r--s 000ab000 08:08 3540716 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/sqljet.jar -7fdfa704d000-7fdfa7052000 r--s 000fa000 08:08 2500902 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.fsmkernel.model.xtext.fsmdsl.ui_0.1.1.201604011624.jar -7fdfa7052000-7fdfa7056000 r--s 00013000 08:08 2501119 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.fsmkernel.model.design_0.1.1.201604011624.jar -7fdfa7056000-7fdfa705d000 r--s 0001b000 08:08 2501690 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gexpressions.edit_1.0.0.201604011613.jar -7fdfa7060000-7fdfa7066000 r--s 00036000 08:08 2893960 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.junit_4.11.0.v201303080030/junit.jar -7fdfa7066000-7fdfa7068000 r--s 00011000 08:08 2501942 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar -7fdfa7068000-7fdfa706f000 r--s 00000000 08:06 22958 /usr/lib64/gconv/gconv-modules.cache -7fdfa706f000-7fdfa7071000 r--s 00002000 08:08 2496248 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.w3c.dom.events_3.0.0.draft20060413_v201105210656.jar -7fdfa7071000-7fdfa7076000 r--s 0002a000 08:08 3540713 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/svnkit-javahl.jar -7fdfa7076000-7fdfa707b000 r--s 00039000 08:08 3540710 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/trilead.jar -7fdfa707b000-7fdfa7081000 r--s 00033000 08:08 531239 /home/zerwan/Work/git/gemoc-gits/modelanimation/framework/xdsml_framework/plugins/org.gemoc.xdsmlframework.ide.ui/lib/jaxen-1.1.6.jar -7fdfa7081000-7fdfa7084000 r--s 0000f000 08:08 2501098 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.transformations.ecl2mtl.ui_0.0.1.201604011619.jar -7fdfa7084000-7fdfa7088000 r--s 00038000 08:08 2501066 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.transformations.ecl2mtl_0.0.1.201604011619.jar -7fdfa7088000-7fdfa708d000 r--s 00027000 08:08 2501307 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.fsmkernel.model_0.1.1.201604011624.jar -7fdfa708d000-7fdfa7092000 r--s 00102000 08:08 2501331 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.ccslmocc.model.xtext.mocdsl.ui_0.1.1.201604011624.jar -7fdfa7092000-7fdfa7095000 r--s 00039000 08:08 2496257 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.osgi.compatibility.state_1.0.1.v20140709-1414.jar -7fdfa7095000-7fdfa7098000 r--s 0000f000 08:08 2501849 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.ccslmocc.model.design_0.1.1.201604011624.jar -7fdfa7099000-7fdfa709b000 r--s 00007000 08:08 2495923 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.w3c.css.sac_1.3.1.v200903091627.jar -7fdfa709b000-7fdfa709d000 r--s 0000c000 08:08 2496531 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.mocc.ccslmocc.model_0.1.1.201604011624.jar -7fdfa709d000-7fdfa709f000 r--s 00015000 08:08 2495339 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gexpressions.xtext.ui_1.0.0.201604011613.jar -7fdfa709f000-7fdfa70a2000 ---p 00000000 00:00 0 -7fdfa70a2000-7fdfa71a0000 rw-p 00000000 00:00 0 [stack:8509] -7fdfa71a0000-7fdfa71b0000 r-xp 00000000 08:08 2894024 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20150204-1316/eclipse_1607.so -7fdfa71b0000-7fdfa72af000 ---p 00010000 08:08 2894024 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20150204-1316/eclipse_1607.so -7fdfa72af000-7fdfa72b1000 rw-p 0000f000 08:08 2894024 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20150204-1316/eclipse_1607.so -7fdfa72b1000-7fdfa72b4000 ---p 00000000 00:00 0 -7fdfa72b4000-7fdfa73b2000 rw-p 00000000 00:00 0 [stack:8508] -7fdfa73b2000-7fdfa73b5000 ---p 00000000 00:00 0 -7fdfa73b5000-7fdfa74b3000 rw-p 00000000 00:00 0 [stack:8507] -7fdfa74b3000-7fdfa74b6000 ---p 00000000 00:00 0 -7fdfa74b6000-7fdfa75b4000 rw-p 00000000 00:00 0 [stack:8506] -7fdfa75b4000-7fdfa75cb000 r-xp 00000000 08:06 28348 /usr/lib64/libresolv-2.22.so -7fdfa75cb000-7fdfa77cb000 ---p 00017000 08:06 28348 /usr/lib64/libresolv-2.22.so -7fdfa77cb000-7fdfa77cc000 r--p 00017000 08:06 28348 /usr/lib64/libresolv-2.22.so -7fdfa77cc000-7fdfa77cd000 rw-p 00018000 08:06 28348 /usr/lib64/libresolv-2.22.so -7fdfa77cd000-7fdfa77cf000 rw-p 00000000 00:00 0 -7fdfa77cf000-7fdfa77d4000 r-xp 00000000 08:06 27251 /usr/lib64/libnss_dns-2.22.so -7fdfa77d4000-7fdfa79d4000 ---p 00005000 08:06 27251 /usr/lib64/libnss_dns-2.22.so -7fdfa79d4000-7fdfa79d5000 r--p 00005000 08:06 27251 /usr/lib64/libnss_dns-2.22.so -7fdfa79d5000-7fdfa79d6000 rw-p 00006000 08:06 27251 /usr/lib64/libnss_dns-2.22.so -7fdfa79d6000-7fdfa79e7000 r-xp 00000000 08:06 689652 /usr/java/jdk1.8.0_77/jre/lib/amd64/libnio.so -7fdfa79e7000-7fdfa7be6000 ---p 00011000 08:06 689652 /usr/java/jdk1.8.0_77/jre/lib/amd64/libnio.so -7fdfa7be6000-7fdfa7be7000 rw-p 00010000 08:06 689652 /usr/java/jdk1.8.0_77/jre/lib/amd64/libnio.so -7fdfa7be7000-7fdfa7bfd000 r-xp 00000000 08:06 689651 /usr/java/jdk1.8.0_77/jre/lib/amd64/libnet.so -7fdfa7bfd000-7fdfa7dfd000 ---p 00016000 08:06 689651 /usr/java/jdk1.8.0_77/jre/lib/amd64/libnet.so -7fdfa7dfd000-7fdfa7dfe000 rw-p 00016000 08:06 689651 /usr/java/jdk1.8.0_77/jre/lib/amd64/libnet.so -7fdfa7dfe000-7fdfa7dff000 ---p 00000000 00:00 0 -7fdfa7dff000-7fdfa7eff000 rw-p 00000000 00:00 0 [stack:8498] -7fdfa7eff000-7fdfa7f02000 ---p 00000000 00:00 0 -7fdfa7f02000-7fdfa8000000 rw-p 00000000 00:00 0 [stack:8497] -7fdfa8000000-7fdfaa1c9000 rw-p 00000000 00:00 0 -7fdfaa1c9000-7fdfac000000 ---p 00000000 00:00 0 -7fdfac000000-7fdfadf87000 rw-p 00000000 00:00 0 -7fdfadf87000-7fdfb0000000 ---p 00000000 00:00 0 -7fdfb0000000-7fdfb0021000 rw-p 00000000 00:00 0 -7fdfb0021000-7fdfb4000000 ---p 00000000 00:00 0 -7fdfb4000000-7fdfb4021000 rw-p 00000000 00:00 0 -7fdfb4021000-7fdfb8000000 ---p 00000000 00:00 0 -7fdfb8000000-7fdfb8021000 rw-p 00000000 00:00 0 -7fdfb8021000-7fdfbc000000 ---p 00000000 00:00 0 -7fdfbc000000-7fdfbc0f2000 rw-p 00000000 00:00 0 -7fdfbc0f2000-7fdfc0000000 ---p 00000000 00:00 0 -7fdfc0000000-7fdfc0021000 rw-p 00000000 00:00 0 -7fdfc0021000-7fdfc4000000 ---p 00000000 00:00 0 -7fdfc4000000-7fdfc4021000 rw-p 00000000 00:00 0 -7fdfc4021000-7fdfc8000000 ---p 00000000 00:00 0 -7fdfc8000000-7fdfc8021000 rw-p 00000000 00:00 0 -7fdfc8021000-7fdfcc000000 ---p 00000000 00:00 0 -7fdfcc000000-7fdfcc0db000 rw-p 00000000 00:00 0 -7fdfcc0db000-7fdfd0000000 ---p 00000000 00:00 0 -7fdfd0000000-7fdfd0021000 rw-p 00000000 00:00 0 -7fdfd0021000-7fdfd4000000 ---p 00000000 00:00 0 -7fdfd4000000-7fdfd4021000 rw-p 00000000 00:00 0 -7fdfd4021000-7fdfd8000000 ---p 00000000 00:00 0 -7fdfd8000000-7fdfd8021000 rw-p 00000000 00:00 0 -7fdfd8021000-7fdfdc000000 ---p 00000000 00:00 0 -7fdfdc000000-7fdfdc001000 r--s 00005000 08:08 2501308 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.fx.osgi_2.1.0.201508240501.jar -7fdfdc002000-7fdfdc004000 r--s 00006000 08:08 2501951 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.sonatype.tycho.m2e_0.7.0.201309291400.jar -7fdfdc004000-7fdfdc006000 r--s 00007000 08:08 2501729 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.sequential_addons.multidimensional.timeline_0.1.0.201604011637.jar -7fdfdc006000-7fdfdc00a000 r--s 0001e000 08:08 2501997 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gexpressions.xtext_1.0.0.201604011613.jar -7fdfdc00a000-7fdfdc00d000 r--s 00016000 08:08 2500914 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gexpressions_0.1.0.201604011613.jar -7fdfdc00d000-7fdfdc00f000 r--s 0011b000 08:08 2501730 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gemoc_studio.branding_2.1.1.201604011643.jar -7fdfdc00f000-7fdfdc010000 r--s 0000e000 08:08 2501657 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gemoc_modeling_workbench.sample.deployer_0.1.0.201603221014.jar -7fdfdc010000-7fdfdc012000 r--s 00008000 08:08 2501738 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gemoc_heterogeneous_modeling_workbench.ui_0.1.0.201604011636.jar -7fdfdc012000-7fdfdc014000 r--s 00028000 08:08 2495342 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gel.xtext.ui_0.1.0.201604011622.jar -7fdfdc014000-7fdfdc018000 r--s 00035000 08:08 2500871 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gel.xtext_0.1.0.201604011622.jar -7fdfdc018000-7fdfdc01b000 r--s 0000e000 08:08 2500869 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gel.microgel.editor_0.1.0.201604011622.jar -7fdfdc028000-7fdfdc02b000 r--s 00011000 08:08 2496249 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.util_1.0.500.v20130404-1337.jar -7fdfdc02b000-7fdfdc02c000 r--s 00002000 08:08 2501452 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.core.filesystem.linux.x86_64_1.2.200.v20140124-1940.jar -7fdfdc02c000-7fdfdc02d000 r--s 00003000 08:08 2501087 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.core.filesystem.java7_1.0.0.v20140429-1531.jar -7fdfdc02d000-7fdfdc031000 r--s 0001e000 08:08 2501814 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.xtext.xbase.lib_2.8.4.v201508050135.jar -7fdfdc031000-7fdfdc035000 r--s 00035000 08:08 2501743 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.emf.ecore.xmi_2.10.2.v20150123-0348.jar -7fdfdc035000-7fdfdc03b000 r--s 00044000 08:08 281325 /home/zerwan/Work/git/gemoc-gits/modelanimation/trace/commons/plugins/fr.inria.diverse.trace.commons/lib/jdom-2.0.5.jar -7fdfdc03b000-7fdfdc03d000 r--s 0000d000 08:08 2496001 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.core.filesystem_1.4.100.v20140514-1614.jar -7fdfdc03d000-7fdfdc03f000 r--s 00004000 08:08 2496290 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.jdt.junit4.runtime_1.1.400.v20140314-0036.jar -7fdfdc03f000-7fdfdc042000 r--s 0000b000 08:08 2501103 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.jdt.junit.runtime_3.4.500.v20140527-1138.jar -7fdfdc042000-7fdfdc044000 r--s 00004000 08:08 2500848 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.pde.junit.runtime_3.4.400.v20140204-1740.jar -7fdfdc044000-7fdfdc046000 r--s 0000d000 08:08 2495920 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.apache.felix.gogo.command_0.10.0.v201209301215.jar -7fdfdc046000-7fdfdc04a000 r--s 00013000 08:08 2496532 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.osgi.services_3.4.0.v20140312-2051.jar -7fdfdc04a000-7fdfdc04c000 r--s 00012000 08:08 2496107 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar -7fdfdc04c000-7fdfdc04e000 r--s 0001b000 08:08 2500824 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.console_1.1.0.v20140131-1639.jar -7fdfdc04e000-7fdfdc050000 r--s 00017000 08:08 2501879 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.update.configurator_3.3.300.v20140518-1928.jar -7fdfdc050000-7fdfdc053000 r--s 0002d000 08:08 2502019 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.ds_1.4.200.v20131126-2331.jar -7fdfdc053000-7fdfdc056000 r--s 0000f000 08:08 2500905 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.ui.trace_1.0.201.v20140702-1807.jar -7fdfdc056000-7fdfdc058000 r--s 00015000 08:08 2496777 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.core.runtime.compatibility_3.2.200.v20140128-0851.jar -7fdfdc058000-7fdfdc061000 r--s 00055000 08:08 2501985 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.codehaus.groovy.eclipse.dsl_2.9.0.xx-201406301445-e44.jar -7fdfdc061000-7fdfdc064000 ---p 00000000 00:00 0 -7fdfdc064000-7fdfdc162000 rw-p 00000000 00:00 0 [stack:8496] -7fdfdc162000-7fdfdc165000 ---p 00000000 00:00 0 -7fdfdc165000-7fdfdc263000 rw-p 00000000 00:00 0 [stack:8495] -7fdfdc263000-7fdfdc266000 ---p 00000000 00:00 0 -7fdfdc266000-7fdfdc364000 rw-p 00000000 00:00 0 [stack:8494] -7fdfdc364000-7fdfdc367000 ---p 00000000 00:00 0 -7fdfdc367000-7fdfdc465000 rw-p 00000000 00:00 0 [stack:8491] -7fdfdc465000-7fdfdc468000 ---p 00000000 00:00 0 -7fdfdc468000-7fdfdc566000 rw-p 00000000 00:00 0 [stack:8490] -7fdfdc566000-7fdfdc569000 ---p 00000000 00:00 0 -7fdfdc569000-7fdfdc667000 rw-p 00000000 00:00 0 [stack:8487] -7fdfdc667000-7fdfdc66b000 r-xp 00000000 08:06 689619 /usr/java/jdk1.8.0_77/jre/lib/amd64/libdt_socket.so -7fdfdc66b000-7fdfdc86a000 ---p 00004000 08:06 689619 /usr/java/jdk1.8.0_77/jre/lib/amd64/libdt_socket.so -7fdfdc86a000-7fdfdc86b000 rw-p 00003000 08:06 689619 /usr/java/jdk1.8.0_77/jre/lib/amd64/libdt_socket.so -7fdfdc86b000-7fdfdc86e000 ---p 00000000 00:00 0 -7fdfdc86e000-7fdfdc96c000 rw-p 00000000 00:00 0 [stack:8485] -7fdfdc96c000-7fdfdc96f000 ---p 00000000 00:00 0 -7fdfdc96f000-7fdfdca6d000 rw-p 00000000 00:00 0 [stack:8484] -7fdfdca6d000-7fdfdca70000 ---p 00000000 00:00 0 -7fdfdca70000-7fdfdcb6e000 rw-p 00000000 00:00 0 [stack:8483] -7fdfdcb6e000-7fdfdcb6f000 ---p 00000000 00:00 0 -7fdfdcb6f000-7fdfe253c000 rw-p 00000000 00:00 0 [stack:8482] -7fdfe253c000-7fdfe321c000 rwxp 00000000 00:00 0 -7fdfe321c000-7fdff153c000 ---p 00000000 00:00 0 -7fdff153c000-7fdff8000000 r--p 00000000 08:06 19699 /usr/lib/locale/locale-archive -7fdff8000000-7fdff8ade000 rw-p 00000000 00:00 0 -7fdff8ade000-7fdffc000000 ---p 00000000 00:00 0 -7fdffc000000-7fdffc001000 r--s 0000e000 08:08 2501988 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.apache.felix.gogo.shell_0.10.0.v201212101605.jar -7fdffc001000-7fdffc003000 r--s 00007000 08:08 2496815 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.slf4j.api_1.7.2.v20121108-1250.jar -7fdffc003000-7fdffc004000 r--s 00007000 08:08 2501755 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.event_1.3.100.v20140115-1647.jar -7fdffc004000-7fdffc007000 r--s 00013000 08:08 2502046 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.app_1.3.200.v20130910-1609.jar -7fdffc007000-7fdffc009000 r--s 00016000 08:08 2500915 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.core.jobs_3.6.1.v20141014-1248.jar -7fdffc009000-7fdffc00d000 r--s 0001c000 08:08 2500857 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.preferences_3.5.200.v20140224-1527.jar -7fdffc00d000-7fdffc00f000 r--s 00015000 08:08 2501833 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.core.contenttype_3.4.200.v20140207-1251.jar -7fdffc00f000-7fdffc013000 r--s 00029000 08:08 2496817 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.registry_3.5.400.v20140428-1507.jar -7fdffc013000-7fdffc016000 r--s 00018000 08:08 2496242 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar -7fdffc016000-7fdffc01b000 r--s 00011000 08:08 2501309 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.w3c.dom.svg_1.1.0.v201011041433.jar -7fdffc01b000-7fdffc01c000 r--s 00003000 08:08 2496761 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.w3c.dom.smil_1.0.0.v200806040011.jar -7fdffc01c000-7fdffc021000 r--s 00037000 08:08 2501950 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.sat4j.pb_2.3.5.v201404071733.jar -7fdffc021000-7fdffc027000 r--s 00053000 08:08 2501972 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.sat4j.core_2.3.5.v201308161310.jar -7fdffc027000-7fdffc028000 r--s 00001000 08:08 3540723 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/jsch.agentproxy.usocket-nc.jar -7fdffc028000-7fdffc029000 r--s 00001000 08:08 3540722 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/jsch.agentproxy.usocket-jna.jar -7fdffc029000-7fdffc02a000 r--s 00000000 08:08 3540721 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/jsch.agentproxy.svnkit-trilead-ssh2.jar -7fdffc02a000-7fdffc02c000 r--s 00000000 08:08 3540720 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/jsch.agentproxy.sshagent.jar -7fdffc02c000-7fdffc02e000 r--s 00001000 08:08 3540718 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/jsch.agentproxy.core.jar -7fdffc02e000-7fdffc02f000 r--s 00002000 08:08 3540717 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/jsch.agentproxy.connector-factory.jar -7fdffc02f000-7fdffc033000 r--s 00025000 08:08 3540715 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/antlr-runtime.jar -7fdffc033000-7fdffc037000 r--s 000dc000 08:08 3540714 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/jna.jar -7fdffc037000-7fdffc03a000 r--s 0000f000 08:08 3540711 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/sequence.jar -7fdffc03a000-7fdffc03d000 r--s 00621000 08:08 2501340 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.polarion.eclipse.team.svn.connector.svnkit18_4.1.3.I20150214-1700.jar -7fdffc03d000-7fdffc03f000 r--s 00000000 08:08 2501264 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.polarion.eclipse.team.svn.connector_4.1.3.I20150214-1700.jar -7fdffc03f000-7fdffc043000 r--s 00019000 08:08 274948 /home/zerwan/Work/git/moliz/org.modelexecution.fumldebug/lib/aspectjrt.jar -7fdffc043000-7fdffc045000 r--s 0000c000 08:08 2501108 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.hamcrest.core_1.3.0.v201303031735.jar -7fdffc045000-7fdffc050000 r--s 0021a000 08:06 689673 /usr/java/jdk1.8.0_77/jre/lib/ext/localedata.jar -7fdffc050000-7fdffc072000 r--s 0038e000 08:06 689800 /usr/java/jdk1.8.0_77/jre/lib/ext/cldrdata.jar -7fdffc072000-7fdffc145000 rw-p 00000000 00:00 0 -7fdffc145000-7fdffc31d000 r--s 03cd6000 08:06 689685 /usr/java/jdk1.8.0_77/jre/lib/rt.jar -7fdffc31d000-7fdffc393000 rw-p 00000000 00:00 0 -7fdffc393000-7fdffc394000 ---p 00000000 00:00 0 -7fdffc394000-7fdffc494000 rw-p 00000000 00:00 0 [stack:8481] -7fdffc494000-7fdffc495000 ---p 00000000 00:00 0 -7fdffc495000-7fdffc595000 rw-p 00000000 00:00 0 [stack:8480] -7fdffc595000-7fdffc596000 ---p 00000000 00:00 0 -7fdffc596000-7fdffc696000 rw-p 00000000 00:00 0 [stack:8479] -7fdffc696000-7fdffc697000 ---p 00000000 00:00 0 -7fdffc697000-7fdffc7d4000 rw-p 00000000 00:00 0 [stack:8478] -7fdffc7d4000-7fdffca2b000 ---p 00000000 00:00 0 -7fdffca2b000-7fdffca68000 rw-p 00000000 00:00 0 -7fdffca68000-7fdffccbf000 ---p 00000000 00:00 0 -7fdffccbf000-7fdffce09000 rw-p 00000000 00:00 0 -7fdffce09000-7fdffce3e000 rw-p 00000000 00:00 0 -7fdffce3e000-7fdffd1ca000 ---p 00000000 00:00 0 -7fdffd1ca000-7fdffd1e4000 r-xp 00000000 08:06 689666 /usr/java/jdk1.8.0_77/jre/lib/amd64/libzip.so -7fdffd1e4000-7fdffd3e4000 ---p 0001a000 08:06 689666 /usr/java/jdk1.8.0_77/jre/lib/amd64/libzip.so -7fdffd3e4000-7fdffd3e5000 rw-p 0001a000 08:06 689666 /usr/java/jdk1.8.0_77/jre/lib/amd64/libzip.so -7fdffd3e5000-7fdffd3f0000 r-xp 00000000 08:06 28312 /usr/lib64/libnss_files-2.22.so -7fdffd3f0000-7fdffd5ef000 ---p 0000b000 08:06 28312 /usr/lib64/libnss_files-2.22.so -7fdffd5ef000-7fdffd5f0000 r--p 0000a000 08:06 28312 /usr/lib64/libnss_files-2.22.so -7fdffd5f0000-7fdffd5f1000 rw-p 0000b000 08:06 28312 /usr/lib64/libnss_files-2.22.so -7fdffd5f1000-7fdffd5f7000 rw-p 00000000 00:00 0 -7fdffd5f7000-7fdffd5f9000 r-xp 00000000 08:06 689654 /usr/java/jdk1.8.0_77/jre/lib/amd64/libnpt.so -7fdffd5f9000-7fdffd7f9000 ---p 00002000 08:06 689654 /usr/java/jdk1.8.0_77/jre/lib/amd64/libnpt.so -7fdffd7f9000-7fdffd7fa000 rw-p 00002000 08:06 689654 /usr/java/jdk1.8.0_77/jre/lib/amd64/libnpt.so -7fdffd7fa000-7fdffd833000 r-xp 00000000 08:06 689638 /usr/java/jdk1.8.0_77/jre/lib/amd64/libjdwp.so -7fdffd833000-7fdffda32000 ---p 00039000 08:06 689638 /usr/java/jdk1.8.0_77/jre/lib/amd64/libjdwp.so -7fdffda32000-7fdffda34000 rw-p 00038000 08:06 689638 /usr/java/jdk1.8.0_77/jre/lib/amd64/libjdwp.so -7fdffda34000-7fdffda5e000 r-xp 00000000 08:06 689630 /usr/java/jdk1.8.0_77/jre/lib/amd64/libjava.so -7fdffda5e000-7fdffdc5e000 ---p 0002a000 08:06 689630 /usr/java/jdk1.8.0_77/jre/lib/amd64/libjava.so -7fdffdc5e000-7fdffdc60000 rw-p 0002a000 08:06 689630 /usr/java/jdk1.8.0_77/jre/lib/amd64/libjava.so -7fdffdc60000-7fdffdc6d000 r-xp 00000000 08:06 689665 /usr/java/jdk1.8.0_77/jre/lib/amd64/libverify.so -7fdffdc6d000-7fdffde6d000 ---p 0000d000 08:06 689665 /usr/java/jdk1.8.0_77/jre/lib/amd64/libverify.so -7fdffde6d000-7fdffde6f000 rw-p 0000d000 08:06 689665 /usr/java/jdk1.8.0_77/jre/lib/amd64/libverify.so -7fdffde6f000-7fdffde76000 r-xp 00000000 08:06 28360 /usr/lib64/librt-2.22.so -7fdffde76000-7fdffe075000 ---p 00007000 08:06 28360 /usr/lib64/librt-2.22.so -7fdffe075000-7fdffe076000 r--p 00006000 08:06 28360 /usr/lib64/librt-2.22.so -7fdffe076000-7fdffe077000 rw-p 00007000 08:06 28360 /usr/lib64/librt-2.22.so -7fdffe077000-7fdffe178000 r-xp 00000000 08:06 26141 /usr/lib64/libm-2.22.so -7fdffe178000-7fdffe377000 ---p 00101000 08:06 26141 /usr/lib64/libm-2.22.so -7fdffe377000-7fdffe378000 r--p 00100000 08:06 26141 /usr/lib64/libm-2.22.so -7fdffe378000-7fdffe379000 rw-p 00101000 08:06 26141 /usr/lib64/libm-2.22.so -7fdffe379000-7fdfff038000 r-xp 00000000 08:06 689670 /usr/java/jdk1.8.0_77/jre/lib/amd64/server/libjvm.so -7fdfff038000-7fdfff237000 ---p 00cbf000 08:06 689670 /usr/java/jdk1.8.0_77/jre/lib/amd64/server/libjvm.so -7fdfff237000-7fdfff310000 rw-p 00cbe000 08:06 689670 /usr/java/jdk1.8.0_77/jre/lib/amd64/server/libjvm.so -7fdfff310000-7fdfff359000 rw-p 00000000 00:00 0 -7fdfff359000-7fdfff510000 r-xp 00000000 08:06 24388 /usr/lib64/libc-2.22.so -7fdfff510000-7fdfff710000 ---p 001b7000 08:06 24388 /usr/lib64/libc-2.22.so -7fdfff710000-7fdfff714000 r--p 001b7000 08:06 24388 /usr/lib64/libc-2.22.so -7fdfff714000-7fdfff716000 rw-p 001bb000 08:06 24388 /usr/lib64/libc-2.22.so -7fdfff716000-7fdfff71a000 rw-p 00000000 00:00 0 -7fdfff71a000-7fdfff71d000 r-xp 00000000 08:06 25765 /usr/lib64/libdl-2.22.so -7fdfff71d000-7fdfff91c000 ---p 00003000 08:06 25765 /usr/lib64/libdl-2.22.so -7fdfff91c000-7fdfff91d000 r--p 00002000 08:06 25765 /usr/lib64/libdl-2.22.so -7fdfff91d000-7fdfff91e000 rw-p 00003000 08:06 25765 /usr/lib64/libdl-2.22.so -7fdfff91e000-7fdfff933000 r-xp 00000000 08:06 689943 /usr/java/jdk1.8.0_77/lib/amd64/jli/libjli.so -7fdfff933000-7fdfffb33000 ---p 00015000 08:06 689943 /usr/java/jdk1.8.0_77/lib/amd64/jli/libjli.so -7fdfffb33000-7fdfffb34000 rw-p 00015000 08:06 689943 /usr/java/jdk1.8.0_77/lib/amd64/jli/libjli.so -7fdfffb34000-7fdfffb4c000 r-xp 00000000 08:06 22942 /usr/lib64/libpthread-2.22.so -7fdfffb4c000-7fdfffd4b000 ---p 00018000 08:06 22942 /usr/lib64/libpthread-2.22.so -7fdfffd4b000-7fdfffd4c000 r--p 00017000 08:06 22942 /usr/lib64/libpthread-2.22.so -7fdfffd4c000-7fdfffd4d000 rw-p 00018000 08:06 22942 /usr/lib64/libpthread-2.22.so -7fdfffd4d000-7fdfffd51000 rw-p 00000000 00:00 0 -7fdfffd51000-7fdfffd72000 r-xp 00000000 08:06 19680 /usr/lib64/ld-2.22.so -7fdfffd72000-7fdfffd74000 r--s 00002000 08:08 2896216 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/runtime_registry_compatibility.jar -7fdfffd74000-7fdfffd75000 r--s 00001000 08:08 3540719 /home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/871/0/.cp/lib/jsch.agentproxy.pageant.jar -7fdfffd75000-7fdfffd76000 r--s 00009000 08:08 2496244 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.objectweb.asm.tree_5.0.1.v201404251740.jar -7fdfffd76000-7fdfffe41000 rw-p 00000000 00:00 0 -7fdfffe41000-7fdfffe44000 ---p 00000000 00:00 0 -7fdfffe44000-7fdffff46000 rw-p 00000000 00:00 0 [stack:8477] -7fdffff46000-7fdffff48000 r--s 006bd000 08:08 2501085 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.gemoc.gemoc_language_workbench.sample.deployer_0.1.0.201603221014.jar -7fdffff48000-7fdffff49000 r--s 0000f000 08:08 2496282 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.objectweb.asm_5.0.1.v201404251740.jar -7fdffff49000-7fdffff5d000 r--s 00121000 08:08 2500779 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.osgi_3.10.2.v20150203-1939.jar -7fdffff5d000-7fdffff5f000 r--s 0001a000 08:06 689852 /usr/java/jdk1.8.0_77/jre/lib/jce.jar -7fdffff5f000-7fdffff64000 r--s 00096000 08:06 689923 /usr/java/jdk1.8.0_77/jre/lib/jsse.jar -7fdffff64000-7fdffff66000 r--s 0000b000 08:08 2501088 /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -7fdffff66000-7fdffff6e000 rw-s 00000000 00:25 257731 /tmp/hsperfdata_zerwan/8464 -7fdffff6e000-7fdffff6f000 rw-p 00000000 00:00 0 -7fdffff6f000-7fdffff70000 r--p 00000000 00:00 0 -7fdffff70000-7fdffff71000 rw-p 00000000 00:00 0 -7fdffff71000-7fdffff72000 r--p 00020000 08:06 19680 /usr/lib64/ld-2.22.so -7fdffff72000-7fdffff73000 rw-p 00021000 08:06 19680 /usr/lib64/ld-2.22.so -7fdffff73000-7fdffff74000 rw-p 00000000 00:00 0 -7ffd9104a000-7ffd9106b000 rw-p 00000000 00:00 0 [stack] -7ffd910da000-7ffd910dc000 r--p 00000000 00:00 0 [vvar] -7ffd910dc000-7ffd910de000 r-xp 00000000 00:00 0 [vdso] -ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] - -VM Arguments: -jvm_args: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:39609 -Declipse.pde.launch=true -Declipse.p2.data.area=@config.dir/p2 -Dfile.encoding=UTF-8 -java_command: org.eclipse.equinox.launcher.Main -os linux -ws gtk -arch x86_64 -nl fr_FR -consoleLog -version 3 -port 38527 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -test fr.inria.diverse.trace.metamodel.test.TraceMMGeneratorTest:testModel1 -application org.eclipse.pde.junit.runtime.coretestapplication -data /home/zerwan/Work/dev/ws-studio3/../junit-workspace -configuration file:/home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/ -dev file:/home/zerwan/Work/dev/ws-studio3/.metadata/.plugins/org.eclipse.pde.core/pde-junit/dev.properties -os linux -ws gtk -arch x86_64 -nl fr_FR -consoleLog -testpluginname fr.inria.diverse.trace.metamodel.generator.test -java_class_path (initial): /home/zerwan/Work/Applications/gemoc_studio-linux.gtk.x86_64/plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -Launcher Type: SUN_STANDARD - -Environment Variables: -PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin -USERNAME=zerwan -SHELL=/bin/zsh -DISPLAY=:1 - -Signal Handlers: -SIGSEGV: [libjvm.so+0xabb070], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGBUS: [libjvm.so+0xabb070], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGFPE: [libjvm.so+0x918480], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGPIPE: [libjvm.so+0x918480], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGXFSZ: [libjvm.so+0x918480], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGILL: [libjvm.so+0x918480], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none -SIGUSR2: [libjvm.so+0x919ab0], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO -SIGHUP: [libjvm.so+0x91aeb0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGINT: [libjvm.so+0x91aeb0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGTERM: [libjvm.so+0x91aeb0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGQUIT: [libjvm.so+0x91aeb0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO - - ---------------- S Y S T E M --------------- - -OS:Fedora release 23 (Twenty Three) - -uname:Linux 4.4.6-300.fc23.x86_64 #1 SMP Wed Mar 16 22:10:37 UTC 2016 x86_64 -libc:glibc 2.22 NPTL 2.22 -rlimit: STACK 8192k, CORE 0k, NPROC 31593, NOFILE 4096, AS infinity -load average:0,39 0,92 1,00 - -/proc/meminfo: -MemTotal: 8107124 kB -MemFree: 599776 kB -MemAvailable: 1363176 kB -Buffers: 76564 kB -Cached: 661592 kB -SwapCached: 5040 kB -Active: 5773388 kB -Inactive: 1315872 kB -Active(anon): 5166844 kB -Inactive(anon): 1238728 kB -Active(file): 606544 kB -Inactive(file): 77144 kB -Unevictable: 64 kB -Mlocked: 64 kB -SwapTotal: 10239996 kB -SwapFree: 9981768 kB -Dirty: 836 kB -Writeback: 0 kB -AnonPages: 6346712 kB -Mapped: 369124 kB -Shmem: 54152 kB -Slab: 196816 kB -SReclaimable: 122096 kB -SUnreclaim: 74720 kB -KernelStack: 13744 kB -PageTables: 70220 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -WritebackTmp: 0 kB -CommitLimit: 14293556 kB -Committed_AS: 12781420 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 0 kB -VmallocChunk: 0 kB -HardwareCorrupted: 0 kB -AnonHugePages: 0 kB -CmaTotal: 0 kB -CmaFree: 0 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -HugePages_Surp: 0 -Hugepagesize: 2048 kB -DirectMap4k: 377672 kB -DirectMap2M: 7942144 kB - - -CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, aes, clmul, erms, tsc, tscinvbit, tscinv - -/proc/cpuinfo: -processor : 0 -vendor_id : GenuineIntel -cpu family : 6 -model : 58 -model name : Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz -stepping : 9 -microcode : 0x1c -cpu MHz : 3599.882 -cache size : 6144 KB -physical id : 0 -siblings : 4 -core id : 0 -cpu cores : 4 -apicid : 0 -initial apicid : 0 -fpu : yes -fpu_exception : yes -cpuid level : 13 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt -bugs : -bogomips : 6799.97 -clflush size : 64 -cache_alignment : 64 -address sizes : 36 bits physical, 48 bits virtual -power management: - -processor : 1 -vendor_id : GenuineIntel -cpu family : 6 -model : 58 -model name : Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz -stepping : 9 -microcode : 0x1c -cpu MHz : 3599.882 -cache size : 6144 KB -physical id : 0 -siblings : 4 -core id : 1 -cpu cores : 4 -apicid : 2 -initial apicid : 2 -fpu : yes -fpu_exception : yes -cpuid level : 13 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt -bugs : -bogomips : 6799.97 -clflush size : 64 -cache_alignment : 64 -address sizes : 36 bits physical, 48 bits virtual -power management: - -processor : 2 -vendor_id : GenuineIntel -cpu family : 6 -model : 58 -model name : Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz -stepping : 9 -microcode : 0x1c -cpu MHz : 3599.882 -cache size : 6144 KB -physical id : 0 -siblings : 4 -core id : 2 -cpu cores : 4 -apicid : 4 -initial apicid : 4 -fpu : yes -fpu_exception : yes -cpuid level : 13 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt -bugs : -bogomips : 6799.97 -clflush size : 64 -cache_alignment : 64 -address sizes : 36 bits physical, 48 bits virtual -power management: - -processor : 3 -vendor_id : GenuineIntel -cpu family : 6 -model : 58 -model name : Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz -stepping : 9 -microcode : 0x1c -cpu MHz : 3599.882 -cache size : 6144 KB -physical id : 0 -siblings : 4 -core id : 3 -cpu cores : 4 -apicid : 6 -initial apicid : 6 -fpu : yes -fpu_exception : yes -cpuid level : 13 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt -bugs : -bogomips : 6799.97 -clflush size : 64 -cache_alignment : 64 -address sizes : 36 bits physical, 48 bits virtual -power management: - - - -Memory: 4k page, physical 8107124k(599776k free), swap 10239996k(9981768k free) - -vm_info: Java HotSpot(TM) 64-Bit Server VM (25.77-b03) for linux-amd64 JRE (1.8.0_77-b03), built on Mar 20 2016 22:00:46 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8) - -time: Tue Apr 5 15:58:49 2016 -elapsed time: 451 seconds (0d 0h 7m 31s) - From 749e07cb5d56c8107672a59c225bc07ad02b385b Mon Sep 17 00:00:00 2001 From: d-leroy Date: Mon, 24 Jul 2017 10:07:59 +0200 Subject: [PATCH 22/31] [Event Metamodel] updated event metamodel --- .../event/AbstractEventManager.java | 12 +- .../property/IPropertyMonitor.java | 4 +- .../interpreter/property/PropertyMonitor.java | 22 +- .../property/propertyAspects.xtend | 24 +- .../interpreter/scenario/ArbiterManager.java | 21 +- .../interpreter/scenario/ScenarioManager.java | 40 +- .../META-INF/MANIFEST.MF | 2 +- ...ralProperty_formula_CompositeProperty.gif} | Bin 223 -> 223 bytes ...rty_formula_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...oralProperty_formula_EventPrecondition.gif | Bin 0 -> 223 bytes ...y_formula_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...y_formula_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...ty_formula_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...oralProperty_formula_PropertyReference.gif | Bin 0 -> 223 bytes ...eNextProperty_formula_AbstractProperty.gif | Bin 0 -> 223 bytes ...NextProperty_formula_CompositeProperty.gif | Bin 0 -> 223 bytes ...rty_formula_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...NextProperty_formula_EventPrecondition.gif | Bin 0 -> 223 bytes ...y_formula_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...y_formula_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...ty_formula_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...NextProperty_formula_PropertyReference.gif | Bin 0 -> 223 bytes ...eProperty_leftFormula_AbstractProperty.gif | Bin 0 -> 223 bytes ...Property_leftFormula_CompositeProperty.gif | Bin 0 -> 223 bytes ...leftFormula_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...Property_leftFormula_EventPrecondition.gif | Bin 0 -> 223 bytes ...ftFormula_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...ftFormula_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...eftFormula_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...Property_leftFormula_PropertyReference.gif | Bin 0 -> 223 bytes ...Property_rightFormula_AbstractProperty.gif | Bin 0 -> 223 bytes ...roperty_rightFormula_CompositeProperty.gif | Bin 0 -> 223 bytes ...ightFormula_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...roperty_rightFormula_EventPrecondition.gif | Bin 0 -> 223 bytes ...htFormula_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...htFormula_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...ghtFormula_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...roperty_rightFormula_PropertyReference.gif | Bin 0 -> 223 bytes ...ty_property_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ..._property_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ..._property_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...y_property_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...lProperty_leftFormula_AbstractProperty.gif | Bin 0 -> 223 bytes ...Property_leftFormula_CompositeProperty.gif | Bin 0 -> 223 bytes ...leftFormula_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...Property_leftFormula_EventPrecondition.gif | Bin 0 -> 223 bytes ...ftFormula_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...ftFormula_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...eftFormula_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...Property_leftFormula_PropertyReference.gif | Bin 0 -> 223 bytes ...Property_rightFormula_AbstractProperty.gif | Bin 0 -> 223 bytes ...roperty_rightFormula_CompositeProperty.gif | Bin 0 -> 223 bytes ...ightFormula_ContainerReferenceProperty.gif | Bin 0 -> 223 bytes ...roperty_rightFormula_EventPrecondition.gif | Bin 0 -> 223 bytes ...htFormula_ManyBooleanAttributeProperty.gif | Bin 0 -> 223 bytes ...htFormula_ManyIntegerAttributeProperty.gif | Bin 0 -> 223 bytes ...ghtFormula_ManyStringAttributeProperty.gif | Bin 0 -> 223 bytes ...roperty_rightFormula_PropertyReference.gif | Bin 0 -> 223 bytes .../{EventReport.gif => AbstractProperty.gif} | Bin 129 -> 129 bytes .../full/obj16/{Report.gif => Arbiter.gif} | Bin 129 -> 129 bytes .../icons/full/obj16/State.gif | Bin 0 -> 129 bytes .../icons/full/obj16/Transition.gif | Bin 0 -> 129 bytes .../plugin.properties | 46 +- .../plugin.xml | 6 +- .../provider/ArbiterEditPlugin.java} | 10 +- .../provider/ArbiterItemProvider.java} | 58 +- .../ArbiterItemProviderAdapterFactory.java} | 56 +- .../provider/StateItemProvider.java} | 93 +- .../provider/TransitionItemProvider.java | 192 ++ .../AbstractPropertyItemProvider.java | 120 ++ .../CompositePropertyItemProvider.java | 10 +- .../NegationTemporalPropertyItemProvider.java | 125 ++ .../provider/NextPropertyItemProvider.java | 166 ++ .../provider/PropertyItemProvider.java | 28 +- .../PropertyItemProviderAdapterFactory.java | 72 +- .../provider/ReleasePropertyItemProvider.java | 231 +++ .../provider/StepPropertyItemProvider.java | 1 + .../TemporalPropertyItemProvider.java | 83 + .../provider/UnaryPropertyItemProvider.java | 179 ++ .../provider/UntilPropertyItemProvider.java | 231 +++ .../provider/ArbiterStateItemProvider.java | 1 + .../ArbiterTransitionItemProvider.java | 10 +- .../provider/ScenarioElementItemProvider.java | 10 +- .../ScenarioFSMTransitionItemProvider.java | 10 +- .../META-INF/MANIFEST.MF | 4 +- .../icons/full/obj16/ReportModelFile.gif | Bin 346 -> 0 bytes .../icons/full/wizban/NewReport.gif | Bin 2462 -> 0 bytes .../plugin.properties | 12 +- .../plugin.xml | 27 - .../presentation/ArbiterEditorPlugin.java} | 10 +- .../ReportActionBarContributor.java | 423 ---- .../report/presentation/ReportEditor.java | 1828 ----------------- .../presentation/ReportModelWizard.java | 628 ------ .../presentation/ScenarioModelWizard.java | 3 +- .../META-INF/MANIFEST.MF | 5 +- .../model/property.ecore | 236 ++- .../model/scenario.ecore | 228 +- .../event/commons/model/arbiter/Arbiter.java | 86 + .../commons/model/arbiter/ArbiterFactory.java | 33 + .../commons/model/arbiter/ArbiterPackage.java | 512 +++++ .../event/commons/model/arbiter/State.java | 93 + .../commons/model/arbiter/Transition.java | 110 + .../commons/model/arbiter/TruthValue.java | 241 +++ .../arbiter/impl/ArbiterFactoryImpl.java | 135 ++ .../model/arbiter/impl/ArbiterImpl.java | 254 +++ .../arbiter/impl/ArbiterPackageImpl.java | 387 ++++ .../commons/model/arbiter/impl/StateImpl.java | 278 +++ .../model/arbiter/impl/TransitionImpl.java | 370 ++++ .../arbiter/util/ArbiterAdapterFactory.java | 158 ++ .../model/arbiter/util/ArbiterSwitch.java | 154 ++ .../model/property/AbstractProperty.java | 18 + .../property/BooleanAttributeProperty.java | 12 +- .../model/property/ComparisonOperator.java | 187 ++ .../model/property/CompositeProperty.java | 5 +- .../model/property/EventPrecondition.java | 6 +- .../property/IntegerAttributeProperty.java | 12 +- .../ManyBooleanAttributeProperty.java | 12 +- .../ManyIntegerAttributeProperty.java | 12 +- .../property/ManyStringAttributeProperty.java | 12 +- .../model/property/NegationProperty.java | 49 + .../property/NegationTemporalProperty.java | 49 + .../commons/model/property/NextProperty.java | 49 + .../commons/model/property/Property.java | 4 +- .../model/property/PropertyFactory.java | 36 +- .../model/property/PropertyPackage.java | 974 +++++++-- .../model/property/PropertyReference.java | 6 +- .../model/property/ReleaseProperty.java | 76 + .../property/StringAttributeProperty.java | 12 +- .../model/property/TemporalProperty.java | 16 + .../commons/model/property/UnaryOperator.java | 187 ++ .../commons/model/property/UnaryProperty.java | 79 + .../commons/model/property/UntilProperty.java | 76 + .../property/impl/AbstractPropertyImpl.java | 39 + .../impl/BooleanAttributePropertyImpl.java | 14 +- .../property/impl/CompositePropertyImpl.java | 10 +- .../property/impl/EventPreconditionImpl.java | 20 +- .../impl/IntegerAttributePropertyImpl.java | 14 +- .../ManyBooleanAttributePropertyImpl.java | 14 +- .../ManyIntegerAttributePropertyImpl.java | 14 +- .../impl/ManyStringAttributePropertyImpl.java | 14 +- .../impl/NegationTemporalPropertyImpl.java | 176 ++ .../model/property/impl/NextPropertyImpl.java | 175 ++ .../property/impl/PropertyFactoryImpl.java | 84 +- .../model/property/impl/PropertyImpl.java | 4 +- .../property/impl/PropertyPackageImpl.java | 408 +++- .../property/impl/PropertyReferenceImpl.java | 20 +- .../property/impl/ReleasePropertyImpl.java | 241 +++ .../impl/StringAttributePropertyImpl.java | 14 +- .../property/impl/TemporalPropertyImpl.java | 37 + .../property/impl/UnaryPropertyImpl.java | 256 +++ .../property/impl/UntilPropertyImpl.java | 242 +++ .../property/util/PropertyAdapterFactory.java | 147 +- .../model/property/util/PropertySwitch.java | 214 +- .../views/EventManagerRenderer.java | 2 + .../eventmanager/views/EventTableView.java | 1 - 155 files changed, 8308 insertions(+), 3819 deletions(-) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/{CreateReport_events_EventReport.gif => CreateNegationTemporalProperty_formula_CompositeProperty.gif} (71%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_EventPrecondition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_PropertyReference.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_AbstractProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_CompositeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_EventPrecondition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_PropertyReference.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_AbstractProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_CompositeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_EventPrecondition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_PropertyReference.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_AbstractProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_CompositeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_EventPrecondition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_PropertyReference.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUnaryProperty_property_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUnaryProperty_property_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUnaryProperty_property_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUnaryProperty_property_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_AbstractProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_CompositeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_EventPrecondition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_PropertyReference.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_AbstractProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_CompositeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_ContainerReferenceProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_EventPrecondition.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_ManyBooleanAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_ManyIntegerAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_ManyStringAttributeProperty.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_PropertyReference.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{EventReport.gif => AbstractProperty.gif} (50%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/{Report.gif => Arbiter.gif} (50%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/State.gif create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Transition.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/ReportEditPlugin.java => arbiter/provider/ArbiterEditPlugin.java} (86%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/ReportItemProvider.java => arbiter/provider/ArbiterItemProvider.java} (72%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/ReportItemProviderAdapterFactory.java => arbiter/provider/ArbiterItemProviderAdapterFactory.java} (73%) rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/{report/provider/EventReportItemProvider.java => arbiter/provider/StateItemProvider.java} (62%) create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/TransitionItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/AbstractPropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/NegationTemporalPropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/NextPropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ReleasePropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/TemporalPropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/UnaryPropertyItemProvider.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/UntilPropertyItemProvider.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif rename framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/{report/presentation/ReportEditorPlugin.java => arbiter/presentation/ArbiterEditorPlugin.java} (86%) delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java delete mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/AbstractProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ComparisonOperator.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NegationProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NegationTemporalProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NextProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ReleaseProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/TemporalProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UnaryOperator.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UnaryProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UntilProperty.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/AbstractPropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/NegationTemporalPropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/NextPropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ReleasePropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/TemporalPropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/UnaryPropertyImpl.java create mode 100644 framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/UntilPropertyImpl.java diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java index 6d8492cca..fa356cda5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/event/AbstractEventManager.java @@ -42,7 +42,7 @@ public abstract class AbstractEventManager implements IEventManager { protected ScenarioManager scenarioManager; protected ArbiterManager arbiterManager; - + @Override public void sendEvent(Object input) { if (input instanceof EventInstance) { @@ -112,7 +112,7 @@ public void waitForEvents() { } private Scenario pendingScenario; - + private Arbiter pendingArbiter; @Override @@ -126,7 +126,7 @@ public void loadScenario(URI uri, ResourceSet resourceSet) { pendingScenario = (Scenario) resource.getContents().get(0); } } - + @Override public void loadArbiter(URI uri, ResourceSet resourceSet) { Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); @@ -149,7 +149,7 @@ public void engineAboutToStart(IExecutionEngine engine) { if (monitor != null) { scenarioManager = new ScenarioManager(executedModel, this, monitor); } else { - + } } if (pendingArbiter != null) { @@ -157,7 +157,7 @@ public void engineAboutToStart(IExecutionEngine engine) { if (monitor != null) { arbiterManager = new ArbiterManager(monitor); } else { - + } } } @@ -175,7 +175,7 @@ public void engineStarted(IExecutionEngine executionEngine) { } if (pendingArbiter != null) { arbiterManager.loadArbiter(pendingArbiter); - pendingArbiter= null; + pendingArbiter = null; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java index 133f0d5b5..63c6c3b64 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/IPropertyMonitor.java @@ -4,7 +4,7 @@ public interface IPropertyMonitor { - void addListener(Property property, IPropertyListener listener); + void monitorProperty(Property property, IPropertyListener listener); - void removeListener(Property property, IPropertyListener listener); + void unmonitorProperty(Property property, IPropertyListener listener); } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java index 2296cd1fb..31820c4d1 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/PropertyMonitor.java @@ -71,12 +71,12 @@ private boolean evaluateProperty(Property property) { result = evaluateStepProperty((StepProperty) property); } else if (property instanceof StateProperty) { result = evaluateStateProperty((StateProperty) property); - } else if (property instanceof CompositeProperty) { - result = evaluateCompositeProperty((CompositeProperty) property); - } else if (property instanceof EventPrecondition) { - result = evaluateEventPrecondition((EventPrecondition) property); + } else if (property instanceof CompositeProperty) { + result = evaluateCompositeProperty((CompositeProperty) property); + } else if (property instanceof EventPrecondition) { + result = evaluateEventPrecondition((EventPrecondition) property); } else { - result = evaluateProperty(((PropertyReference) property).getReferencedProperty()); + result = evaluateProperty(((PropertyReference) property).getReferencedProperty()); } return result; } @@ -107,7 +107,7 @@ public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { updateProperties(); } - private boolean evaluateEventPrecondition(EventPrecondition property) { + private boolean evaluateEventPrecondition(EventPrecondition property) { if (eventManagerAvailable) { final EventInstance eventInstance = createEvent(property.getEvent()); return eventInstance != null && eventManager.canSendEvent(eventInstance); @@ -115,7 +115,7 @@ private boolean evaluateEventPrecondition(EventPrecondition property) { return false; } - private boolean evaluateCompositeProperty(CompositeProperty property) { + private boolean evaluateCompositeProperty(CompositeProperty property) { final List list = property.getProperties().stream().map(p -> evaluateProperty(p)).collect(Collectors.toList()); return list.stream().allMatch(b -> b); } @@ -154,7 +154,7 @@ private boolean evaluateStateProperty(StateProperty property) { } @Override - public void addListener(Property property, IPropertyListener listener) { + public void monitorProperty(Property property, IPropertyListener listener) { List listeners = propertyListeners.get(property); if (listeners == null) { listeners = new ArrayList<>(); @@ -169,7 +169,7 @@ public void addListener(Property property, IPropertyListener listener) { } @Override - public void removeListener(Property property, IPropertyListener listener) { + public void unmonitorProperty(Property property, IPropertyListener listener) { List listeners = propertyListeners.get(property); if (listeners != null) { listeners.remove(listener); @@ -178,8 +178,8 @@ public void removeListener(Property property, IPropertyListener listener) { } } monitoredProperties.remove(property); - if (property instanceof CompositeProperty) { - ((CompositeProperty) property).getProperties().forEach(p -> monitoredProperties.remove(p)); + if (property instanceof CompositeProperty) { + ((CompositeProperty) property).getProperties().forEach(p -> monitoredProperties.remove(p)); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend index cec495101..699e1269b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/property/propertyAspects.xtend @@ -9,15 +9,16 @@ import fr.inria.diverse.event.commons.model.property.ManyIntegerAttributePropert import fr.inria.diverse.event.commons.model.property.ManyReferenceProperty import fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty +import fr.inria.diverse.event.commons.model.property.StateProperty import fr.inria.diverse.event.commons.model.property.StringAttributeProperty +import fr.inria.diverse.event.commons.model.property.UnaryProperty import fr.inria.diverse.k3.al.annotationprocessor.Aspect import fr.inria.diverse.k3.al.annotationprocessor.OverrideAspectMethod import java.util.Collections +import java.util.HashSet import java.util.List import java.util.Set import org.eclipse.emf.ecore.EObject -import java.util.HashSet -import fr.inria.diverse.event.commons.model.property.StateProperty @Aspect(className=StateProperty) class StatePropertyAspect { @@ -58,6 +59,25 @@ class ContainerReferencePropertyAspect extends StatePropertyAspect { } } +@Aspect(className=UnaryProperty) +class UnaryPropertyAspect extends StatePropertyAspect { + @OverrideAspectMethod + public def boolean evaluate(EObject o) { + var result = false + switch (_self.operator) { + case NOT: { + result = !_self.property.evaluate(o) + } + } + return result + } + + @OverrideAspectMethod + public def Set extractDynamicTerms() { + return Collections.emptySet + } +} + @Aspect(className=BinaryProperty) class BinaryPropertyAspect extends StatePropertyAspect { @OverrideAspectMethod diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java index c5bbfcc06..4fc3ae8a6 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ArbiterManager.java @@ -34,7 +34,7 @@ private void setupArbiterStatePropertyListeners(Arbiter arbiter, Arbite new HashSet<>(guards.keySet()).forEach(p -> { IPropertyListener l = guards.get(p); if (l != null) { - propertyMonitor.addListener(p, l); + propertyMonitor.monitorProperty(p, l); } }); } @@ -64,16 +64,19 @@ public void update(boolean propertyValue) { // We stop monitoring the current guard as well as // the guards of the other outgoing transitions of // the previous state of the FSM. - propertyMonitor.removeListener(property, this); + propertyMonitor.unmonitorProperty(property, this); currentState = state; - //----------------------- - System.out.println(currentState.getTruthValue()); - //----------------------- - guards.forEach((p, l) -> propertyMonitor.removeListener(p, l)); + guards.forEach((p, l) -> propertyMonitor.unmonitorProperty(p, l)); guards.clear(); - // Otherwise we start monitoring the guards of the outgoing - // transitions. - setupArbiterStatePropertyListeners(arbiter, state); + if (arbiter.getAcceptingStates().contains(currentState)) { + // If the current state is an accepting state, + // we print the final verdict. + System.out.println("Arbiter has reached a verdict: " + currentState.getTruthValue()); + } else { + // Otherwise we start monitoring the guards of the outgoing + // transitions. + setupArbiterStatePropertyListeners(arbiter, state); + } } } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java index a6f97ad55..16b095bb5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.interpreter/src/fr/inria/diverse/event/commons/interpreter/scenario/ScenarioManager.java @@ -84,9 +84,9 @@ private void setupFSMStatePropertyListeners(ScenarioFSM fsm, Scenari // If the FSM state sends an event, we add the event // precondition to the guard of the transition by // using a composite property. - final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); - final PropertyReference propertyReference = propertyFactory.createPropertyReference(); - final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); + final PropertyReference propertyReference = propertyFactory.createPropertyReference(); + final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); propertyReference.setReferencedProperty(property); precondition.setEvent(event); compositeProperty.getProperties().add(propertyReference); @@ -97,7 +97,7 @@ private void setupFSMStatePropertyListeners(ScenarioFSM fsm, Scenari IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), property, fsmGuards); fsmGuards.put(property, listener); } else if (event != null) { - final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); precondition.setEvent(event); IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), precondition, fsmGuards); fsmGuards.put(precondition, listener); @@ -111,26 +111,26 @@ private void setupFSMStatePropertyListeners(ScenarioFSM fsm, Scenari new HashSet<>(fsmGuards.keySet()).forEach(p -> { IPropertyListener l = fsmGuards.get(p); if (l != null) { - propertyMonitor.addListener(p, l); + propertyMonitor.monitorProperty(p, l); } }); } private void handleEventOccurrence(EventOccurrence eventOccurrence) { - final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); precondition.setEvent((eventOccurrence).getEvent()); final Property property = eventOccurrence.getGuard(); if (property != null) { // We create a composite property containing // both the guard of the event and the event precondition. - final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); - final PropertyReference propertyReference = propertyFactory.createPropertyReference(); + final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); + final PropertyReference propertyReference = propertyFactory.createPropertyReference(); propertyReference.setReferencedProperty(property); compositeProperty.getProperties().add(propertyReference); compositeProperty.getProperties().add(precondition); - propertyMonitor.addListener(compositeProperty, new ScenarioGuardListener(eventOccurrence, compositeProperty)); + propertyMonitor.monitorProperty(compositeProperty, new ScenarioGuardListener(eventOccurrence, compositeProperty)); } else { - propertyMonitor.addListener(precondition, new ScenarioGuardListener(eventOccurrence, precondition)); + propertyMonitor.monitorProperty(precondition, new ScenarioGuardListener(eventOccurrence, precondition)); } } @@ -141,20 +141,20 @@ private void handleFSM(ScenarioFSM fsm) { if (event != null && property != null) { // We create a composite property containing // both the guard of the fsm and the event precondition - final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); - final PropertyReference propertyReference = propertyFactory.createPropertyReference(); - final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); + final PropertyReference propertyReference = propertyFactory.createPropertyReference(); + final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); propertyReference.setReferencedProperty(property); precondition.setEvent(event); compositeProperty.getProperties().add(propertyReference); compositeProperty.getProperties().add(precondition); - propertyMonitor.addListener(compositeProperty, new ScenarioGuardListener(fsm, compositeProperty)); + propertyMonitor.monitorProperty(compositeProperty, new ScenarioGuardListener(fsm, compositeProperty)); } else if (event != null) { - final EventPrecondition precondition = propertyFactory.createEventPrecondition(); + final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); precondition.setEvent(event); - propertyMonitor.addListener(precondition, new ScenarioGuardListener(fsm, precondition)); + propertyMonitor.monitorProperty(precondition, new ScenarioGuardListener(fsm, precondition)); } else if (property != null) { - propertyMonitor.addListener(property, new ScenarioGuardListener(fsm, property)); + propertyMonitor.monitorProperty(property, new ScenarioGuardListener(fsm, property)); } else { setupFSMStatePropertyListeners(fsm, initialState); } @@ -243,7 +243,7 @@ public ScenarioGuardListener(ScenarioElement element, Property property) { public void update(boolean propertyValue) { if (propertyValue) { // We stop monitoring the guard of this scenario element. - propertyMonitor.removeListener(property, this); + propertyMonitor.unmonitorProperty(property, this); if (element instanceof EventOccurrence) { currentElements.remove(element); currentElements.addAll(element.getNextElements()); @@ -297,8 +297,8 @@ public void update(boolean propertyValue) { // We stop monitoring the current guard as well as // the guards of the other outgoing transitions of // the previous state of the FSM. - propertyMonitor.removeListener(property, this); - fsmGuards.forEach((p, l) -> propertyMonitor.removeListener(p, l)); + propertyMonitor.unmonitorProperty(property, this); + fsmGuards.forEach((p, l) -> propertyMonitor.unmonitorProperty(p, l)); fsmGuards.clear(); if (fsm.getAcceptingStates().contains(state)) { // The FSM has reached an accepting state, thus we start diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF index 733ba4c42..2d01db45f 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/META-INF/MANIFEST.MF @@ -10,7 +10,7 @@ Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: fr.inria.diverse.event.commons.model.property.provider, fr.inria.diverse.event.commons.model.scenario.provider, - fr.inria.diverse.event.commons.model.report.provider + fr.inria.diverse.event.commons.model.arbiter.provider Require-Bundle: org.eclipse.core.runtime, fr.inria.diverse.event.commons.model;visibility:=reexport, org.eclipse.emf.edit;visibility:=reexport, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReport_events_EventReport.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_CompositeProperty.gif similarity index 71% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReport_events_EventReport.gif rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_CompositeProperty.gif index 16dbb0e6769173330138b3e3c307a700bdcfe83a..59376686693c9cbfcbd973b54710540b04030994 100644 GIT binary patch delta 46 zcmcc5c%N~Cq{@K<2j7mZ)j)$itnF)AIJcTPqbYG07Fd} Aw*UYD delta 46 zcmV+}0MY;70p9_T86<+%)>FpDIjpQKhKB$DU!Pw;|KC4=fPlQ{=#1IfX3We$z`&6` EqE2HPlK=n! diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..17776a113b943759eb212917f53e7d60e116729c GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ z1&Z&7iSL@O21HvYDX;62U)m%!uTpGgiSWO_?}6y==kq}H=lSB_cbkExL4e{<7Df3tK1kH}_2{@ihKy(sM0)lBSq?zf^LjbD+lTg4sA2Ytgb#~OwlghEaFf5$Qgb_3>-5X?e1@Ewrqsr!Y*j@D FYXC^}VHf}a literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_EventPrecondition.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_EventPrecondition.gif new file mode 100644 index 0000000000000000000000000000000000000000..a37ddd6bc24c1ef97f4ae9b6ae81e305202994f5 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6yx4Q;X3wTGX)_NvH2nV`KR@37|9$(0 zhK2(N4(y+QAINZUaM(3n4T!c*QeM|3zqCneUZvQ~65)S;-viO#&*y>Y&-2B!EQ}zQ4u}BR$-o+;pwO2RX{W|8^X%a%7q(97Z|<8^;%WTZq~}`pBuz2(eyQY4 z=Rl3w%TKV2^l8mGb<)j>K}YSrw~K{9P{ZsO2_F`nY-d`S;3j{grRH|7*6Ek&`3yNV NO{tAd*{X^R)&K)4ViN!W literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ManyBooleanAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..79263fb990c26769509e8202befd1293c5c0dc37 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?0NB`=jP3{GiMwQ9Qgk~etx|D|NHh0 z4Gjkl9N0hqK9J$y;IM1D8W3%rq`a<6erc1`yh^c|CBpyyz6YYepU(r)pXZBz-)#n( z1_6pcSr|bq9S{MslYuoxL7^`t(oT(G=GntjE^M9D-`qE;#MAh*Nzb+HNt$Bn{Zh%9 z&Vd@Um!Du4>C>8X>ZF?$gO1vLZx;)JpoZBm5JIv@gMCj)DYfrlb&nYlQhND`=ydI zodY#yFF(O9(x)}&)JZoh1|7Bg-YymbK@GECBz#zOvYlyRf}8w}mYUnSTBl#8=QHHg OG^I8+WvePOSOWkL5My@$ literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNegationTemporalProperty_formula_ManyStringAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..43ae2dfc67c8a4e4151e5a22687a2970bf3e8678 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`Oxl@-h6V=*hyVZM=f~Uszi$uZ z0>$^wzYh`LHC+vewoX!B*CoHSNoroD*vt~)e}CTt(cjPKf#}ck#lP=115JYf#h)yU zAeIh@0NKgF8l#}lmlA2G#xV2j;VBokPU>&&n^fXy{Mn@ETJ|JOG4+0_=y|i7M*NoTA1J_f1{=5cCOaxm+AQoIWY&-2B!EQ}zQ4u}BR$-o+;pwO2RX{W|8^X%a%7q(97Z|<8^;%WTZq~}`pBuz2(eyQY4 z=Rl3w%TKV2^l8mGb<)j>K}YSrw~K{9P{ZsO2_F`nY-d`S;3j{grRH|7*6Ek&`3yNV NO{tAd*{X^R)&Kz;ViN!W literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_AbstractProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_AbstractProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..8a4acfb07bdb63f123df93651a562d0e980fb3fa GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?0Ipi=jNugGcz3yH2nV`KR@37|9$(0 zhK2(N4$PS|=Rku45bT<+21HvYDX;62U)m%!uTpGgiSWO_?}6y==kq}H=lSB_cbkEx zL4e{<7Df3tK1kH}_2{@ihKy(sM0)lBSq?zf^Lj zbD+lTg4sA2Ytgb#~OwlghEaFf5$Qgb_3>-5X?e1@Ew Nrqsr!Y*j@DYXH2WVX6QC literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_CompositeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_CompositeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..c200e691abd4deb48fdbbe790765c9a97d5e30a1 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b&YU@w%Pu)MIQ;(~KR@37|9$(0 zh6afEfd-(k!>;LSK(uv|^13ehrA<=vD#d1&2><*09*F*aJ`Y5Ho-h7=w;5;}1StMw zVFa;sKm^E62G$q_g}#(XJ2i%xXAe)guys;@bKj&APvg%fJ=d})X^N@$OC@JI2Wre- zeu7=3PixMplWtZFI%@a5T`UBG8fL#p_^{|?JJZ4hH~AYaHMeuMPQOggXUM5(N^NY) JR#jxM1_1BxV3z;@ literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ContainerReferenceProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..5f8c2018a1c8f73a9321b5aab5c542bdb17ca0b2 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ z1&Ys^Gv@$E*kRXnH6YqLNqJqD{L&_=d6i-_ON9UZeGf!`Kc5GpKhGEczS|5m4FVK@ zvM_>JIv@gMCj)DYfrlb&nYlQhND`=ydIodY#y zFF(O9(x)}&)JZoh1|7Bg-YymbK@GECBz#zOvYlyRf}8w}mYUnSTBl#8=QHHgG^I8+ KWvePOSOWk9+F-8$ literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_EventPrecondition.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_EventPrecondition.gif new file mode 100644 index 0000000000000000000000000000000000000000..8eb45613da261b3206ce70b281d0003fe04fb19d GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6yx4Q;X3wTGX)_NvH2nV`KR@37|9$(0 zhK2(N4$PS|=Rku45bT<+21HvYDX;62U)m%!uTpGgiSWO_?}6y==kq}H=lSB_cbkEx zL4e{<7Df3tK1kH}_2{@ihKy(sM0)lBSq?zf^Lj zbD+lTg4sA2Ytgb#~OwlghEaFf5$Qgb_3>-5X?e1@Ew Nrqsr!Y*j@DYXH6hVX6QC literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ManyBooleanAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..860276f4bbc86b28a21e481336d49a56df9c9b4a GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?0NB`=jP3{GiMwQ9Qgk~etx|D|NHh0 z4Gjkl9GEj_&VdF8AlNls4T!c*QeM|3zqCneUZvQ~65)S;-viO#&*y>Y&-2B!EQ}zQ4u}BR$-o+;pwO2RX{W|8^X%a%7q(97Z|<8^;%WTZq~}`pBuz2(eyQY4 z=Rl3w%TKV2^l8mGb<)j>K}YSrw~K{9P{ZsO2_F`nY-d`S;3j{grRH|7*6Ek&`3yNV NO{tAd*{X^R)&M_>Vp;$I literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateNextProperty_formula_ManyIntegerAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..2146504282c7ca718111e1821c7e58d47608791d GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6eEt3P=$oVS@6WHiRQdmZ{QP+P|M%@1 z8X689I520C>8X>ZF?$gO1vLZx;)JpoZBm5$UdnR5Un?67OP8W3%rq`a<6erc1`yh^c|CBpyyz6YYepU(r)pXZBz-)#n(1_6pc zSr|bq9S{MslYuoxL7^`t(oT(G=GntjE^M9D-`qE;#MAh*Nzb+HNt$Bn{Zh%9&Vd@U zm!Du4>C>8X>ZF?$gO1vLZx;)JpoZBm53tK1kH}_2{@ihKy(sM0)lBSq?zf^Lj zbD+lTg4sA2Ytgb#~OwlghEaFf5$Qgb_3>-5X?e1@Ew Nrqsr!Y*j@DYXH0QVX6QC literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_AbstractProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_AbstractProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..671249c1599282bff0f7b20280c9c8a69072949d GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?0Ipi=jNugGcz3yH2nV`KR@37|9$(0 zhK2(N4$PS|=hCH02M32;)75}z>m=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gi1OPi$TRf^3l5&rl0JrMo)AYJYW3#ZZps{2vGdV z!U$sNfC!MC46HE<3VkV&c4`bW&mNv~Ve6#+=DtZKp2nX|dah+p(iBtgmrBlb4%C>v z`~1sfm=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gi+YZ#L@u~AUhdYV-ytnQX=it7-pV5JmtdHN&U@zlS({|Kb!Pi%buhurrs}= zoar2>F?;z5c9A}8}5D03R{UYJRqLb}R3lrSrZ?x3h&eb~oGCiLm Pr=}^ju_;?sk--`OrOsma literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_leftFormula_ManyIntegerAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..eeaa06b985e04d1eeddf65c8d863f06ba8c583d6 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6eEt3P=$oVS@6WHiRQdmZ{QP+P|M%@1 z8X689I520Um4mOV*ROub(! zIny~%WA^eB>>_$UdnRDqm=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gim=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gi1OPi$TRf^3l5&rl0JrMo)AYJYW3#ZZps{2vGdV z!U$sNfC!MC46HE<3VkV&c4`bW&mNv~Ve6#+=DtZKp2nX|dah+p(iBtgmrBlb4%C>v z`~1sfm=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gi+YZ#L@u~AUhdYV-ytnQX=it7-pV5JmtdHN&U@zlS({|Kb!Pi%buhurrs}= zoar2>F?;z5c9A}8}5D03R{UYJRqLb}R3lrSrZ?x3h&eb~oGCiLm Pr=}^ju_;?sk--`OrOsma literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReleaseProperty_rightFormula_ManyIntegerAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..eeaa06b985e04d1eeddf65c8d863f06ba8c583d6 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6eEt3P=$oVS@6WHiRQdmZ{QP+P|M%@1 z8X689I520Um4mOV*ROub(! zIny~%WA^eB>>_$UdnRDqm=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gi1OPi$TRf^3l5&rl0JrMo)AYJYW3#ZZps{ z2vGdV!U$sNfC!MC46HE<3VkV&c4`bW&mNv~Ve6#+=DtZKp2nX|dah+p(iBtgmrBlb z4%C>v`~`9tp>its5 zna+V4vzMP>7wOZQbLym<6@!l2eQy^FfuM%jFA_d1I@!*&Fu_g!MoZ1@T&>eD)AJc} OYMN3To3d3E8LR;dsA3WT literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUnaryProperty_property_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUnaryProperty_property_ManyIntegerAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..62a12266859d325e0bdb7c50550f0fccfd22b953 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6eEt3P=$oVS@6WHiRQdmZ{QP+P|M%@1 z8XB6`Tnp|wW?8&OC$eqVbTuH_I!Sq5m;BNusd<%RGfRa3{e2Hae?OlGqCd|U|GwJ{ zGz|h2f3h%wSUMmAWG4e_jDkX6N~E0{!_2dXr(D=NslT~zQi-SWXOo_5*^@NI)cd89 zGo1r9W-mX%F4Ctp=hR6zD+V34``#`V0znP4UnG23bh4dkVS=0djh33*xmu@Rrsp%{ P)HJ0wHf5_SGFSrumIY$Q literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUnaryProperty_property_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUnaryProperty_property_ManyStringAttributeProperty.gif new file mode 100644 index 0000000000000000000000000000000000000000..4df8fc516f7bf5a6f14a8f06727ccb8b8915a69a GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`Oxl@-h6V=*hyVZM=f~Uszi$uZ zHm$i9+;hybc#TeE+pg(qK(uv|^13ehrA<=vD#d1&2><*09*F*aJ`Y5Ho-h7=w;5;} z1StMwVFa;sKm^E62G$q_g}#(XJ2i%xXAe)guys;@bKj&APvg%fJ=d})X^N@$OC@JI z2Wre-eu7=3PixMplWtZFI%@a5T`UBG8fL#p_^{|?JJZ4hH~AYaHMeuMPQOggXUM5( NN^NY)R#jxM1^|caU1EQ^yl-G61FKv>VS1C5LMEKv|_dxXb^LZfp^L+8|yUjq; zAVBda3nPf710q0nGO)%dDDA99YNmER{Un)7% zIZ$Kv@)PVLeOhx)opiHe&{4bZ?P4Ji)G+%+!iPmC+nE+7xXIsWskxo2b^2v`K0{7T NQ)**VwyGk7H2_w1VKD#z literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_EventPrecondition.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_EventPrecondition.gif new file mode 100644 index 0000000000000000000000000000000000000000..9f36b38d3493026e94c45b05ba8721f82e9aa92e GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6yx4Q;X3wTGX)_NvH2nV`KR@37|9$(0 zhK6fR*Nz1rTVuJVO{Z1sfnlbHl4Oz)75}z>m=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gi z9H=pS`3ZKBKCL;YPP$n!=&0TIcCio$YMA{Z;lrYn?Mw?3+~jYx)ZEV1I{h*|pCPBF NDYdaFTUC+48UPM=VA22p literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_PropertyReference.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_leftFormula_PropertyReference.gif new file mode 100644 index 0000000000000000000000000000000000000000..633561b32bb9d1295e086cdec92e61be35090aa7 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?78%!XVcBJnP(gt4*dTgKR@37|9$(0 zhK6fR*Nz1rTVuJVO{Z1EQ^yl-G61FKv>VS1C5LMEKv|_dxXb^LZfp^L+8|yUjq; zAVBda3nPf710q0nGO)%dDDA99YNmER{Un)7% zIZ$Kv@)PVLeOhx)opiHe&{4bZ?P4Ji)G+%+!iPmC+nE+7xXIsWskxo2b^2v`K0{7T NQ)**VwyGk7H2_w1VKD#z literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_EventPrecondition.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_EventPrecondition.gif new file mode 100644 index 0000000000000000000000000000000000000000..9f36b38d3493026e94c45b05ba8721f82e9aa92e GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6yx4Q;X3wTGX)_NvH2nV`KR@37|9$(0 zhK6fR*Nz1rTVuJVO{Z1sfnlbHl4Oz)75}z>m=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gi z9H=pS`3ZKBKCL;YPP$n!=&0TIcCio$YMA{Z;lrYn?Mw?3+~jYx)ZEV1I{h*|pCPBF NDYdaFTUC+48UPM=VA22p literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_PropertyReference.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateUntilProperty_rightFormula_PropertyReference.gif new file mode 100644 index 0000000000000000000000000000000000000000..633561b32bb9d1295e086cdec92e61be35090aa7 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?78%!XVcBJnP(gt4*dTgKR@37|9$(0 zhK6fR*Nz1rTVuJVO{Z9kF>bpZftvkAHY delta 22 ecmZo~uRaQAn7P!5RSBPcTCO literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Transition.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Transition.gif new file mode 100644 index 0000000000000000000000000000000000000000..7bac4fd3808df6247660dfb8d76e15609f279841 GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgt|NndTyy)qp3@myECp}m1wRrvIn+pHKLf7r4thZ7UycR6{YNPjYn%Y&f W@}8BN{JP5-JKc^<6cT1+um%9tY%ntb literal 0 HcmV?d00001 diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties index 425b2d334..cc8fabda2 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.properties @@ -12,9 +12,16 @@ _UI_CreateSibling_description = Create a new sibling of type {0} for the selecte _UI_PropertyDescriptor_description = The {0} of the {1} +_UI_TemporalProperty_type = Temporal Property +_UI_NextProperty_type = Next Property +_UI_UntilProperty_type = Until Property +_UI_ReleaseProperty_type = Release Property +_UI_NegationTemporalProperty_type = Negation Temporal Property _UI_Property_type = Property +_UI_PropertyReference_type = Reference _UI_CompositeProperty_type = Composite Property _UI_EventPrecondition_type = Event Precondition +_UI_StepProperty_type = Step Property _UI_StateProperty_type = State Property _UI_BinaryProperty_type = Binary Property _UI_ManyReferenceProperty_type = Many Reference Property @@ -26,14 +33,21 @@ _UI_ManyStringAttributeProperty_type = Many String Attribute Property _UI_BooleanAttributeProperty_type = Boolean Attribute Property _UI_IntegerAttributeProperty_type = Integer Attribute Property _UI_StringAttributeProperty_type = String Attribute Property -_UI_StepProperty_type = Step Property -_UI_PropertyReference_type = Reference _UI_Unknown_type = Object _UI_Unknown_datatype= Value +_UI_NextProperty_formula_feature = Formula +_UI_UntilProperty_leftFormula_feature = Left Formula +_UI_UntilProperty_rightFormula_feature = Right Formula +_UI_ReleaseProperty_leftFormula_feature = Left Formula +_UI_ReleaseProperty_rightFormula_feature = Right Formula +_UI_NegationTemporalProperty_formula_feature = Formula +_UI_PropertyReference_referencedProperty_feature = Referenced Property _UI_CompositeProperty_properties_feature = Properties _UI_EventPrecondition_event_feature = Event +_UI_StepProperty_stepping_feature = Stepping +_UI_StepProperty_targetProvider_feature = Target Provider _UI_StateProperty_target_feature = Target _UI_BinaryProperty_operator_feature = Operator _UI_BinaryProperty_left_feature = Left @@ -57,8 +71,6 @@ _UI_IntegerAttributeProperty_value_feature = Value _UI_IntegerAttributeProperty_operator_feature = Operator _UI_StringAttributeProperty_value_feature = Value _UI_StringAttributeProperty_operator_feature = Operator -_UI_StepProperty_stepping_feature = Stepping -_UI_PropertyReference_referencedProperty_feature = Referenced Property _UI_Unknown_feature = Unspecified _UI_Operator_EQUAL_literal = EQUAL @@ -108,23 +120,29 @@ _UI_Arbiter_states_feature = States _UI_Arbiter_transitions_feature = Transitions _UI_Arbiter_initialState_feature = Initial State _UI_Arbiter_acceptingStates_feature = Accepting States +_UI_Arbiter_name_feature = Name _UI_ArbiterState_incomingTransitions_feature = Incoming Transitions _UI_ArbiterState_outgoingTransitions_feature = Outgoing Transitions _UI_ArbiterState_truthValue_feature = Truth Value +_UI_ArbiterState_name_feature = Name _UI_ArbiterTransition_guard_feature = Guard _UI_ArbiterTransition_source_feature = Source _UI_ArbiterTransition_target_feature = Target -_UI_Report_type = Report -_UI_EventReport_type = Event Report -_UI_Report_events_feature = Events -_UI_EventReport_event_feature = Event -_UI_EventReport_matches_feature = Matches -_UI_EventReport_target_feature = Target -_UI_EventReport_time_feature = Time -_UI_Arbiter_name_feature = Name -_UI_ArbiterState_name_feature = Name _UI_ArbiterTransition_name_feature = Name _UI_TruthValue_INCONCLUSIVE_literal = INCONCLUSIVE _UI_TruthValue_TRUE_literal = TRUE _UI_TruthValue_FALSE_literal = FALSE -_UI_StepProperty_targetProvider_feature = Target Provider +_UI_State_type = State +_UI_Transition_type = Transition +_UI_State_truthValue_feature = Truth Value +_UI_State_outgoingTransitions_feature = Outgoing Transitions +_UI_State_incomingTransitions_feature = Incoming Transitions +_UI_Transition_source_feature = Source +_UI_Transition_target_feature = Target +_UI_Transition_guard_feature = Guard +_UI_UnaryProperty_type = Unary Property +_UI_UnaryProperty_operator_feature = Operator +_UI_UnaryProperty_property_feature = Property +_UI_UnaryOperator_NOT_literal = NOT +_UI_ComparisonOperator_EQUAL_literal = EQUAL +_UI_AbstractProperty_type = Abstract Property diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml index c69b5dc22..11b1c4f72 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/plugin.xml @@ -33,10 +33,10 @@ - + getPropertyDescriptors(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ReportPackage.Literals.REPORT__EVENTS); + childrenFeatures.add(ArbiterPackage.Literals.ARBITER__STATES); + childrenFeatures.add(ArbiterPackage.Literals.ARBITER__TRANSITIONS); } return childrenFeatures; } @@ -96,14 +120,14 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { } /** - * This returns Report.gif. + * This returns Arbiter.gif. * * * @generated */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Report")); + return overlayImage(object, getResourceLocator().getImage("full/obj16/Arbiter")); } /** @@ -114,7 +138,7 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - return getString("_UI_Report_type"); + return getString("_UI_Arbiter_type"); } @@ -129,8 +153,9 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(Report.class)) { - case ReportPackage.REPORT__EVENTS: + switch (notification.getFeatureID(Arbiter.class)) { + case ArbiterPackage.ARBITER__STATES: + case ArbiterPackage.ARBITER__TRANSITIONS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -147,11 +172,6 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (ReportPackage.Literals.REPORT__EVENTS, - ReportFactory.eINSTANCE.createEventReport())); } /** @@ -162,7 +182,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors */ @Override public ResourceLocator getResourceLocator() { - return ReportEditPlugin.INSTANCE; + return ArbiterEditPlugin.INSTANCE; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProviderAdapterFactory.java similarity index 73% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProviderAdapterFactory.java index 9e8b1855f..b3270e17c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/ReportItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/ArbiterItemProviderAdapterFactory.java @@ -1,8 +1,8 @@ /** */ -package fr.inria.diverse.event.commons.model.report.provider; +package fr.inria.diverse.event.commons.model.arbiter.provider; -import fr.inria.diverse.event.commons.model.report.util.ReportAdapterFactory; +import fr.inria.diverse.event.commons.model.arbiter.util.ArbiterAdapterFactory; import java.util.ArrayList; import java.util.Collection; @@ -32,7 +32,7 @@ * * @generated */ -public class ReportItemProviderAdapterFactory extends ReportAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { +public class ArbiterItemProviderAdapterFactory extends ArbiterAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { /** * This keeps track of the root adapter factory that delegates to this adapter factory. * @@ -63,7 +63,7 @@ public class ReportItemProviderAdapterFactory extends ReportAdapterFactory imple * * @generated */ - public ReportItemProviderAdapterFactory() { + public ArbiterItemProviderAdapterFactory() { supportedTypes.add(IEditingDomainItemProvider.class); supportedTypes.add(IStructuredItemContentProvider.class); supportedTypes.add(ITreeItemContentProvider.class); @@ -71,52 +71,6 @@ public ReportItemProviderAdapterFactory() { supportedTypes.add(IItemPropertySource.class); } - /** - * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.Report} instances. - * - * - * @generated - */ - protected ReportItemProvider reportItemProvider; - - /** - * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.Report}. - * - * - * @generated - */ - @Override - public Adapter createReportAdapter() { - if (reportItemProvider == null) { - reportItemProvider = new ReportItemProvider(this); - } - - return reportItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.report.EventReport} instances. - * - * - * @generated - */ - protected EventReportItemProvider eventReportItemProvider; - - /** - * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.report.EventReport}. - * - * - * @generated - */ - @Override - public Adapter createEventReportAdapter() { - if (eventReportItemProvider == null) { - eventReportItemProvider = new EventReportItemProvider(this); - } - - return eventReportItemProvider; - } - /** * This returns the root adapter factory that contains this factory. * @@ -216,8 +170,6 @@ public void fireNotifyChanged(Notification notification) { * @generated */ public void dispose() { - if (reportItemProvider != null) reportItemProvider.dispose(); - if (eventReportItemProvider != null) eventReportItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/StateItemProvider.java similarity index 62% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/StateItemProvider.java index 1c0236fcc..9689a5101 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/report/provider/EventReportItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/StateItemProvider.java @@ -1,10 +1,11 @@ /** */ -package fr.inria.diverse.event.commons.model.report.provider; +package fr.inria.diverse.event.commons.model.arbiter.provider; -import fr.inria.diverse.event.commons.model.report.EventReport; -import fr.inria.diverse.event.commons.model.report.ReportPackage; +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.TruthValue; import java.util.Collection; import java.util.List; @@ -26,12 +27,12 @@ import org.eclipse.emf.edit.provider.ViewerNotification; /** - * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.report.EventReport} object. + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.arbiter.State} object. * * * @generated */ -public class EventReportItemProvider +public class StateItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, @@ -45,7 +46,7 @@ public class EventReportItemProvider * * @generated */ - public EventReportItemProvider(AdapterFactory adapterFactory) { + public StateItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } @@ -60,50 +61,49 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - addEventPropertyDescriptor(object); - addMatchesPropertyDescriptor(object); - addTargetPropertyDescriptor(object); - addTimePropertyDescriptor(object); + addTruthValuePropertyDescriptor(object); + addOutgoingTransitionsPropertyDescriptor(object); + addIncomingTransitionsPropertyDescriptor(object); } return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Event feature. + * This adds a property descriptor for the Truth Value feature. * * * @generated */ - protected void addEventPropertyDescriptor(Object object) { + protected void addTruthValuePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_EventReport_event_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_EventReport_event_feature", "_UI_EventReport_type"), - ReportPackage.Literals.EVENT_REPORT__EVENT, + getString("_UI_State_truthValue_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_State_truthValue_feature", "_UI_State_type"), + ArbiterPackage.Literals.STATE__TRUTH_VALUE, true, false, - true, - null, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Matches feature. + * This adds a property descriptor for the Outgoing Transitions feature. * * * @generated */ - protected void addMatchesPropertyDescriptor(Object object) { + protected void addOutgoingTransitionsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_EventReport_matches_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_EventReport_matches_feature", "_UI_EventReport_type"), - ReportPackage.Literals.EVENT_REPORT__MATCHES, + getString("_UI_State_outgoingTransitions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_State_outgoingTransitions_feature", "_UI_State_type"), + ArbiterPackage.Literals.STATE__OUTGOING_TRANSITIONS, true, false, true, @@ -113,19 +113,19 @@ protected void addMatchesPropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Target feature. + * This adds a property descriptor for the Incoming Transitions feature. * * * @generated */ - protected void addTargetPropertyDescriptor(Object object) { + protected void addIncomingTransitionsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_EventReport_target_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_EventReport_target_feature", "_UI_EventReport_type"), - ReportPackage.Literals.EVENT_REPORT__TARGET, + getString("_UI_State_incomingTransitions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_State_incomingTransitions_feature", "_UI_State_type"), + ArbiterPackage.Literals.STATE__INCOMING_TRANSITIONS, true, false, true, @@ -135,36 +135,14 @@ protected void addTargetPropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Time feature. - * - * - * @generated - */ - protected void addTimePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_EventReport_time_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_EventReport_time_feature", "_UI_EventReport_type"), - ReportPackage.Literals.EVENT_REPORT__TIME, - true, - false, - false, - ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns EventReport.gif. + * This returns State.gif. * * * @generated */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/EventReport")); + return overlayImage(object, getResourceLocator().getImage("full/obj16/State")); } /** @@ -175,8 +153,11 @@ public Object getImage(Object object) { */ @Override public String getText(Object object) { - EventReport eventReport = (EventReport)object; - return getString("_UI_EventReport_type") + " " + eventReport.getTime(); + TruthValue labelValue = ((State)object).getTruthValue(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_State_type") : + getString("_UI_State_type") + " " + label; } @@ -191,8 +172,8 @@ public String getText(Object object) { public void notifyChanged(Notification notification) { updateChildren(notification); - switch (notification.getFeatureID(EventReport.class)) { - case ReportPackage.EVENT_REPORT__TIME: + switch (notification.getFeatureID(State.class)) { + case ArbiterPackage.STATE__TRUTH_VALUE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } @@ -219,7 +200,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors */ @Override public ResourceLocator getResourceLocator() { - return ReportEditPlugin.INSTANCE; + return ArbiterEditPlugin.INSTANCE; } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/TransitionItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/TransitionItemProvider.java new file mode 100644 index 000000000..9a617ee29 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/arbiter/provider/TransitionItemProvider.java @@ -0,0 +1,192 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.provider; + + +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; + +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.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.arbiter.Transition} object. + * + * + * @generated + */ +public class TransitionItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public TransitionItemProvider(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); + + addSourcePropertyDescriptor(object); + addTargetPropertyDescriptor(object); + addGuardPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Source feature. + * + * + * @generated + */ + protected void addSourcePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Transition_source_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Transition_source_feature", "_UI_Transition_type"), + ArbiterPackage.Literals.TRANSITION__SOURCE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Transition_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Transition_target_feature", "_UI_Transition_type"), + ArbiterPackage.Literals.TRANSITION__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Guard feature. + * + * + * @generated + */ + protected void addGuardPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Transition_guard_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Transition_guard_feature", "_UI_Transition_type"), + ArbiterPackage.Literals.TRANSITION__GUARD, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Transition.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Transition")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_Transition_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 ArbiterEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/AbstractPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/AbstractPropertyItemProvider.java new file mode 100644 index 000000000..ca7ebc88c --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/AbstractPropertyItemProvider.java @@ -0,0 +1,120 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.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 fr.inria.diverse.event.commons.model.property.AbstractProperty} object. + * + * + * @generated + */ +public class AbstractPropertyItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public AbstractPropertyItemProvider(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 AbstractProperty.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/AbstractProperty")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_AbstractProperty_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 PropertyEditPlugin.INSTANCE; + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/CompositePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/CompositePropertyItemProvider.java index f5c603b70..76216ee2b 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/CompositePropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/CompositePropertyItemProvider.java @@ -133,6 +133,11 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, + PropertyFactory.eINSTANCE.createPropertyReference())); + newChildDescriptors.add (createChildParameter (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, @@ -162,11 +167,6 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors (createChildParameter (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); - - newChildDescriptors.add - (createChildParameter - (PropertyPackage.Literals.COMPOSITE_PROPERTY__PROPERTIES, - PropertyFactory.eINSTANCE.createPropertyReference())); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/NegationTemporalPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/NegationTemporalPropertyItemProvider.java new file mode 100644 index 000000000..dfe01b37b --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/NegationTemporalPropertyItemProvider.java @@ -0,0 +1,125 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.NegationTemporalProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.NegationTemporalProperty} object. + * + * + * @generated + */ +public class NegationTemporalPropertyItemProvider extends TemporalPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public NegationTemporalPropertyItemProvider(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(PropertyPackage.Literals.NEGATION_TEMPORAL_PROPERTY__FORMULA); + } + 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) { + return getString("_UI_NegationTemporalProperty_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); + + switch (notification.getFeatureID(NegationTemporalProperty.class)) { + case PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA: + 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); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/NextPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/NextPropertyItemProvider.java new file mode 100644 index 000000000..ffa06e726 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/NextPropertyItemProvider.java @@ -0,0 +1,166 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.NextProperty; +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.NextProperty} object. + * + * + * @generated + */ +public class NextPropertyItemProvider extends TemporalPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public NextPropertyItemProvider(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(PropertyPackage.Literals.NEXT_PROPERTY__FORMULA); + } + 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) { + return getString("_UI_NextProperty_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); + + switch (notification.getFeatureID(NextProperty.class)) { + case PropertyPackage.NEXT_PROPERTY__FORMULA: + 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 + (PropertyPackage.Literals.NEXT_PROPERTY__FORMULA, + PropertyFactory.eINSTANCE.createAbstractProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.NEXT_PROPERTY__FORMULA, + PropertyFactory.eINSTANCE.createPropertyReference())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.NEXT_PROPERTY__FORMULA, + PropertyFactory.eINSTANCE.createCompositeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.NEXT_PROPERTY__FORMULA, + PropertyFactory.eINSTANCE.createEventPrecondition())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.NEXT_PROPERTY__FORMULA, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.NEXT_PROPERTY__FORMULA, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.NEXT_PROPERTY__FORMULA, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.NEXT_PROPERTY__FORMULA, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java index 1bef6a799..69ba111b0 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProvider.java @@ -9,15 +9,7 @@ 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 fr.inria.diverse.event.commons.model.property.Property} object. @@ -25,14 +17,7 @@ * * @generated */ -public class PropertyItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { +public class PropertyItemProvider extends AbstractPropertyItemProvider { /** * This constructs an instance from a factory and a notifier. * @@ -95,15 +80,4 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors super.collectNewChildDescriptors(newChildDescriptors, object); } - /** - * Return the resource locator for this item provider's resources. - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return PropertyEditPlugin.INSTANCE; - } - } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java index 652edf953..9a67abb98 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/PropertyItemProviderAdapterFactory.java @@ -71,6 +71,52 @@ public PropertyItemProviderAdapterFactory() { supportedTypes.add(IItemPropertySource.class); } + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.AbstractProperty} instances. + * + * + * @generated + */ + protected AbstractPropertyItemProvider abstractPropertyItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.AbstractProperty}. + * + * + * @generated + */ + @Override + public Adapter createAbstractPropertyAdapter() { + if (abstractPropertyItemProvider == null) { + abstractPropertyItemProvider = new AbstractPropertyItemProvider(this); + } + + return abstractPropertyItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.PropertyReference} instances. + * + * + * @generated + */ + protected PropertyReferenceItemProvider propertyReferenceItemProvider; + + /** + * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.PropertyReference}. + * + * + * @generated + */ + @Override + public Adapter createPropertyReferenceAdapter() { + if (propertyReferenceItemProvider == null) { + propertyReferenceItemProvider = new PropertyReferenceItemProvider(this); + } + + return propertyReferenceItemProvider; + } + /** * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.CompositeProperty} instances. * @@ -209,29 +255,6 @@ public Adapter createManyStringAttributePropertyAdapter() { return manyStringAttributePropertyItemProvider; } - /** - * This keeps track of the one adapter used for all {@link fr.inria.diverse.event.commons.model.property.PropertyReference} instances. - * - * - * @generated - */ - protected PropertyReferenceItemProvider propertyReferenceItemProvider; - - /** - * This creates an adapter for a {@link fr.inria.diverse.event.commons.model.property.PropertyReference}. - * - * - * @generated - */ - @Override - public Adapter createPropertyReferenceAdapter() { - if (propertyReferenceItemProvider == null) { - propertyReferenceItemProvider = new PropertyReferenceItemProvider(this); - } - - return propertyReferenceItemProvider; - } - /** * This returns the root adapter factory that contains this factory. * @@ -331,13 +354,14 @@ public void fireNotifyChanged(Notification notification) { * @generated */ public void dispose() { + if (abstractPropertyItemProvider != null) abstractPropertyItemProvider.dispose(); + if (propertyReferenceItemProvider != null) propertyReferenceItemProvider.dispose(); if (compositePropertyItemProvider != null) compositePropertyItemProvider.dispose(); if (eventPreconditionItemProvider != null) eventPreconditionItemProvider.dispose(); if (containerReferencePropertyItemProvider != null) containerReferencePropertyItemProvider.dispose(); if (manyBooleanAttributePropertyItemProvider != null) manyBooleanAttributePropertyItemProvider.dispose(); if (manyIntegerAttributePropertyItemProvider != null) manyIntegerAttributePropertyItemProvider.dispose(); if (manyStringAttributePropertyItemProvider != null) manyStringAttributePropertyItemProvider.dispose(); - if (propertyReferenceItemProvider != null) propertyReferenceItemProvider.dispose(); } } diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ReleasePropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ReleasePropertyItemProvider.java new file mode 100644 index 000000000..2f21b2bf8 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/ReleasePropertyItemProvider.java @@ -0,0 +1,231 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.ReleaseProperty; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.ReleaseProperty} object. + * + * + * @generated + */ +public class ReleasePropertyItemProvider extends TemporalPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ReleasePropertyItemProvider(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(PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA); + childrenFeatures.add(PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA); + } + 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) { + return getString("_UI_ReleaseProperty_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); + + switch (notification.getFeatureID(ReleaseProperty.class)) { + case PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA: + case PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA: + 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 + (PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createAbstractProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createPropertyReference())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createCompositeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createEventPrecondition())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createAbstractProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createPropertyReference())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createCompositeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createEventPrecondition())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + + /** + * 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 == PropertyPackage.Literals.RELEASE_PROPERTY__LEFT_FORMULA || + childFeature == PropertyPackage.Literals.RELEASE_PROPERTY__RIGHT_FORMULA; + + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java index b95a083f4..65c3cefdd 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/StepPropertyItemProvider.java @@ -14,6 +14,7 @@ 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.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/TemporalPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/TemporalPropertyItemProvider.java new file mode 100644 index 000000000..1abc15993 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/TemporalPropertyItemProvider.java @@ -0,0 +1,83 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.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.IItemPropertyDescriptor; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.TemporalProperty} object. + * + * + * @generated + */ +public class TemporalPropertyItemProvider + extends AbstractPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public TemporalPropertyItemProvider(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_TemporalProperty_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); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/UnaryPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/UnaryPropertyItemProvider.java new file mode 100644 index 000000000..25a71a525 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/UnaryPropertyItemProvider.java @@ -0,0 +1,179 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.UnaryOperator; +import fr.inria.diverse.event.commons.model.property.UnaryProperty; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.UnaryProperty} object. + * + * + * @generated + */ +public class UnaryPropertyItemProvider extends StatePropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public UnaryPropertyItemProvider(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); + + addOperatorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Operator feature. + * + * + * @generated + */ + protected void addOperatorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_UnaryProperty_operator_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_UnaryProperty_operator_feature", "_UI_UnaryProperty_type"), + PropertyPackage.Literals.UNARY_PROPERTY__OPERATOR, + 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(PropertyPackage.Literals.UNARY_PROPERTY__PROPERTY); + } + 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) { + UnaryOperator labelValue = ((UnaryProperty)object).getOperator(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_UnaryProperty_type") : + getString("_UI_UnaryProperty_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(UnaryProperty.class)) { + case PropertyPackage.UNARY_PROPERTY__OPERATOR: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case PropertyPackage.UNARY_PROPERTY__PROPERTY: + 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 + (PropertyPackage.Literals.UNARY_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNARY_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNARY_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNARY_PROPERTY__PROPERTY, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + +} diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/UntilPropertyItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/UntilPropertyItemProvider.java new file mode 100644 index 000000000..473a95ade --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/property/provider/UntilPropertyItemProvider.java @@ -0,0 +1,231 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.provider; + + +import fr.inria.diverse.event.commons.model.property.PropertyFactory; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.UntilProperty; + +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.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link fr.inria.diverse.event.commons.model.property.UntilProperty} object. + * + * + * @generated + */ +public class UntilPropertyItemProvider extends TemporalPropertyItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public UntilPropertyItemProvider(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(PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA); + childrenFeatures.add(PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA); + } + 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) { + return getString("_UI_UntilProperty_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); + + switch (notification.getFeatureID(UntilProperty.class)) { + case PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA: + case PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA: + 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 + (PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createAbstractProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createPropertyReference())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createCompositeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createEventPrecondition())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createAbstractProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createPropertyReference())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createCompositeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createEventPrecondition())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createContainerReferenceProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createManyBooleanAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createManyIntegerAttributeProperty())); + + newChildDescriptors.add + (createChildParameter + (PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA, + PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); + } + + /** + * 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 == PropertyPackage.Literals.UNTIL_PROPERTY__LEFT_FORMULA || + childFeature == PropertyPackage.Literals.UNTIL_PROPERTY__RIGHT_FORMULA; + + 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterStateItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterStateItemProvider.java index 9336c5ca2..3fcd8f2dc 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterStateItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterStateItemProvider.java @@ -5,6 +5,7 @@ import fr.inria.diverse.event.commons.model.scenario.ArbiterState; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; + import java.util.Collection; import java.util.List; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterTransitionItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterTransitionItemProvider.java index bd177cd6f..9ddfefe24 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterTransitionItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ArbiterTransitionItemProvider.java @@ -226,6 +226,11 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createPropertyReference())); + newChildDescriptors.add (createChildParameter (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, @@ -255,11 +260,6 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors (createChildParameter (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); - - newChildDescriptors.add - (createChildParameter - (ScenarioPackage.Literals.ARBITER_TRANSITION__GUARD, - PropertyFactory.eINSTANCE.createPropertyReference())); } /** diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java index 9f4903ba5..b63f49a6c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioElementItemProvider.java @@ -140,6 +140,11 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, + PropertyFactory.eINSTANCE.createPropertyReference())); + newChildDescriptors.add (createChildParameter (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, @@ -169,11 +174,6 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors (createChildParameter (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); - - newChildDescriptors.add - (createChildParameter - (ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD, - PropertyFactory.eINSTANCE.createPropertyReference())); } /** diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java index 39825d820..5a77f897e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/src/fr/inria/diverse/event/commons/model/scenario/provider/ScenarioFSMTransitionItemProvider.java @@ -215,6 +215,11 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + newChildDescriptors.add + (createChildParameter + (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, + PropertyFactory.eINSTANCE.createPropertyReference())); + newChildDescriptors.add (createChildParameter (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, @@ -244,11 +249,6 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors (createChildParameter (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, PropertyFactory.eINSTANCE.createManyStringAttributeProperty())); - - newChildDescriptors.add - (createChildParameter - (ScenarioPackage.Literals.SCENARIO_FSM_TRANSITION__GUARD, - PropertyFactory.eINSTANCE.createPropertyReference())); } /** diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF index 3c89248c9..351bd9b4a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/META-INF/MANIFEST.MF @@ -9,8 +9,8 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: fr.inria.diverse.event.commons.model.property.presentation, - fr.inria.diverse.event.commons.model.scenario.presentation, - fr.inria.diverse.event.commons.model.report.presentation + fr.inria.diverse.event.commons.model.arbiter.presentation, + fr.inria.diverse.event.commons.model.scenario.presentation Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources;visibility:=reexport, fr.inria.diverse.event.commons.model.edit;visibility:=reexport, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif deleted file mode 100644 index 26ea9421d720270f52a6dc2d5b8a0726aa2351de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 346 zcmZ?wbhEHb6krfwxXQrL(9jScAHRS9{{Q#qA2@IT$YuD?z`*by$o~Hy%=-U-&x;p5 zH*cn$Ipc8Pz?KQNK(wLXZcUHF@@}U^9nN!GU8gs>HJAI=mHJf|2VB{dd24UYgA@Hf zfBpIX^Y_;uzdwEb{o(8Hx1WB!`tbAq%O7{1e+ODXEui?5g^_`QjX?)wAjnS)Y~>Ek z1s*y=iYHVqX|z<#yTIF``7>g@%*sNhS5?+GJtqojwaYydSQ;U?las$GIz%(d?T7or zM)}AtaTOI_))w9-aaX2-R+g4RCRhF{UY2S7{9Qd$`&lNsNT{l|wJwryl~h|*#lK2T W(p74cQ~}FoDIX^${`oGB4AuZ%t9q0G diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif deleted file mode 100644 index 023a6d4bd7b72c780d173567f7e3ce552951c45c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2462 zcmd6m`8OMg8ivzyXM`x-QPZJfTAHHK&QR5AsWql$w2Ic!kg?USY8f{w=)@9er5!BYj=!_Znuek4d&imtcp6{IRvvaUDGxu`>TnBsx>}7X% zcXj>C>iTB}dwftJ85GP)Wg9E&Uo1Q`ExocVy)wHN7qccO5q!QCi)HPXdjpQM@yoS^ z<80wr`+z*>pu(FW#WzEWTpr?GAL8A@pSed8-6IK}F(l8JlKXLGKJgX4dz8Zy$%y32 zpp@#+)Y|a$=Mm|3(Z5q4Wi=#VntsEz{Dy5#Euy1}=;)Hp%#toFnT6ZqML|_BzP1lv z%O=+Mmo{+9_86cv^XeGGw9XMadz{fX(aRTcMrQ<5i(^v@<6@cc-O{vlRU}!Smv2gC z>zD6kUAdoac`x&-cg|Js>}$Rln+N}Hfwc?Bv-QV1{+bU9DsTzIyN2Q2BA&TN5#6H* z9x)`3J^51KgbJVda^HkNIx;ywJRucKExZxS#M0F%$@0wnhiU1`^4h23 zIyRB|s`TH1jRRHfd}`MSy>GmS_qOkkY0m2z-q@@_v^X;Pet2STd|D=5+K?=+Eq(a3 zxUx0ydS+;1P9R!%Gc6O&EWMlmAeOF7N#ydiPfH&@F0O2T*!;4(@p*oEQ@XUixVp8n z@p+5pvo+PcIom(cSJ~E5QbaCFCln?X;9{}4@RT%CQ*#ZywX2u;FZ~1UUCjCl0v=M6=ct7?-u|{y8s0xZTrTum#IpJ4ete-9NX^-(sLx5 zjq28Bsv880&YUkqW@s2kX*=M2AsIT>2ne@%&LQ9Md^@pr%^!dMnebcY(T`kPn2*k^h*qzHBmNX&LLS^Yx*k$~C`&M|yaW#4P zwpXVVDo!~0aeg`$I7Ao2>zT*6$*orQgO3~er<8q*_aXAbjE_E^iH*^`P#OuoVn$FH za<NG<$-i0f=2;479^fm%nqlV1qOp|i=^OqhBUpxs zg$`Q3AFSd62x?y$72v16Pw++^pu;eQZtXl!iBGz%BPo$qA*%w?+OMJQDC82k>A4#(plak`tK^*UGs^qGYI5P28SQsv~s)?1no zM#zskgA6H8@;;YeFAwO1=Kvc>WNuuowDQCl6Y80CzCR?GANk8wF4U2u2Y1`3JYBuqNL4>Bh4vi%gU{k?s)%$m zaBE+uDk=O2&1W3T_>DXv&DFT)Po4;%;BP8!5XfbBV5T11_uAe7L%Kiml9GqWH4pNr z^vO`@?iwzksh%o;gr6n0by-jS8H-Wtt8bl76o?p@hX>t2roSBaZsuOon~oKKd#)S7 zkGDR+oFsekk?%tXY|KO+gF|aPh87qit0W{}TFSE+@i<@Bn!PaPKCl`uxuFJ5_`sA8 z@6eyCDSn+vi@WlZ7^rHkGMD31zw;XRS@ki1?Mup=Z#+>76_n?G2*(PIYR{+iT79EUXyWKy zU}JMbZB4UGxDHygIJ;ZAg9jvb#s-*}G*7aYrLfS(aU;J5rf-<(%Z1%py91Qn82I}b zz@>?segZ1J39IFKlW+wX5t;n}@5DOD3nyzU9ggDyd@2qd8A4Wpv)7cs_vCk0OrIJr zQck)Uw4~2vrkQB4vJfU@;sR{Jd?=m=+W;cb)|?+B%^eLd>SQ}ORy`lb@BSQJ(Lxl! zdM%i?t*FrGLLZsS76@Q-%o*L6-&&JJs{;24JrZ>4<6DNmE~ouBAt1;AQM zG1@gLit4S)d294DjR(=elXy-%fWJj7OFH z0D2-Mx@-JrKPcnJu^;ZJ8qPd9m_?yQ=j7VoCH)y^nQ#<*40reX?KG{|{^;i7{pNKJ z`gqiLuFmx;A$Q$&+;aC(E^2lI(tW>m6836+YD_=+jg>nYO2Lc=` z;10rd$VEf*`oIJ~7}SQK*kAl9zcL#|5*1#VY-+94HZU9(>ghS9rr7|Gr+l|-#OujH znik#PI8OmpeG2jF{C9Yc)q&DyA+ zqB-mOGUlUao^O;hE;99xBU87lLfH=0v&sP-RDF4fpRCY-X@j|3j{Q3(kb$ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties index 51b197608..410138d2d 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.properties @@ -51,15 +51,15 @@ _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? +_UI_ArbiterEditor_menu = &Arbiter Editor +_UI_ArbiterModelWizard_label = Arbiter Model +_UI_ArbiterModelWizard_description = Create a new Arbiter model +_UI_ArbiterEditor_label = Arbiter Model Editor +_UI_ArbiterEditorFilenameDefaultBase = My +_UI_ArbiterEditorFilenameExtensions = arbiter _UI_ScenarioEditor_menu = &Scenario Editor _UI_ScenarioModelWizard_label = Scenario Model _UI_ScenarioModelWizard_description = Create a new Scenario model _UI_ScenarioEditor_label = Scenario Model Editor _UI_ScenarioEditorFilenameDefaultBase = My _UI_ScenarioEditorFilenameExtensions = scenario -_UI_ReportEditor_menu = &Report Editor -_UI_ReportModelWizard_label = Report Model -_UI_ReportModelWizard_description = Create a new Report model -_UI_ReportEditor_label = Report Model Editor -_UI_ReportEditorFilenameDefaultBase = My -_UI_ReportEditorFilenameExtensions = report diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml index 4f05a1b8b..d4db3df76 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/plugin.xml @@ -61,31 +61,4 @@ contributorClass="fr.inria.diverse.event.commons.model.scenario.presentation.ScenarioActionBarContributor"> - - - - - %_UI_ReportModelWizard_description - - - - - - - - - diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/arbiter/presentation/ArbiterEditorPlugin.java similarity index 86% rename from framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java rename to framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/arbiter/presentation/ArbiterEditorPlugin.java index 4d1d39678..f13583545 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditorPlugin.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/arbiter/presentation/ArbiterEditorPlugin.java @@ -1,6 +1,6 @@ /** */ -package fr.inria.diverse.event.commons.model.report.presentation; +package fr.inria.diverse.event.commons.model.arbiter.presentation; import fr.inria.diverse.event.commons.model.property.provider.PropertyEditPlugin; @@ -15,19 +15,19 @@ import org.eclipse.emf.ecore.provider.EcoreEditPlugin; /** - * This is the central singleton for the Report editor plugin. + * This is the central singleton for the Arbiter editor plugin. * * * @generated */ -public final class ReportEditorPlugin extends EMFPlugin { +public final class ArbiterEditorPlugin extends EMFPlugin { /** * Keep track of the singleton. * * * @generated */ - public static final ReportEditorPlugin INSTANCE = new ReportEditorPlugin(); + public static final ArbiterEditorPlugin INSTANCE = new ArbiterEditorPlugin(); /** * Keep track of the singleton. @@ -43,7 +43,7 @@ public final class ReportEditorPlugin extends EMFPlugin { * * @generated */ - public ReportEditorPlugin() { + public ArbiterEditorPlugin() { super (new ResourceLocator [] { EcoreEditPlugin.INSTANCE, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java deleted file mode 100644 index 23179e8b8..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportActionBarContributor.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report.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 Report model editor. - * - * - * @generated - */ -public class ReportActionBarContributor - 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(ReportEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } - catch (PartInitException exception) { - ReportEditorPlugin.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(ReportEditorPlugin.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 ReportActionBarContributor() { - 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("report-settings")); - toolBarManager.add(new Separator("report-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(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditor_menu"), "fr.inria.diverse.event.commons.model.reportMenuID"); - 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(ReportEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(ReportEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener - (new IMenuListener() { - 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 - */ - 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(ReportEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(ReportEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java deleted file mode 100644 index 0a1092f33..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportEditor.java +++ /dev/null @@ -1,1828 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report.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.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.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.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.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 fr.inria.diverse.event.commons.model.report.provider.ReportItemProviderAdapterFactory; - -import fr.inria.diverse.event.commons.model.property.provider.PropertyItemProviderAdapterFactory; - -import fr.inria.diverse.event.commons.model.scenario.provider.ScenarioItemProviderAdapterFactory; - -import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; - -import org.eclipse.ui.actions.WorkspaceModifyOperation; - - -/** - * This is an example of a Report model editor. - * - * - * @generated - */ -public class ReportEditor - 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() { - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(ReportEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } - else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(ReportEditor.this); - handleActivate(); - } - } - else if (p == ReportEditor.this) { - handleActivate(); - } - } - public void partBroughtToTop(IWorkbenchPart p) { - // Ignore. - } - public void partClosed(IWorkbenchPart p) { - // Ignore. - } - public void partDeactivated(IWorkbenchPart p) { - // Ignore. - } - 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() { - 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() { - public void run() { - updateProblemIndication(); - } - }); - } - } - }; - - /** - * This listens for workspace changes. - * - * - * @generated - */ - protected IResourceChangeListener resourceChangeListener = - new IResourceChangeListener() { - 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(); - - 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() { - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(ReportEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == ReportEditor.this) { - handleActivate(); - } - } - }); - } - } - catch (CoreException exception) { - ReportEditorPlugin.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(ReportEditor.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, - "fr.inria.diverse.event.commons.model.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) { - ReportEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - markerHelper.deleteMarkers(editingDomain.getResourceSet()); - if (diagnostic.getSeverity() != Diagnostic.OK) { - try { - markerHelper.createMarkers(diagnostic); - } - catch (CoreException exception) { - ReportEditorPlugin.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 ReportEditor() { - 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 ReportItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new PropertyItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new ScenarioItemProviderAdapterFactory()); - 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() { - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec - (new Runnable() { - 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() { - 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 - */ - 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. - // - 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 - */ - 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(), editingDomain.getResourceSet().getURIConverter()); - 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) { - boolean hasErrors = !resource.getErrors().isEmpty(); - if (hasErrors || !resource.getWarnings().isEmpty()) { - BasicDiagnostic basicDiagnostic = - new BasicDiagnostic - (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, - "fr.inria.diverse.event.commons.model.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, - "fr.inria.diverse.event.commons.model.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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(), ReportEditor.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() { - 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() { - 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. - // - 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) { - ReportEditor.this.setSelectionToViewer(selection); - ReportEditor.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. - // - ReportEditorPlugin.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 - */ - 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 - */ - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * @generated - */ - 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 - */ - 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 ReportEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return ReportEditorPlugin.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 - */ - 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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java deleted file mode 100644 index 9df62a07c..000000000 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/report/presentation/ReportModelWizard.java +++ /dev/null @@ -1,628 +0,0 @@ -/** - */ -package fr.inria.diverse.event.commons.model.report.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.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.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; - -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; - -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.emf.ecore.xmi.XMLResource; - -import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; - -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.jface.dialogs.MessageDialog; - -import org.eclipse.jface.viewers.IStructuredSelection; - -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; - -import org.eclipse.swt.SWT; - -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.ModifyEvent; - -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.actions.WorkspaceModifyOperation; - -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; - -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.ISetSelectionTarget; - -import fr.inria.diverse.event.commons.model.report.ReportFactory; -import fr.inria.diverse.event.commons.model.report.ReportPackage; -import fr.inria.diverse.event.commons.model.report.provider.ReportEditPlugin; - - -import org.eclipse.core.runtime.Path; - -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; - -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; - - -/** - * This is a simple wizard for creating a new model file. - * - * - * @generated - */ -public class ReportModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = - ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * @generated - */ - protected ReportPackage reportPackage = ReportPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * @generated - */ - protected ReportFactory reportFactory = reportPackage.getReportFactory(); - - /** - * This is the file creation page. - * - * - * @generated - */ - protected ReportModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * @generated - */ - protected ReportModelWizardInitialObjectCreationPage 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 - */ - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(ReportEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(ReportEditorPlugin.INSTANCE.getImage("full/wizban/NewReport"))); - } - - /** - * 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 : reportPackage.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)reportPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = reportFactory.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) { - ReportEditorPlugin.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() { - 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(), ReportEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } - catch (Exception exception) { - ReportEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * @generated - */ - public class ReportModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * @generated - */ - public ReportModelWizardNewFileCreationPage(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(ReportEditorPlugin.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 ReportModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * @generated - */ - public ReportModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * @generated - */ - 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(ReportEditorPlugin.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(ReportEditorPlugin.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() { - 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 ReportEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } - catch(MissingResourceException mre) { - ReportEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer(ReportEditorPlugin.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 ReportModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_label")); - newFileCreationPage.setDescription(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_description")); - newFileCreationPage.setFileName(ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameDefaultBase") + "." + 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 = ReportEditorPlugin.INSTANCE.getString("_UI_ReportEditorFilenameDefaultBase"); - 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 ReportModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(ReportEditorPlugin.INSTANCE.getString("_UI_ReportModelWizard_label")); - initialObjectCreationPage.setDescription(ReportEditorPlugin.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/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioModelWizard.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioModelWizard.java index 5787746cc..3a7540e19 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioModelWizard.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/src/fr/inria/diverse/event/commons/model/scenario/presentation/ScenarioModelWizard.java @@ -395,7 +395,8 @@ public ScenarioModelWizardInitialObjectCreationPage(String pageId) { * @generated */ public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); { + Composite composite = new Composite(parent, SWT.NONE); + { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF index dd4447134..6fc920320 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/META-INF/MANIFEST.MF @@ -16,7 +16,10 @@ Export-Package: fr.inria.diverse.event.commons.model, fr.inria.diverse.event.commons.model.property.util, fr.inria.diverse.event.commons.model.report, fr.inria.diverse.event.commons.model.report.impl, - fr.inria.diverse.event.commons.model.report.util + fr.inria.diverse.event.commons.model.report.util, + fr.inria.diverse.event.commons.model.arbiter, + fr.inria.diverse.event.commons.model.arbiter.impl, + fr.inria.diverse.event.commons.model.arbiter.util Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, fr.inria.diverse.event.commons.model;visibility:=reexport, diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore index 91f554bfb..1a25e6569 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/property.ecore @@ -1,164 +1,227 @@ - - - - + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - - - + - + + + + + + + + + + + + + + + + - + - + - + - + - - + + - + - - + + - - - + + + - + - + - - + + - + - + - - + + - - - - - - - + + + + + - - - - - - - + + + + + - - - - - - - + + + + + - - - - - - + + + + - - - - - - + + + + - - - - - - + + + + - - - - - - - - - - - - + + - + @@ -175,7 +238,4 @@ - - - diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore index 0a4ee4d03..b0a1ff4b7 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/model/scenario.ecore @@ -1,20 +1,23 @@ - + - + - - + + - - - + + + @@ -24,236 +27,221 @@ - + - - + + - - - + + - + - - + + - + - - - + - - - - + - - + + + - - - + - - - + + + - + - - - + - + - - - + + + - - - + + + - - + + - + - + - - + + - - - - - + + + - + - + - - - - + - - + + - - + + + - - - + - + - + - - + + - - - - - + + + - - - + - - - + + + - - - + + + - - + + - - + + - + - - - - + + - - - + - - + + - - + + - - - - - - + + + + - - - + - - + + - - - - + - - + + - - + + + diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java new file mode 100644 index 000000000..c61172adf --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Arbiter.java @@ -0,0 +1,86 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +import fr.inria.diverse.event.commons.model.property.Property; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Arbiter'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getStates States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getTransitions Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState Initial State}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter() + * @model abstract="true" + * @generated + */ +public interface Arbiter

    , T extends Transition> extends EObject { + /** + * Returns the value of the 'States' containment reference list. + * + *

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

    + * + * @return the value of the 'States' containment reference list. + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter_States() + * @model containment="true" + * @generated + */ + EList getStates(); + + /** + * Returns the value of the 'Transitions' containment reference list. + * + *

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

    + * + * @return the value of the 'Transitions' containment reference list. + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter_Transitions() + * @model containment="true" + * @generated + */ + EList getTransitions(); + + /** + * Returns the value of the 'Initial State' reference. + * + *

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

    + * + * @return the value of the 'Initial State' reference. + * @see #setInitialState(State) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getArbiter_InitialState() + * @model + * @generated + */ + S getInitialState(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState Initial State}' reference. + * + * + * @param value the new value of the 'Initial State' reference. + * @see #getInitialState() + * @generated + */ + void setInitialState(S value); + +} // Arbiter diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java new file mode 100644 index 000000000..9c1785570 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterFactory.java @@ -0,0 +1,33 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +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 fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage + * @generated + */ +public interface ArbiterFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + ArbiterFactory eINSTANCE = fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterFactoryImpl.init(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + ArbiterPackage getArbiterPackage(); + +} //ArbiterFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java new file mode 100644 index 000000000..8bb7615f0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/ArbiterPackage.java @@ -0,0 +1,512 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +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 operation of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterFactory + * @model kind="package" + * @generated + */ +public interface ArbiterPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "arbiter"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.gemoc.org/arbiter"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "arbiter"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + ArbiterPackage eINSTANCE = fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl.init(); + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl Arbiter}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getArbiter() + * @generated + */ + int ARBITER = 0; + + /** + * The feature id for the 'States' containment reference list. + * + * + * @generated + * @ordered + */ + int ARBITER__STATES = 0; + + /** + * The feature id for the 'Transitions' containment reference list. + * + * + * @generated + * @ordered + */ + int ARBITER__TRANSITIONS = 1; + + /** + * The feature id for the 'Initial State' reference. + * + * + * @generated + * @ordered + */ + int ARBITER__INITIAL_STATE = 2; + + /** + * The number of structural features of the 'Arbiter' class. + * + * + * @generated + * @ordered + */ + int ARBITER_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Arbiter' class. + * + * + * @generated + * @ordered + */ + int ARBITER_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl State}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getState() + * @generated + */ + int STATE = 1; + + /** + * The feature id for the 'Truth Value' attribute. + * + * + * @generated + * @ordered + */ + int STATE__TRUTH_VALUE = 0; + + /** + * The feature id for the 'Outgoing Transitions' reference list. + * + * + * @generated + * @ordered + */ + int STATE__OUTGOING_TRANSITIONS = 1; + + /** + * The feature id for the 'Incoming Transitions' reference list. + * + * + * @generated + * @ordered + */ + int STATE__INCOMING_TRANSITIONS = 2; + + /** + * The number of structural features of the 'State' class. + * + * + * @generated + * @ordered + */ + int STATE_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'State' class. + * + * + * @generated + * @ordered + */ + int STATE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl Transition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTransition() + * @generated + */ + int TRANSITION = 2; + + /** + * The feature id for the 'Source' reference. + * + * + * @generated + * @ordered + */ + int TRANSITION__SOURCE = 0; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int TRANSITION__TARGET = 1; + + /** + * The feature id for the 'Guard' containment reference. + * + * + * @generated + * @ordered + */ + int TRANSITION__GUARD = 2; + + /** + * The number of structural features of the 'Transition' class. + * + * + * @generated + * @ordered + */ + int TRANSITION_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Transition' class. + * + * + * @generated + * @ordered + */ + int TRANSITION_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.arbiter.TruthValue Truth Value}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTruthValue() + * @generated + */ + int TRUTH_VALUE = 3; + + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter Arbiter}'. + * + * + * @return the meta object for class 'Arbiter'. + * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter + * @generated + */ + EClass getArbiter(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getStates States}'. + * + * + * @return the meta object for the containment reference list 'States'. + * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter#getStates() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_States(); + + /** + * Returns the meta object for the containment reference list '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getTransitions Transitions}'. + * + * + * @return the meta object for the containment reference list 'Transitions'. + * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter#getTransitions() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_Transitions(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState Initial State}'. + * + * + * @return the meta object for the reference 'Initial State'. + * @see fr.inria.diverse.event.commons.model.arbiter.Arbiter#getInitialState() + * @see #getArbiter() + * @generated + */ + EReference getArbiter_InitialState(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.arbiter.State State}'. + * + * + * @return the meta object for class 'State'. + * @see fr.inria.diverse.event.commons.model.arbiter.State + * @generated + */ + EClass getState(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue Truth Value}'. + * + * + * @return the meta object for the attribute 'Truth Value'. + * @see fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue() + * @see #getState() + * @generated + */ + EAttribute getState_TruthValue(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions Outgoing Transitions}'. + * + * + * @return the meta object for the reference list 'Outgoing Transitions'. + * @see fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions() + * @see #getState() + * @generated + */ + EReference getState_OutgoingTransitions(); + + /** + * Returns the meta object for the reference list '{@link fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions Incoming Transitions}'. + * + * + * @return the meta object for the reference list 'Incoming Transitions'. + * @see fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions() + * @see #getState() + * @generated + */ + EReference getState_IncomingTransitions(); + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.arbiter.Transition Transition}'. + * + * + * @return the meta object for class 'Transition'. + * @see fr.inria.diverse.event.commons.model.arbiter.Transition + * @generated + */ + EClass getTransition(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}'. + * + * + * @return the meta object for the reference 'Source'. + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getSource() + * @see #getTransition() + * @generated + */ + EReference getTransition_Source(); + + /** + * Returns the meta object for the reference '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget() + * @see #getTransition() + * @generated + */ + EReference getTransition_Target(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard Guard}'. + * + * + * @return the meta object for the containment reference 'Guard'. + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard() + * @see #getTransition() + * @generated + */ + EReference getTransition_Guard(); + + /** + * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.arbiter.TruthValue Truth Value}'. + * + * + * @return the meta object for enum 'Truth Value'. + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @generated + */ + EEnum getTruthValue(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + ArbiterFactory getArbiterFactory(); + + /** + * + * 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 fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl Arbiter}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getArbiter() + * @generated + */ + EClass ARBITER = eINSTANCE.getArbiter(); + + /** + * The meta object literal for the 'States' containment reference list feature. + * + * + * @generated + */ + EReference ARBITER__STATES = eINSTANCE.getArbiter_States(); + + /** + * The meta object literal for the 'Transitions' containment reference list feature. + * + * + * @generated + */ + EReference ARBITER__TRANSITIONS = eINSTANCE.getArbiter_Transitions(); + + /** + * The meta object literal for the 'Initial State' reference feature. + * + * + * @generated + */ + EReference ARBITER__INITIAL_STATE = eINSTANCE.getArbiter_InitialState(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl State}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getState() + * @generated + */ + EClass STATE = eINSTANCE.getState(); + + /** + * The meta object literal for the 'Truth Value' attribute feature. + * + * + * @generated + */ + EAttribute STATE__TRUTH_VALUE = eINSTANCE.getState_TruthValue(); + + /** + * The meta object literal for the 'Outgoing Transitions' reference list feature. + * + * + * @generated + */ + EReference STATE__OUTGOING_TRANSITIONS = eINSTANCE.getState_OutgoingTransitions(); + + /** + * The meta object literal for the 'Incoming Transitions' reference list feature. + * + * + * @generated + */ + EReference STATE__INCOMING_TRANSITIONS = eINSTANCE.getState_IncomingTransitions(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl Transition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTransition() + * @generated + */ + EClass TRANSITION = eINSTANCE.getTransition(); + + /** + * The meta object literal for the 'Source' reference feature. + * + * + * @generated + */ + EReference TRANSITION__SOURCE = eINSTANCE.getTransition_Source(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference TRANSITION__TARGET = eINSTANCE.getTransition_Target(); + + /** + * The meta object literal for the 'Guard' containment reference feature. + * + * + * @generated + */ + EReference TRANSITION__GUARD = eINSTANCE.getTransition_Guard(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.arbiter.TruthValue Truth Value}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @see fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterPackageImpl#getTruthValue() + * @generated + */ + EEnum TRUTH_VALUE = eINSTANCE.getTruthValue(); + + } + +} //ArbiterPackage diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java new file mode 100644 index 000000000..658d85986 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/State.java @@ -0,0 +1,93 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +import fr.inria.diverse.event.commons.model.property.Property; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'State'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue Truth Value}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions Outgoing Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions Incoming Transitions}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState() + * @model abstract="true" + * @generated + */ +public interface State

    > extends EObject { + /** + * Returns the value of the 'Truth Value' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.arbiter.TruthValue}. + * + *

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

    + * + * @return the value of the 'Truth Value' attribute. + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @see #setTruthValue(TruthValue) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState_TruthValue() + * @model required="true" + * @generated + */ + TruthValue getTruthValue(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.State#getTruthValue Truth Value}' attribute. + * + * + * @param value the new value of the 'Truth Value' attribute. + * @see fr.inria.diverse.event.commons.model.arbiter.TruthValue + * @see #getTruthValue() + * @generated + */ + void setTruthValue(TruthValue value); + + /** + * Returns the value of the 'Outgoing Transitions' reference list. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}'. + * + *

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

    + * + * @return the value of the 'Outgoing Transitions' reference list. + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState_OutgoingTransitions() + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getSource + * @model opposite="source" + * @generated + */ + EList getOutgoingTransitions(); + + /** + * Returns the value of the 'Incoming Transitions' reference list. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}'. + * + *

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

    + * + * @return the value of the 'Incoming Transitions' reference list. + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getState_IncomingTransitions() + * @see fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget + * @model opposite="target" + * @generated + */ + EList getIncomingTransitions(); + +} // State diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java new file mode 100644 index 000000000..e57456228 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/Transition.java @@ -0,0 +1,110 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +import fr.inria.diverse.event.commons.model.property.Property; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Transition'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard Guard}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition() + * @model abstract="true" + * @generated + */ +public interface Transition

    > extends EObject { + /** + * Returns the value of the 'Source' reference. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions Outgoing Transitions}'. + * + *

    + * 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(State) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition_Source() + * @see fr.inria.diverse.event.commons.model.arbiter.State#getOutgoingTransitions + * @model opposite="outgoingTransitions" required="true" + * @generated + */ + S getSource(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getSource Source}' reference. + * + * + * @param value the new value of the 'Source' reference. + * @see #getSource() + * @generated + */ + void setSource(S value); + + /** + * Returns the value of the 'Target' reference. + * It is bidirectional and its opposite is '{@link fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions Incoming Transitions}'. + * + *

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

    + * + * @return the value of the 'Target' reference. + * @see #setTarget(State) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition_Target() + * @see fr.inria.diverse.event.commons.model.arbiter.State#getIncomingTransitions + * @model opposite="incomingTransitions" required="true" + * @generated + */ + S getTarget(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(S value); + + /** + * Returns the value of the 'Guard' containment reference. + * + *

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

    + * + * @return the value of the 'Guard' containment reference. + * @see #setGuard(Property) + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTransition_Guard() + * @model containment="true" + * @generated + */ + P getGuard(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.arbiter.Transition#getGuard Guard}' containment reference. + * + * + * @param value the new value of the 'Guard' containment reference. + * @see #getGuard() + * @generated + */ + void setGuard(P value); + +} // Transition diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java new file mode 100644 index 000000000..07ecc3ae0 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/TruthValue.java @@ -0,0 +1,241 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter; + +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 'Truth Value', + * and utility methods for working with them. + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#getTruthValue() + * @model + * @generated + */ +public enum TruthValue 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 'INCONCLUSIVE' literal object. + * + * + * @see #INCONCLUSIVE_VALUE + * @generated + * @ordered + */ + INCONCLUSIVE(2, "INCONCLUSIVE", "INCONCLUSIVE"); + + /** + * 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 + * @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 + * @generated + * @ordered + */ + public static final int FALSE_VALUE = 1; + + /** + * The 'INCONCLUSIVE' literal value. + * + *

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

    + * + * @see #INCONCLUSIVE + * @model + * @generated + * @ordered + */ + public static final int INCONCLUSIVE_VALUE = 2; + + /** + * An array of all the 'Truth Value' enumerators. + * + * + * @generated + */ + private static final TruthValue[] VALUES_ARRAY = + new TruthValue[] { + TRUE, + FALSE, + INCONCLUSIVE, + }; + + /** + * A public read-only list of all the 'Truth Value' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Truth Value' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static TruthValue get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TruthValue result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Truth Value' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static TruthValue getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TruthValue result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Truth Value' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static TruthValue get(int value) { + switch (value) { + case TRUE_VALUE: return TRUE; + case FALSE_VALUE: return FALSE; + case INCONCLUSIVE_VALUE: return INCONCLUSIVE; + } + 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 TruthValue(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //TruthValue diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java new file mode 100644 index 000000000..23fb78cab --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterFactoryImpl.java @@ -0,0 +1,135 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.*; + +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; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class ArbiterFactoryImpl extends EFactoryImpl implements ArbiterFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static ArbiterFactory init() { + try { + ArbiterFactory theArbiterFactory = (ArbiterFactory)EPackage.Registry.INSTANCE.getEFactory(ArbiterPackage.eNS_URI); + if (theArbiterFactory != null) { + return theArbiterFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new ArbiterFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public ArbiterFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + 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 ArbiterPackage.TRUTH_VALUE: + return createTruthValueFromString(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 ArbiterPackage.TRUTH_VALUE: + return convertTruthValueToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public TruthValue createTruthValueFromString(EDataType eDataType, String initialValue) { + TruthValue result = TruthValue.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertTruthValueToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public ArbiterPackage getArbiterPackage() { + return (ArbiterPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static ArbiterPackage getPackage() { + return ArbiterPackage.eINSTANCE; + } + +} //ArbiterFactoryImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java new file mode 100644 index 000000000..127c2b2ba --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterImpl.java @@ -0,0 +1,254 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.Arbiter; +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.Transition; + +import fr.inria.diverse.event.commons.model.property.Property; + +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.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Arbiter'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl#getStates States}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl#getTransitions Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.ArbiterImpl#getInitialState Initial State}
    • + *
    + * + * @generated + */ +public abstract class ArbiterImpl

    , T extends Transition> extends MinimalEObjectImpl.Container implements Arbiter { + /** + * The cached value of the '{@link #getStates() States}' containment reference list. + * + * + * @see #getStates() + * @generated + * @ordered + */ + protected EList states; + + /** + * The cached value of the '{@link #getTransitions() Transitions}' containment reference list. + * + * + * @see #getTransitions() + * @generated + * @ordered + */ + protected EList transitions; + + /** + * The cached value of the '{@link #getInitialState() Initial State}' reference. + * + * + * @see #getInitialState() + * @generated + * @ordered + */ + protected S initialState; + + /** + * + * + * @generated + */ + protected ArbiterImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ArbiterPackage.Literals.ARBITER; + } + + /** + * + * + * @generated + */ + public EList getStates() { + if (states == null) { + states = new EObjectContainmentEList(State.class, this, ArbiterPackage.ARBITER__STATES); + } + return states; + } + + /** + * + * + * @generated + */ + public EList getTransitions() { + if (transitions == null) { + transitions = new EObjectContainmentEList(Transition.class, this, ArbiterPackage.ARBITER__TRANSITIONS); + } + return transitions; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public S getInitialState() { + if (initialState != null && initialState.eIsProxy()) { + InternalEObject oldInitialState = (InternalEObject)initialState; + initialState = (S)eResolveProxy(oldInitialState); + if (initialState != oldInitialState) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArbiterPackage.ARBITER__INITIAL_STATE, oldInitialState, initialState)); + } + } + return initialState; + } + + /** + * + * + * @generated + */ + public S basicGetInitialState() { + return initialState; + } + + /** + * + * + * @generated + */ + public void setInitialState(S newInitialState) { + S oldInitialState = initialState; + initialState = newInitialState; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.ARBITER__INITIAL_STATE, oldInitialState, initialState)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + return ((InternalEList)getStates()).basicRemove(otherEnd, msgs); + case ArbiterPackage.ARBITER__TRANSITIONS: + return ((InternalEList)getTransitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + return getStates(); + case ArbiterPackage.ARBITER__TRANSITIONS: + return getTransitions(); + case ArbiterPackage.ARBITER__INITIAL_STATE: + if (resolve) return getInitialState(); + return basicGetInitialState(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + getStates().clear(); + getStates().addAll((Collection)newValue); + return; + case ArbiterPackage.ARBITER__TRANSITIONS: + getTransitions().clear(); + getTransitions().addAll((Collection)newValue); + return; + case ArbiterPackage.ARBITER__INITIAL_STATE: + setInitialState((S)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + getStates().clear(); + return; + case ArbiterPackage.ARBITER__TRANSITIONS: + getTransitions().clear(); + return; + case ArbiterPackage.ARBITER__INITIAL_STATE: + setInitialState((S)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ArbiterPackage.ARBITER__STATES: + return states != null && !states.isEmpty(); + case ArbiterPackage.ARBITER__TRANSITIONS: + return transitions != null && !transitions.isEmpty(); + case ArbiterPackage.ARBITER__INITIAL_STATE: + return initialState != null; + } + return super.eIsSet(featureID); + } + +} //ArbiterImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java new file mode 100644 index 000000000..ea9bd5f66 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/ArbiterPackageImpl.java @@ -0,0 +1,387 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.Arbiter; +import fr.inria.diverse.event.commons.model.arbiter.ArbiterFactory; +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.Transition; +import fr.inria.diverse.event.commons.model.arbiter.TruthValue; + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.ETypeParameter; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class ArbiterPackageImpl extends EPackageImpl implements ArbiterPackage { + /** + * + * + * @generated + */ + private EClass arbiterEClass = null; + + /** + * + * + * @generated + */ + private EClass stateEClass = null; + + /** + * + * + * @generated + */ + private EClass transitionEClass = null; + + /** + * + * + * @generated + */ + private EEnum truthValueEEnum = 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 fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage#eNS_URI + * @see #init() + * @generated + */ + private ArbiterPackageImpl() { + super(eNS_URI, ArbiterFactory.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 ArbiterPackage#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 ArbiterPackage init() { + if (isInited) return (ArbiterPackage)EPackage.Registry.INSTANCE.getEPackage(ArbiterPackage.eNS_URI); + + // Obtain or create and register package + ArbiterPackageImpl theArbiterPackage = (ArbiterPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ArbiterPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ArbiterPackageImpl()); + + isInited = true; + + // Create package meta-data objects + theArbiterPackage.createPackageContents(); + + // Initialize created meta-data + theArbiterPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theArbiterPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(ArbiterPackage.eNS_URI, theArbiterPackage); + return theArbiterPackage; + } + + /** + * + * + * @generated + */ + public EClass getArbiter() { + return arbiterEClass; + } + + /** + * + * + * @generated + */ + public EReference getArbiter_States() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getArbiter_Transitions() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getArbiter_InitialState() { + return (EReference)arbiterEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getState() { + return stateEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getState_TruthValue() { + return (EAttribute)stateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getState_OutgoingTransitions() { + return (EReference)stateEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getState_IncomingTransitions() { + return (EReference)stateEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getTransition() { + return transitionEClass; + } + + /** + * + * + * @generated + */ + public EReference getTransition_Source() { + return (EReference)transitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getTransition_Target() { + return (EReference)transitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getTransition_Guard() { + return (EReference)transitionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EEnum getTruthValue() { + return truthValueEEnum; + } + + /** + * + * + * @generated + */ + public ArbiterFactory getArbiterFactory() { + return (ArbiterFactory)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 + arbiterEClass = createEClass(ARBITER); + createEReference(arbiterEClass, ARBITER__STATES); + createEReference(arbiterEClass, ARBITER__TRANSITIONS); + createEReference(arbiterEClass, ARBITER__INITIAL_STATE); + + stateEClass = createEClass(STATE); + createEAttribute(stateEClass, STATE__TRUTH_VALUE); + createEReference(stateEClass, STATE__OUTGOING_TRANSITIONS); + createEReference(stateEClass, STATE__INCOMING_TRANSITIONS); + + transitionEClass = createEClass(TRANSITION); + createEReference(transitionEClass, TRANSITION__SOURCE); + createEReference(transitionEClass, TRANSITION__TARGET); + createEReference(transitionEClass, TRANSITION__GUARD); + + // Create enums + truthValueEEnum = createEEnum(TRUTH_VALUE); + } + + /** + * + * + * @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 + PropertyPackage thePropertyPackage = (PropertyPackage)EPackage.Registry.INSTANCE.getEPackage(PropertyPackage.eNS_URI); + + // Create type parameters + ETypeParameter arbiterEClass_P = addETypeParameter(arbiterEClass, "P"); + ETypeParameter arbiterEClass_S = addETypeParameter(arbiterEClass, "S"); + ETypeParameter arbiterEClass_T = addETypeParameter(arbiterEClass, "T"); + ETypeParameter stateEClass_P = addETypeParameter(stateEClass, "P"); + ETypeParameter stateEClass_T = addETypeParameter(stateEClass, "T"); + ETypeParameter transitionEClass_P = addETypeParameter(transitionEClass, "P"); + ETypeParameter transitionEClass_S = addETypeParameter(transitionEClass, "S"); + + // Set bounds for type parameters + EGenericType g1 = createEGenericType(thePropertyPackage.getProperty()); + arbiterEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getState()); + EGenericType g2 = createEGenericType(arbiterEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(arbiterEClass_T); + g1.getETypeArguments().add(g2); + arbiterEClass_S.getEBounds().add(g1); + g1 = createEGenericType(this.getTransition()); + g2 = createEGenericType(arbiterEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(arbiterEClass_S); + g1.getETypeArguments().add(g2); + arbiterEClass_T.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getProperty()); + stateEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getTransition()); + g2 = createEGenericType(stateEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + stateEClass_T.getEBounds().add(g1); + g1 = createEGenericType(thePropertyPackage.getProperty()); + transitionEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getState()); + g2 = createEGenericType(transitionEClass_P); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + transitionEClass_S.getEBounds().add(g1); + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(arbiterEClass, Arbiter.class, "Arbiter", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(arbiterEClass_S); + initEReference(getArbiter_States(), g1, null, "states", null, 0, -1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterEClass_T); + initEReference(getArbiter_Transitions(), g1, null, "transitions", null, 0, -1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(arbiterEClass_S); + initEReference(getArbiter_InitialState(), g1, null, "initialState", null, 0, 1, Arbiter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(stateEClass, State.class, "State", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getState_TruthValue(), this.getTruthValue(), "truthValue", null, 1, 1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(stateEClass_T); + initEReference(getState_OutgoingTransitions(), g1, this.getTransition_Source(), "outgoingTransitions", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(stateEClass_T); + initEReference(getState_IncomingTransitions(), g1, this.getTransition_Target(), "incomingTransitions", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(transitionEClass, Transition.class, "Transition", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(transitionEClass_S); + initEReference(getTransition_Source(), g1, this.getState_OutgoingTransitions(), "source", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(transitionEClass_S); + initEReference(getTransition_Target(), g1, this.getState_IncomingTransitions(), "target", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(transitionEClass_P); + initEReference(getTransition_Guard(), g1, null, "guard", null, 0, 1, Transition.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(truthValueEEnum, TruthValue.class, "TruthValue"); + addEEnumLiteral(truthValueEEnum, TruthValue.TRUE); + addEEnumLiteral(truthValueEEnum, TruthValue.FALSE); + addEEnumLiteral(truthValueEEnum, TruthValue.INCONCLUSIVE); + + // Create resource + createResource(eNS_URI); + } + +} //ArbiterPackageImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java new file mode 100644 index 000000000..04290b646 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/StateImpl.java @@ -0,0 +1,278 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.Transition; +import fr.inria.diverse.event.commons.model.arbiter.TruthValue; + +import fr.inria.diverse.event.commons.model.property.Property; + +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.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'State'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl#getTruthValue Truth Value}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl#getOutgoingTransitions Outgoing Transitions}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.StateImpl#getIncomingTransitions Incoming Transitions}
    • + *
    + * + * @generated + */ +public abstract class StateImpl

    > extends MinimalEObjectImpl.Container implements State { + /** + * The default value of the '{@link #getTruthValue() Truth Value}' attribute. + * + * + * @see #getTruthValue() + * @generated + * @ordered + */ + protected static final TruthValue TRUTH_VALUE_EDEFAULT = TruthValue.TRUE; + + /** + * The cached value of the '{@link #getTruthValue() Truth Value}' attribute. + * + * + * @see #getTruthValue() + * @generated + * @ordered + */ + protected TruthValue truthValue = TRUTH_VALUE_EDEFAULT; + + /** + * The cached value of the '{@link #getOutgoingTransitions() Outgoing Transitions}' reference list. + * + * + * @see #getOutgoingTransitions() + * @generated + * @ordered + */ + protected EList outgoingTransitions; + + /** + * The cached value of the '{@link #getIncomingTransitions() Incoming Transitions}' reference list. + * + * + * @see #getIncomingTransitions() + * @generated + * @ordered + */ + protected EList incomingTransitions; + + /** + * + * + * @generated + */ + protected StateImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ArbiterPackage.Literals.STATE; + } + + /** + * + * + * @generated + */ + public TruthValue getTruthValue() { + return truthValue; + } + + /** + * + * + * @generated + */ + public void setTruthValue(TruthValue newTruthValue) { + TruthValue oldTruthValue = truthValue; + truthValue = newTruthValue == null ? TRUTH_VALUE_EDEFAULT : newTruthValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.STATE__TRUTH_VALUE, oldTruthValue, truthValue)); + } + + /** + * + * + * @generated + */ + public EList getOutgoingTransitions() { + if (outgoingTransitions == null) { + outgoingTransitions = new EObjectWithInverseResolvingEList(Transition.class, this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, ArbiterPackage.TRANSITION__SOURCE); + } + return outgoingTransitions; + } + + /** + * + * + * @generated + */ + public EList getIncomingTransitions() { + if (incomingTransitions == null) { + incomingTransitions = new EObjectWithInverseResolvingEList(Transition.class, this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, ArbiterPackage.TRANSITION__TARGET); + } + return incomingTransitions; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + return ((InternalEList)(InternalEList)getOutgoingTransitions()).basicAdd(otherEnd, msgs); + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + return ((InternalEList)(InternalEList)getIncomingTransitions()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + return ((InternalEList)getOutgoingTransitions()).basicRemove(otherEnd, msgs); + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + return ((InternalEList)getIncomingTransitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ArbiterPackage.STATE__TRUTH_VALUE: + return getTruthValue(); + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + return getOutgoingTransitions(); + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + return getIncomingTransitions(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ArbiterPackage.STATE__TRUTH_VALUE: + setTruthValue((TruthValue)newValue); + return; + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + getOutgoingTransitions().clear(); + getOutgoingTransitions().addAll((Collection)newValue); + return; + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + getIncomingTransitions().clear(); + getIncomingTransitions().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ArbiterPackage.STATE__TRUTH_VALUE: + setTruthValue(TRUTH_VALUE_EDEFAULT); + return; + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + getOutgoingTransitions().clear(); + return; + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + getIncomingTransitions().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ArbiterPackage.STATE__TRUTH_VALUE: + return truthValue != TRUTH_VALUE_EDEFAULT; + case ArbiterPackage.STATE__OUTGOING_TRANSITIONS: + return outgoingTransitions != null && !outgoingTransitions.isEmpty(); + case ArbiterPackage.STATE__INCOMING_TRANSITIONS: + return incomingTransitions != null && !incomingTransitions.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (truthValue: "); + result.append(truthValue); + result.append(')'); + return result.toString(); + } + +} //StateImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java new file mode 100644 index 000000000..5e1c71e99 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/impl/TransitionImpl.java @@ -0,0 +1,370 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.impl; + +import fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage; +import fr.inria.diverse.event.commons.model.arbiter.State; +import fr.inria.diverse.event.commons.model.arbiter.Transition; + +import fr.inria.diverse.event.commons.model.property.Property; + +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.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Transition'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl#getSource Source}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl#getTarget Target}
    • + *
    • {@link fr.inria.diverse.event.commons.model.arbiter.impl.TransitionImpl#getGuard Guard}
    • + *
    + * + * @generated + */ +public abstract class TransitionImpl

    > extends MinimalEObjectImpl.Container implements Transition { + /** + * The cached value of the '{@link #getSource() Source}' reference. + * + * + * @see #getSource() + * @generated + * @ordered + */ + protected S source; + + /** + * The cached value of the '{@link #getTarget() Target}' reference. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected S target; + + /** + * The cached value of the '{@link #getGuard() Guard}' containment reference. + * + * + * @see #getGuard() + * @generated + * @ordered + */ + protected P guard; + + /** + * + * + * @generated + */ + protected TransitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ArbiterPackage.Literals.TRANSITION; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public S getSource() { + if (source != null && source.eIsProxy()) { + InternalEObject oldSource = (InternalEObject)source; + source = (S)eResolveProxy(oldSource); + if (source != oldSource) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArbiterPackage.TRANSITION__SOURCE, oldSource, source)); + } + } + return source; + } + + /** + * + * + * @generated + */ + public S basicGetSource() { + return source; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSource(S newSource, NotificationChain msgs) { + S oldSource = source; + source = newSource; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__SOURCE, oldSource, newSource); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setSource(S newSource) { + if (newSource != source) { + NotificationChain msgs = null; + if (source != null) + msgs = ((InternalEObject)source).eInverseRemove(this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, State.class, msgs); + if (newSource != null) + msgs = ((InternalEObject)newSource).eInverseAdd(this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, State.class, msgs); + msgs = basicSetSource(newSource, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__SOURCE, newSource, newSource)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public S getTarget() { + if (target != null && target.eIsProxy()) { + InternalEObject oldTarget = (InternalEObject)target; + target = (S)eResolveProxy(oldTarget); + if (target != oldTarget) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArbiterPackage.TRANSITION__TARGET, oldTarget, target)); + } + } + return target; + } + + /** + * + * + * @generated + */ + public S basicGetTarget() { + return target; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTarget(S newTarget, NotificationChain msgs) { + S oldTarget = target; + target = newTarget; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__TARGET, oldTarget, newTarget); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setTarget(S newTarget) { + if (newTarget != target) { + NotificationChain msgs = null; + if (target != null) + msgs = ((InternalEObject)target).eInverseRemove(this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, State.class, msgs); + if (newTarget != null) + msgs = ((InternalEObject)newTarget).eInverseAdd(this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, State.class, msgs); + msgs = basicSetTarget(newTarget, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__TARGET, newTarget, newTarget)); + } + + /** + * + * + * @generated + */ + public P getGuard() { + return guard; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetGuard(P newGuard, NotificationChain msgs) { + P oldGuard = guard; + guard = newGuard; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__GUARD, oldGuard, newGuard); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setGuard(P newGuard) { + if (newGuard != guard) { + NotificationChain msgs = null; + if (guard != null) + msgs = ((InternalEObject)guard).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ArbiterPackage.TRANSITION__GUARD, null, msgs); + if (newGuard != null) + msgs = ((InternalEObject)newGuard).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ArbiterPackage.TRANSITION__GUARD, null, msgs); + msgs = basicSetGuard(newGuard, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ArbiterPackage.TRANSITION__GUARD, newGuard, newGuard)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + if (source != null) + msgs = ((InternalEObject)source).eInverseRemove(this, ArbiterPackage.STATE__OUTGOING_TRANSITIONS, State.class, msgs); + return basicSetSource((S)otherEnd, msgs); + case ArbiterPackage.TRANSITION__TARGET: + if (target != null) + msgs = ((InternalEObject)target).eInverseRemove(this, ArbiterPackage.STATE__INCOMING_TRANSITIONS, State.class, msgs); + return basicSetTarget((S)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + return basicSetSource(null, msgs); + case ArbiterPackage.TRANSITION__TARGET: + return basicSetTarget(null, msgs); + case ArbiterPackage.TRANSITION__GUARD: + return basicSetGuard(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + if (resolve) return getSource(); + return basicGetSource(); + case ArbiterPackage.TRANSITION__TARGET: + if (resolve) return getTarget(); + return basicGetTarget(); + case ArbiterPackage.TRANSITION__GUARD: + return getGuard(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + setSource((S)newValue); + return; + case ArbiterPackage.TRANSITION__TARGET: + setTarget((S)newValue); + return; + case ArbiterPackage.TRANSITION__GUARD: + setGuard((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + setSource((S)null); + return; + case ArbiterPackage.TRANSITION__TARGET: + setTarget((S)null); + return; + case ArbiterPackage.TRANSITION__GUARD: + setGuard((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ArbiterPackage.TRANSITION__SOURCE: + return source != null; + case ArbiterPackage.TRANSITION__TARGET: + return target != null; + case ArbiterPackage.TRANSITION__GUARD: + return guard != null; + } + return super.eIsSet(featureID); + } + +} //TransitionImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java new file mode 100644 index 000000000..017386081 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterAdapterFactory.java @@ -0,0 +1,158 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.util; + +import fr.inria.diverse.event.commons.model.arbiter.*; + +import fr.inria.diverse.event.commons.model.property.Property; + +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; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage + * @generated + */ +public class ArbiterAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static ArbiterPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public ArbiterAdapterFactory() { + if (modelPackage == null) { + modelPackage = ArbiterPackage.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 ArbiterSwitch modelSwitch = + new ArbiterSwitch() { + @Override + public

    , T extends Transition> Adapter caseArbiter(Arbiter object) { + return createArbiterAdapter(); + } + @Override + public

    > Adapter caseState(State object) { + return createStateAdapter(); + } + @Override + public

    > Adapter caseTransition(Transition object) { + return createTransitionAdapter(); + } + @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 fr.inria.diverse.event.commons.model.arbiter.Arbiter Arbiter}'. + * + * 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 fr.inria.diverse.event.commons.model.arbiter.Arbiter + * @generated + */ + public Adapter createArbiterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.arbiter.State State}'. + * + * 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 fr.inria.diverse.event.commons.model.arbiter.State + * @generated + */ + public Adapter createStateAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.arbiter.Transition Transition}'. + * + * 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 fr.inria.diverse.event.commons.model.arbiter.Transition + * @generated + */ + public Adapter createTransitionAdapter() { + 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; + } + +} //ArbiterAdapterFactory diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java new file mode 100644 index 000000000..dfdf655c4 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/arbiter/util/ArbiterSwitch.java @@ -0,0 +1,154 @@ +/** + */ +package fr.inria.diverse.event.commons.model.arbiter.util; + +import fr.inria.diverse.event.commons.model.arbiter.*; + +import fr.inria.diverse.event.commons.model.property.Property; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * 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 fr.inria.diverse.event.commons.model.arbiter.ArbiterPackage + * @generated + */ +public class ArbiterSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static ArbiterPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public ArbiterSwitch() { + if (modelPackage == null) { + modelPackage = ArbiterPackage.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 T1 doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case ArbiterPackage.ARBITER: { + Arbiter arbiter = (Arbiter)theEObject; + T1 result = caseArbiter(arbiter); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ArbiterPackage.STATE: { + State state = (State)theEObject; + T1 result = caseState(state); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ArbiterPackage.TRANSITION: { + Transition transition = (Transition)theEObject; + T1 result = caseTransition(transition); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Arbiter'. + * + * 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 'Arbiter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    , T extends Transition> T1 caseArbiter(Arbiter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'State'. + * + * 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 'State'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    > T1 caseState(State object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Transition'. + * + * 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 'Transition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    > T1 caseTransition(Transition 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 T1 defaultCase(EObject object) { + return null; + } + +} //ArbiterSwitch diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/AbstractProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/AbstractProperty.java new file mode 100644 index 000000000..f659c4c33 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/AbstractProperty.java @@ -0,0 +1,18 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Abstract Property'. + * + * + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getAbstractProperty() + * @model + * @generated + */ +public interface AbstractProperty extends EObject { +} // AbstractProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java index e62a4a8df..354fbe666 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/BooleanAttributeProperty.java @@ -49,7 +49,7 @@ public interface BooleanAttributeProperty extends StateProperty { /** * Returns the value of the 'Operator' attribute. - * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.ComparisonOperator}. * *

    * If the meaning of the 'Operator' attribute isn't clear, @@ -57,23 +57,23 @@ public interface BooleanAttributeProperty extends StateProperty { *

    * * @return the value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator - * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator + * @see #setOperator(ComparisonOperator) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getBooleanAttributeProperty_Operator() * @model * @generated */ - Operator getOperator(); + ComparisonOperator getOperator(); /** * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty#getOperator Operator}' attribute. * * * @param value the new value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator * @see #getOperator() * @generated */ - void setOperator(Operator value); + void setOperator(ComparisonOperator value); } // BooleanAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ComparisonOperator.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ComparisonOperator.java new file mode 100644 index 000000000..d7fb9c9e5 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ComparisonOperator.java @@ -0,0 +1,187 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +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 'Comparison Operator', + * and utility methods for working with them. + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getComparisonOperator() + * @model + * @generated + */ +public enum ComparisonOperator implements Enumerator { + /** + * The 'EQUAL' literal object. + * + * + * @see #EQUAL_VALUE + * @generated + * @ordered + */ + EQUAL(0, "EQUAL", "EQUAL"); + + /** + * The 'EQUAL' literal value. + * + *

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

    + * + * @see #EQUAL + * @model + * @generated + * @ordered + */ + public static final int EQUAL_VALUE = 0; + + /** + * An array of all the 'Comparison Operator' enumerators. + * + * + * @generated + */ + private static final ComparisonOperator[] VALUES_ARRAY = + new ComparisonOperator[] { + EQUAL, + }; + + /** + * A public read-only list of all the 'Comparison Operator' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Comparison Operator' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static ComparisonOperator get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ComparisonOperator result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Comparison Operator' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static ComparisonOperator getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ComparisonOperator result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Comparison Operator' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static ComparisonOperator get(int value) { + switch (value) { + case EQUAL_VALUE: return EQUAL; + } + 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 ComparisonOperator(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //ComparisonOperator diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/CompositeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/CompositeProperty.java index 383a64ef7..5a5371953 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/CompositeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/CompositeProperty.java @@ -20,10 +20,9 @@ * @model * @generated */ -public interface CompositeProperty extends Property { +public interface CompositeProperty

    extends Property { /** * Returns the value of the 'Properties' containment reference list. - * The list contents are of type {@link fr.inria.diverse.event.commons.model.property.Property}. * *

    * If the meaning of the 'Properties' containment reference list isn't clear, @@ -35,6 +34,6 @@ public interface CompositeProperty extends Property { * @model containment="true" * @generated */ - EList getProperties(); + EList

    getProperties(); } // CompositeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/EventPrecondition.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/EventPrecondition.java index a99bfa6db..775a431b6 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/EventPrecondition.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/EventPrecondition.java @@ -20,7 +20,7 @@ * @model * @generated */ -public interface EventPrecondition extends Property { +public interface EventPrecondition> extends Property { /** * Returns the value of the 'Event' reference. * @@ -35,7 +35,7 @@ public interface EventPrecondition extends Property { * @model * @generated */ - Event getEvent(); + E getEvent(); /** * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.EventPrecondition#getEvent Event}' reference. @@ -45,6 +45,6 @@ public interface EventPrecondition extends Property { * @see #getEvent() * @generated */ - void setEvent(Event value); + void setEvent(E value); } // EventPrecondition diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java index fc40e0cb9..54e43422d 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/IntegerAttributeProperty.java @@ -49,7 +49,7 @@ public interface IntegerAttributeProperty extends StateProperty { /** * Returns the value of the 'Operator' attribute. - * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.ComparisonOperator}. * *

    * If the meaning of the 'Operator' attribute isn't clear, @@ -57,23 +57,23 @@ public interface IntegerAttributeProperty extends StateProperty { *

    * * @return the value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator - * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator + * @see #setOperator(ComparisonOperator) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getIntegerAttributeProperty_Operator() * @model * @generated */ - Operator getOperator(); + ComparisonOperator getOperator(); /** * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty#getOperator Operator}' attribute. * * * @param value the new value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator * @see #getOperator() * @generated */ - void setOperator(Operator value); + void setOperator(ComparisonOperator value); } // IntegerAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java index c976c2de6..a863f5583 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyBooleanAttributeProperty.java @@ -79,7 +79,7 @@ public interface ManyBooleanAttributeProperty extends StateProperty { /** * Returns the value of the 'Operator' attribute. - * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.ComparisonOperator}. * *

    * If the meaning of the 'Operator' attribute isn't clear, @@ -87,23 +87,23 @@ public interface ManyBooleanAttributeProperty extends StateProperty { *

    * * @return the value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator - * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator + * @see #setOperator(ComparisonOperator) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyBooleanAttributeProperty_Operator() * @model * @generated */ - Operator getOperator(); + ComparisonOperator getOperator(); /** * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty#getOperator Operator}' attribute. * * * @param value the new value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator * @see #getOperator() * @generated */ - void setOperator(Operator value); + void setOperator(ComparisonOperator value); } // ManyBooleanAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java index f17f2bb87..63197f20e 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyIntegerAttributeProperty.java @@ -79,7 +79,7 @@ public interface ManyIntegerAttributeProperty extends StateProperty { /** * Returns the value of the 'Operator' attribute. - * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.ComparisonOperator}. * *

    * If the meaning of the 'Operator' attribute isn't clear, @@ -87,23 +87,23 @@ public interface ManyIntegerAttributeProperty extends StateProperty { *

    * * @return the value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator - * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator + * @see #setOperator(ComparisonOperator) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyIntegerAttributeProperty_Operator() * @model * @generated */ - Operator getOperator(); + ComparisonOperator getOperator(); /** * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty#getOperator Operator}' attribute. * * * @param value the new value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator * @see #getOperator() * @generated */ - void setOperator(Operator value); + void setOperator(ComparisonOperator value); } // ManyIntegerAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java index 19bff067d..37b9f81e1 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ManyStringAttributeProperty.java @@ -79,7 +79,7 @@ public interface ManyStringAttributeProperty extends StateProperty { /** * Returns the value of the 'Operator' attribute. - * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.ComparisonOperator}. * *

    * If the meaning of the 'Operator' attribute isn't clear, @@ -87,23 +87,23 @@ public interface ManyStringAttributeProperty extends StateProperty { *

    * * @return the value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator - * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator + * @see #setOperator(ComparisonOperator) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getManyStringAttributeProperty_Operator() * @model * @generated */ - Operator getOperator(); + ComparisonOperator getOperator(); /** * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty#getOperator Operator}' attribute. * * * @param value the new value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator * @see #getOperator() * @generated */ - void setOperator(Operator value); + void setOperator(ComparisonOperator value); } // ManyStringAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NegationProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NegationProperty.java new file mode 100644 index 000000000..829e98a68 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NegationProperty.java @@ -0,0 +1,49 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Negation Property'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.NegationProperty#getFormula Formula}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getNegationProperty() + * @model abstract="true" + * @generated + */ +public interface NegationProperty

    extends TemporalProperty { + /** + * Returns the value of the 'Formula' containment reference. + * + *

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

    + * + * @return the value of the 'Formula' containment reference. + * @see #setFormula(TemporalProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getNegationProperty_Formula() + * @model containment="true" + * @generated + */ + P getFormula(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.NegationProperty#getFormula Formula}' containment reference. + * + * + * @param value the new value of the 'Formula' containment reference. + * @see #getFormula() + * @generated + */ + void setFormula(P value); + +} // NegationProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NegationTemporalProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NegationTemporalProperty.java new file mode 100644 index 000000000..a4ee9daac --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NegationTemporalProperty.java @@ -0,0 +1,49 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Negation Temporal Property'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.NegationTemporalProperty#getFormula Formula}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getNegationTemporalProperty() + * @model abstract="true" + * @generated + */ +public interface NegationTemporalProperty

    extends TemporalProperty { + /** + * Returns the value of the 'Formula' containment reference. + * + *

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

    + * + * @return the value of the 'Formula' containment reference. + * @see #setFormula(TemporalProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getNegationTemporalProperty_Formula() + * @model containment="true" + * @generated + */ + P getFormula(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.NegationTemporalProperty#getFormula Formula}' containment reference. + * + * + * @param value the new value of the 'Formula' containment reference. + * @see #getFormula() + * @generated + */ + void setFormula(P value); + +} // NegationTemporalProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NextProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NextProperty.java new file mode 100644 index 000000000..71ff16fe2 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/NextProperty.java @@ -0,0 +1,49 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Next Property'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.NextProperty#getFormula Formula}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getNextProperty() + * @model abstract="true" + * @generated + */ +public interface NextProperty

    extends TemporalProperty { + /** + * Returns the value of the 'Formula' containment reference. + * + *

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

    + * + * @return the value of the 'Formula' containment reference. + * @see #setFormula(AbstractProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getNextProperty_Formula() + * @model containment="true" + * @generated + */ + P getFormula(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.NextProperty#getFormula Formula}' containment reference. + * + * + * @param value the new value of the 'Formula' containment reference. + * @see #getFormula() + * @generated + */ + void setFormula(P value); + +} // NextProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Property.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Property.java index 318429ff4..4ca472f4a 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Property.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/Property.java @@ -2,8 +2,6 @@ */ package fr.inria.diverse.event.commons.model.property; -import org.eclipse.emf.ecore.EObject; - /** * * A representation of the model object 'Property'. @@ -14,5 +12,5 @@ * @model abstract="true" * @generated */ -public interface Property extends EObject { +public interface Property extends AbstractProperty { } // Property diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java index 05dcd2388..b0702e368 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyFactory.java @@ -2,6 +2,7 @@ */ package fr.inria.diverse.event.commons.model.property; +import fr.inria.diverse.event.commons.model.scenario.Event; import org.eclipse.emf.ecore.EFactory; /** @@ -22,22 +23,13 @@ public interface PropertyFactory extends EFactory { PropertyFactory eINSTANCE = fr.inria.diverse.event.commons.model.property.impl.PropertyFactoryImpl.init(); /** - * Returns a new object of class 'Composite Property'. + * Returns a new object of class 'Abstract Property'. * * - * @return a new object of class 'Composite Property'. + * @return a new object of class 'Abstract Property'. * @generated */ - CompositeProperty createCompositeProperty(); - - /** - * Returns a new object of class 'Event Precondition'. - * - * - * @return a new object of class 'Event Precondition'. - * @generated - */ - EventPrecondition createEventPrecondition(); + AbstractProperty createAbstractProperty(); /** * Returns a new object of class 'Container Reference Property'. @@ -82,7 +74,25 @@ public interface PropertyFactory extends EFactory { * @return a new object of class 'Reference'. * @generated */ - PropertyReference createPropertyReference(); +

    PropertyReference

    createPropertyReference(); + + /** + * Returns a new object of class 'Composite Property'. + * + * + * @return a new object of class 'Composite Property'. + * @generated + */ +

    CompositeProperty

    createCompositeProperty(); + + /** + * Returns a new object of class 'Event Precondition'. + * + * + * @return a new object of class 'Event Precondition'. + * @generated + */ + > EventPrecondition createEventPrecondition(); /** * Returns the package supported by this factory. diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java index 529677ec5..111308d87 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyPackage.java @@ -58,6 +58,228 @@ public interface PropertyPackage extends EPackage { */ PropertyPackage eINSTANCE = fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl.init(); + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.AbstractPropertyImpl Abstract Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.AbstractPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getAbstractProperty() + * @generated + */ + int ABSTRACT_PROPERTY = 0; + + /** + * The number of structural features of the 'Abstract Property' class. + * + * + * @generated + * @ordered + */ + int ABSTRACT_PROPERTY_FEATURE_COUNT = 0; + + /** + * The number of operations of the 'Abstract Property' class. + * + * + * @generated + * @ordered + */ + int ABSTRACT_PROPERTY_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.TemporalPropertyImpl Temporal Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.TemporalPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getTemporalProperty() + * @generated + */ + int TEMPORAL_PROPERTY = 1; + + /** + * The number of structural features of the 'Temporal Property' class. + * + * + * @generated + * @ordered + */ + int TEMPORAL_PROPERTY_FEATURE_COUNT = ABSTRACT_PROPERTY_FEATURE_COUNT + 0; + + /** + * The number of operations of the 'Temporal Property' class. + * + * + * @generated + * @ordered + */ + int TEMPORAL_PROPERTY_OPERATION_COUNT = ABSTRACT_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.NextPropertyImpl Next Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.NextPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getNextProperty() + * @generated + */ + int NEXT_PROPERTY = 2; + + /** + * The feature id for the 'Formula' containment reference. + * + * + * @generated + * @ordered + */ + int NEXT_PROPERTY__FORMULA = TEMPORAL_PROPERTY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Next Property' class. + * + * + * @generated + * @ordered + */ + int NEXT_PROPERTY_FEATURE_COUNT = TEMPORAL_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Next Property' class. + * + * + * @generated + * @ordered + */ + int NEXT_PROPERTY_OPERATION_COUNT = TEMPORAL_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.UntilPropertyImpl Until Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.UntilPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getUntilProperty() + * @generated + */ + int UNTIL_PROPERTY = 3; + + /** + * The feature id for the 'Left Formula' containment reference. + * + * + * @generated + * @ordered + */ + int UNTIL_PROPERTY__LEFT_FORMULA = TEMPORAL_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Right Formula' containment reference. + * + * + * @generated + * @ordered + */ + int UNTIL_PROPERTY__RIGHT_FORMULA = TEMPORAL_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Until Property' class. + * + * + * @generated + * @ordered + */ + int UNTIL_PROPERTY_FEATURE_COUNT = TEMPORAL_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Until Property' class. + * + * + * @generated + * @ordered + */ + int UNTIL_PROPERTY_OPERATION_COUNT = TEMPORAL_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ReleasePropertyImpl Release Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ReleasePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getReleaseProperty() + * @generated + */ + int RELEASE_PROPERTY = 4; + + /** + * The feature id for the 'Left Formula' containment reference. + * + * + * @generated + * @ordered + */ + int RELEASE_PROPERTY__LEFT_FORMULA = TEMPORAL_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Right Formula' containment reference. + * + * + * @generated + * @ordered + */ + int RELEASE_PROPERTY__RIGHT_FORMULA = TEMPORAL_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Release Property' class. + * + * + * @generated + * @ordered + */ + int RELEASE_PROPERTY_FEATURE_COUNT = TEMPORAL_PROPERTY_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Release Property' class. + * + * + * @generated + * @ordered + */ + int RELEASE_PROPERTY_OPERATION_COUNT = TEMPORAL_PROPERTY_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.NegationTemporalPropertyImpl Negation Temporal Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.NegationTemporalPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getNegationTemporalProperty() + * @generated + */ + int NEGATION_TEMPORAL_PROPERTY = 5; + + /** + * The feature id for the 'Formula' containment reference. + * + * + * @generated + * @ordered + */ + int NEGATION_TEMPORAL_PROPERTY__FORMULA = TEMPORAL_PROPERTY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Negation Temporal Property' class. + * + * + * @generated + * @ordered + */ + int NEGATION_TEMPORAL_PROPERTY_FEATURE_COUNT = TEMPORAL_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Negation Temporal Property' class. + * + * + * @generated + * @ordered + */ + int NEGATION_TEMPORAL_PROPERTY_OPERATION_COUNT = TEMPORAL_PROPERTY_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.PropertyImpl Property}' class. * @@ -66,7 +288,7 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getProperty() * @generated */ - int PROPERTY = 0; + int PROPERTY = 6; /** * The number of structural features of the 'Property' class. @@ -75,7 +297,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int PROPERTY_FEATURE_COUNT = 0; + int PROPERTY_FEATURE_COUNT = ABSTRACT_PROPERTY_FEATURE_COUNT + 0; /** * The number of operations of the 'Property' class. @@ -84,7 +306,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int PROPERTY_OPERATION_COUNT = 0; + int PROPERTY_OPERATION_COUNT = ABSTRACT_PROPERTY_OPERATION_COUNT + 0; /** * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.CompositePropertyImpl Composite Property}' class. @@ -94,44 +316,201 @@ public interface PropertyPackage extends EPackage { * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getCompositeProperty() * @generated */ - int COMPOSITE_PROPERTY = 1; + int COMPOSITE_PROPERTY = 8; /** - * The feature id for the 'Properties' containment reference list. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.EventPreconditionImpl Event Precondition}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.EventPreconditionImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getEventPrecondition() + * @generated + */ + int EVENT_PRECONDITION = 9; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl State Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStateProperty() + * @generated + */ + int STATE_PROPERTY = 11; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl Binary Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBinaryProperty() + * @generated + */ + int BINARY_PROPERTY = 13; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl Many Reference Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyReferenceProperty() + * @generated + */ + int MANY_REFERENCE_PROPERTY = 14; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl Single Reference Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getSingleReferenceProperty() + * @generated + */ + int SINGLE_REFERENCE_PROPERTY = 15; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl Container Reference Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getContainerReferenceProperty() + * @generated + */ + int CONTAINER_REFERENCE_PROPERTY = 16; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl Many Boolean Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyBooleanAttributeProperty() + * @generated + */ + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY = 17; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl Many Integer Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyIntegerAttributeProperty() + * @generated + */ + int MANY_INTEGER_ATTRIBUTE_PROPERTY = 18; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl Many String Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyStringAttributeProperty() + * @generated + */ + int MANY_STRING_ATTRIBUTE_PROPERTY = 19; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl Boolean Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanAttributeProperty() + * @generated + */ + int BOOLEAN_ATTRIBUTE_PROPERTY = 20; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl Integer Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getIntegerAttributeProperty() + * @generated + */ + int INTEGER_ATTRIBUTE_PROPERTY = 21; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl String Attribute Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStringAttributeProperty() + * @generated + */ + int STRING_ATTRIBUTE_PROPERTY = 22; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl Step Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepProperty() + * @generated + */ + int STEP_PROPERTY = 10; + + /** + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.PropertyReferenceImpl Reference}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyReferenceImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getPropertyReference() + * @generated + */ + int PROPERTY_REFERENCE = 7; + + /** + * The feature id for the 'Referenced Property' reference. * * * @generated * @ordered */ - int COMPOSITE_PROPERTY__PROPERTIES = PROPERTY_FEATURE_COUNT + 0; + int PROPERTY_REFERENCE__REFERENCED_PROPERTY = PROPERTY_FEATURE_COUNT + 0; /** - * The number of structural features of the 'Composite Property' class. + * The number of structural features of the 'Reference' class. * * * @generated * @ordered */ - int COMPOSITE_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; + int PROPERTY_REFERENCE_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; /** - * The number of operations of the 'Composite Property' class. + * The number of operations of the 'Reference' class. * * * @generated * @ordered */ - int COMPOSITE_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 0; + int PROPERTY_REFERENCE_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 0; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.EventPreconditionImpl Event Precondition}' class. + * The feature id for the 'Properties' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPOSITE_PROPERTY__PROPERTIES = PROPERTY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Composite Property' class. * * - * @see fr.inria.diverse.event.commons.model.property.impl.EventPreconditionImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getEventPrecondition() * @generated + * @ordered */ - int EVENT_PRECONDITION = 2; + int COMPOSITE_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Composite Property' class. + * + * + * @generated + * @ordered + */ + int COMPOSITE_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 0; /** * The feature id for the 'Event' reference. @@ -161,14 +540,49 @@ public interface PropertyPackage extends EPackage { int EVENT_PRECONDITION_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 0; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl State Property}' class. + * The feature id for the 'Stepping' attribute. + * + * + * @generated + * @ordered + */ + int STEP_PROPERTY__STEPPING = PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Target Provider' containment reference. + * + * + * @generated + * @ordered + */ + int STEP_PROPERTY__TARGET_PROVIDER = PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Step Property' class. * * - * @see fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStateProperty() * @generated + * @ordered */ - int STATE_PROPERTY = 3; + int STEP_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 2; + + /** + * The operation id for the 'Get Operation' operation. + * + * + * @generated + * @ordered + */ + int STEP_PROPERTY___GET_OPERATION = PROPERTY_OPERATION_COUNT + 0; + + /** + * The number of operations of the 'Step Property' class. + * + * + * @generated + * @ordered + */ + int STEP_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 1; /** * The feature id for the 'Target' reference. @@ -207,14 +621,68 @@ public interface PropertyPackage extends EPackage { int STATE_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 1; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl Binary Property}' class. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.UnaryPropertyImpl Unary Property}' class. * * - * @see fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBinaryProperty() + * @see fr.inria.diverse.event.commons.model.property.impl.UnaryPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getUnaryProperty() * @generated */ - int BINARY_PROPERTY = 4; + int UNARY_PROPERTY = 12; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int UNARY_PROPERTY__TARGET = STATE_PROPERTY__TARGET; + + /** + * The feature id for the 'Operator' attribute. + * + * + * @generated + * @ordered + */ + int UNARY_PROPERTY__OPERATOR = STATE_PROPERTY_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Property' containment reference. + * + * + * @generated + * @ordered + */ + int UNARY_PROPERTY__PROPERTY = STATE_PROPERTY_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Unary Property' class. + * + * + * @generated + * @ordered + */ + int UNARY_PROPERTY_FEATURE_COUNT = STATE_PROPERTY_FEATURE_COUNT + 2; + + /** + * The operation id for the 'Get Feature' operation. + * + * + * @generated + * @ordered + */ + int UNARY_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; + + /** + * The number of operations of the 'Unary Property' class. + * + * + * @generated + * @ordered + */ + int UNARY_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The feature id for the 'Target' reference. @@ -279,16 +747,6 @@ public interface PropertyPackage extends EPackage { */ int BINARY_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl Many Reference Property}' class. - * - * - * @see fr.inria.diverse.event.commons.model.property.impl.ManyReferencePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyReferenceProperty() - * @generated - */ - int MANY_REFERENCE_PROPERTY = 5; - /** * The feature id for the 'Target' reference. * @@ -343,16 +801,6 @@ public interface PropertyPackage extends EPackage { */ int MANY_REFERENCE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl Single Reference Property}' class. - * - * - * @see fr.inria.diverse.event.commons.model.property.impl.SingleReferencePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getSingleReferenceProperty() - * @generated - */ - int SINGLE_REFERENCE_PROPERTY = 6; - /** * The feature id for the 'Target' reference. * @@ -398,16 +846,6 @@ public interface PropertyPackage extends EPackage { */ int SINGLE_REFERENCE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl Container Reference Property}' class. - * - * - * @see fr.inria.diverse.event.commons.model.property.impl.ContainerReferencePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getContainerReferenceProperty() - * @generated - */ - int CONTAINER_REFERENCE_PROPERTY = 7; - /** * The feature id for the 'Target' reference. * @@ -453,16 +891,6 @@ public interface PropertyPackage extends EPackage { */ int CONTAINER_REFERENCE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl Many Boolean Attribute Property}' class. - * - * - * @see fr.inria.diverse.event.commons.model.property.impl.ManyBooleanAttributePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyBooleanAttributeProperty() - * @generated - */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY = 8; - /** * The feature id for the 'Target' reference. * @@ -518,23 +946,13 @@ public interface PropertyPackage extends EPackage { int MANY_BOOLEAN_ATTRIBUTE_PROPERTY___GET_FEATURE = STATE_PROPERTY___GET_FEATURE; /** - * The number of operations of the 'Many Boolean Attribute Property' class. - * - * - * @generated - * @ordered - */ - int MANY_BOOLEAN_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; - - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl Many Integer Attribute Property}' class. + * The number of operations of the 'Many Boolean Attribute Property' class. * * - * @see fr.inria.diverse.event.commons.model.property.impl.ManyIntegerAttributePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyIntegerAttributeProperty() * @generated + * @ordered */ - int MANY_INTEGER_ATTRIBUTE_PROPERTY = 9; + int MANY_BOOLEAN_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** * The feature id for the 'Target' reference. @@ -599,16 +1017,6 @@ public interface PropertyPackage extends EPackage { */ int MANY_INTEGER_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl Many String Attribute Property}' class. - * - * - * @see fr.inria.diverse.event.commons.model.property.impl.ManyStringAttributePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getManyStringAttributeProperty() - * @generated - */ - int MANY_STRING_ATTRIBUTE_PROPERTY = 10; - /** * The feature id for the 'Target' reference. * @@ -672,16 +1080,6 @@ public interface PropertyPackage extends EPackage { */ int MANY_STRING_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl Boolean Attribute Property}' class. - * - * - * @see fr.inria.diverse.event.commons.model.property.impl.BooleanAttributePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanAttributeProperty() - * @generated - */ - int BOOLEAN_ATTRIBUTE_PROPERTY = 11; - /** * The feature id for the 'Target' reference. * @@ -736,16 +1134,6 @@ public interface PropertyPackage extends EPackage { */ int BOOLEAN_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl Integer Attribute Property}' class. - * - * - * @see fr.inria.diverse.event.commons.model.property.impl.IntegerAttributePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getIntegerAttributeProperty() - * @generated - */ - int INTEGER_ATTRIBUTE_PROPERTY = 12; - /** * The feature id for the 'Target' reference. * @@ -800,16 +1188,6 @@ public interface PropertyPackage extends EPackage { */ int INTEGER_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; - /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl String Attribute Property}' class. - * - * - * @see fr.inria.diverse.event.commons.model.property.impl.StringAttributePropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStringAttributeProperty() - * @generated - */ - int STRING_ATTRIBUTE_PROPERTY = 13; - /** * The feature id for the 'Target' reference. * @@ -865,138 +1243,182 @@ public interface PropertyPackage extends EPackage { int STRING_ATTRIBUTE_PROPERTY_OPERATION_COUNT = STATE_PROPERTY_OPERATION_COUNT + 0; /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl Step Property}' class. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.UnaryOperator Unary Operator}' enum. * * - * @see fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepProperty() + * @see fr.inria.diverse.event.commons.model.property.UnaryOperator + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getUnaryOperator() * @generated */ - int STEP_PROPERTY = 14; + int UNARY_OPERATOR = 23; /** - * The feature id for the 'Stepping' attribute. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.ComparisonOperator Comparison Operator}' enum. * * + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getComparisonOperator() * @generated - * @ordered */ - int STEP_PROPERTY__STEPPING = PROPERTY_FEATURE_COUNT + 0; + int COMPARISON_OPERATOR = 24; /** - * The feature id for the 'Target Provider' containment reference. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}' enum. * * + * @see fr.inria.diverse.event.commons.model.property.BooleanOperator + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanOperator() * @generated - * @ordered */ - int STEP_PROPERTY__TARGET_PROVIDER = PROPERTY_FEATURE_COUNT + 1; + int BOOLEAN_OPERATOR = 25; /** - * The number of structural features of the 'Step Property' class. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Quantifier Quantifier}' enum. * * + * @see fr.inria.diverse.event.commons.model.property.Quantifier + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getQuantifier() * @generated - * @ordered */ - int STEP_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 2; + int QUANTIFIER = 26; + /** - * The operation id for the 'Get Operation' operation. + * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Stepping Stepping}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.Stepping + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepping() + * @generated + */ + int STEPPING = 27; + + + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.AbstractProperty Abstract Property}'. * * + * @return the meta object for class 'Abstract Property'. + * @see fr.inria.diverse.event.commons.model.property.AbstractProperty * @generated - * @ordered */ - int STEP_PROPERTY___GET_OPERATION = PROPERTY_OPERATION_COUNT + 0; + EClass getAbstractProperty(); /** - * The number of operations of the 'Step Property' class. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.TemporalProperty Temporal Property}'. * * + * @return the meta object for class 'Temporal Property'. + * @see fr.inria.diverse.event.commons.model.property.TemporalProperty * @generated - * @ordered */ - int STEP_PROPERTY_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 1; + EClass getTemporalProperty(); /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.impl.PropertyReferenceImpl Reference}' class. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.NextProperty Next Property}'. * * - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyReferenceImpl - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getPropertyReference() + * @return the meta object for class 'Next Property'. + * @see fr.inria.diverse.event.commons.model.property.NextProperty * @generated */ - int PROPERTY_REFERENCE = 15; + EClass getNextProperty(); /** - * The feature id for the 'Referenced Property' reference. + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.NextProperty#getFormula Formula}'. * * + * @return the meta object for the containment reference 'Formula'. + * @see fr.inria.diverse.event.commons.model.property.NextProperty#getFormula() + * @see #getNextProperty() * @generated - * @ordered */ - int PROPERTY_REFERENCE__REFERENCED_PROPERTY = PROPERTY_FEATURE_COUNT + 0; + EReference getNextProperty_Formula(); /** - * The number of structural features of the 'Reference' class. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.UntilProperty Until Property}'. * * + * @return the meta object for class 'Until Property'. + * @see fr.inria.diverse.event.commons.model.property.UntilProperty * @generated - * @ordered */ - int PROPERTY_REFERENCE_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; + EClass getUntilProperty(); /** - * The number of operations of the 'Reference' class. + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.UntilProperty#getLeftFormula Left Formula}'. * * + * @return the meta object for the containment reference 'Left Formula'. + * @see fr.inria.diverse.event.commons.model.property.UntilProperty#getLeftFormula() + * @see #getUntilProperty() * @generated - * @ordered */ - int PROPERTY_REFERENCE_OPERATION_COUNT = PROPERTY_OPERATION_COUNT + 0; + EReference getUntilProperty_LeftFormula(); /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.UntilProperty#getRightFormula Right Formula}'. * * - * @see fr.inria.diverse.event.commons.model.property.Operator - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getOperator() + * @return the meta object for the containment reference 'Right Formula'. + * @see fr.inria.diverse.event.commons.model.property.UntilProperty#getRightFormula() + * @see #getUntilProperty() * @generated */ - int OPERATOR = 16; + EReference getUntilProperty_RightFormula(); /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}' enum. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.ReleaseProperty Release Property}'. * * - * @see fr.inria.diverse.event.commons.model.property.BooleanOperator - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getBooleanOperator() + * @return the meta object for class 'Release Property'. + * @see fr.inria.diverse.event.commons.model.property.ReleaseProperty * @generated */ - int BOOLEAN_OPERATOR = 17; + EClass getReleaseProperty(); /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Quantifier Quantifier}' enum. + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.ReleaseProperty#getLeftFormula Left Formula}'. * * - * @see fr.inria.diverse.event.commons.model.property.Quantifier - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getQuantifier() + * @return the meta object for the containment reference 'Left Formula'. + * @see fr.inria.diverse.event.commons.model.property.ReleaseProperty#getLeftFormula() + * @see #getReleaseProperty() * @generated */ - int QUANTIFIER = 18; + EReference getReleaseProperty_LeftFormula(); + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.ReleaseProperty#getRightFormula Right Formula}'. + * + * + * @return the meta object for the containment reference 'Right Formula'. + * @see fr.inria.diverse.event.commons.model.property.ReleaseProperty#getRightFormula() + * @see #getReleaseProperty() + * @generated + */ + EReference getReleaseProperty_RightFormula(); /** - * The meta object id for the '{@link fr.inria.diverse.event.commons.model.property.Stepping Stepping}' enum. + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.NegationTemporalProperty Negation Temporal Property}'. * * - * @see fr.inria.diverse.event.commons.model.property.Stepping - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getStepping() + * @return the meta object for class 'Negation Temporal Property'. + * @see fr.inria.diverse.event.commons.model.property.NegationTemporalProperty * @generated */ - int STEPPING = 19; + EClass getNegationTemporalProperty(); + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.NegationTemporalProperty#getFormula Formula}'. + * + * + * @return the meta object for the containment reference 'Formula'. + * @see fr.inria.diverse.event.commons.model.property.NegationTemporalProperty#getFormula() + * @see #getNegationTemporalProperty() + * @generated + */ + EReference getNegationTemporalProperty_Formula(); /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.StateProperty State Property}'. @@ -1029,6 +1451,38 @@ public interface PropertyPackage extends EPackage { */ EOperation getStateProperty__GetFeature(); + /** + * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.UnaryProperty Unary Property}'. + * + * + * @return the meta object for class 'Unary Property'. + * @see fr.inria.diverse.event.commons.model.property.UnaryProperty + * @generated + */ + EClass getUnaryProperty(); + + /** + * Returns the meta object for the attribute '{@link fr.inria.diverse.event.commons.model.property.UnaryProperty#getOperator Operator}'. + * + * + * @return the meta object for the attribute 'Operator'. + * @see fr.inria.diverse.event.commons.model.property.UnaryProperty#getOperator() + * @see #getUnaryProperty() + * @generated + */ + EAttribute getUnaryProperty_Operator(); + + /** + * Returns the meta object for the containment reference '{@link fr.inria.diverse.event.commons.model.property.UnaryProperty#getProperty Property}'. + * + * + * @return the meta object for the containment reference 'Property'. + * @see fr.inria.diverse.event.commons.model.property.UnaryProperty#getProperty() + * @see #getUnaryProperty() + * @generated + */ + EReference getUnaryProperty_Property(); + /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty Binary Property}'. * @@ -1371,6 +1825,26 @@ public interface PropertyPackage extends EPackage { */ EAttribute getStringAttributeProperty_Operator(); + /** + * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.UnaryOperator Unary Operator}'. + * + * + * @return the meta object for enum 'Unary Operator'. + * @see fr.inria.diverse.event.commons.model.property.UnaryOperator + * @generated + */ + EEnum getUnaryOperator(); + + /** + * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.ComparisonOperator Comparison Operator}'. + * + * + * @return the meta object for enum 'Comparison Operator'. + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator + * @generated + */ + EEnum getComparisonOperator(); + /** * Returns the meta object for class '{@link fr.inria.diverse.event.commons.model.property.StepProperty Step Property}'. * @@ -1486,16 +1960,6 @@ public interface PropertyPackage extends EPackage { */ EReference getEventPrecondition_Event(); - /** - * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}'. - * - * - * @return the meta object for enum 'Operator'. - * @see fr.inria.diverse.event.commons.model.property.Operator - * @generated - */ - EEnum getOperator(); - /** * Returns the meta object for enum '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}'. * @@ -1549,6 +2013,114 @@ public interface PropertyPackage extends EPackage { * @generated */ interface Literals { + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.AbstractPropertyImpl Abstract Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.AbstractPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getAbstractProperty() + * @generated + */ + EClass ABSTRACT_PROPERTY = eINSTANCE.getAbstractProperty(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.TemporalPropertyImpl Temporal Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.TemporalPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getTemporalProperty() + * @generated + */ + EClass TEMPORAL_PROPERTY = eINSTANCE.getTemporalProperty(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.NextPropertyImpl Next Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.NextPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getNextProperty() + * @generated + */ + EClass NEXT_PROPERTY = eINSTANCE.getNextProperty(); + + /** + * The meta object literal for the 'Formula' containment reference feature. + * + * + * @generated + */ + EReference NEXT_PROPERTY__FORMULA = eINSTANCE.getNextProperty_Formula(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.UntilPropertyImpl Until Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.UntilPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getUntilProperty() + * @generated + */ + EClass UNTIL_PROPERTY = eINSTANCE.getUntilProperty(); + + /** + * The meta object literal for the 'Left Formula' containment reference feature. + * + * + * @generated + */ + EReference UNTIL_PROPERTY__LEFT_FORMULA = eINSTANCE.getUntilProperty_LeftFormula(); + + /** + * The meta object literal for the 'Right Formula' containment reference feature. + * + * + * @generated + */ + EReference UNTIL_PROPERTY__RIGHT_FORMULA = eINSTANCE.getUntilProperty_RightFormula(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.ReleasePropertyImpl Release Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.ReleasePropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getReleaseProperty() + * @generated + */ + EClass RELEASE_PROPERTY = eINSTANCE.getReleaseProperty(); + + /** + * The meta object literal for the 'Left Formula' containment reference feature. + * + * + * @generated + */ + EReference RELEASE_PROPERTY__LEFT_FORMULA = eINSTANCE.getReleaseProperty_LeftFormula(); + + /** + * The meta object literal for the 'Right Formula' containment reference feature. + * + * + * @generated + */ + EReference RELEASE_PROPERTY__RIGHT_FORMULA = eINSTANCE.getReleaseProperty_RightFormula(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.NegationTemporalPropertyImpl Negation Temporal Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.NegationTemporalPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getNegationTemporalProperty() + * @generated + */ + EClass NEGATION_TEMPORAL_PROPERTY = eINSTANCE.getNegationTemporalProperty(); + + /** + * The meta object literal for the 'Formula' containment reference feature. + * + * + * @generated + */ + EReference NEGATION_TEMPORAL_PROPERTY__FORMULA = eINSTANCE.getNegationTemporalProperty_Formula(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.StatePropertyImpl State Property}' class. * @@ -1575,6 +2147,32 @@ interface Literals { */ EOperation STATE_PROPERTY___GET_FEATURE = eINSTANCE.getStateProperty__GetFeature(); + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.UnaryPropertyImpl Unary Property}' class. + * + * + * @see fr.inria.diverse.event.commons.model.property.impl.UnaryPropertyImpl + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getUnaryProperty() + * @generated + */ + EClass UNARY_PROPERTY = eINSTANCE.getUnaryProperty(); + + /** + * The meta object literal for the 'Operator' attribute feature. + * + * + * @generated + */ + EAttribute UNARY_PROPERTY__OPERATOR = eINSTANCE.getUnaryProperty_Operator(); + + /** + * The meta object literal for the 'Property' containment reference feature. + * + * + * @generated + */ + EReference UNARY_PROPERTY__PROPERTY = eINSTANCE.getUnaryProperty_Property(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.BinaryPropertyImpl Binary Property}' class. * @@ -1851,6 +2449,26 @@ interface Literals { */ EAttribute STRING_ATTRIBUTE_PROPERTY__OPERATOR = eINSTANCE.getStringAttributeProperty_Operator(); + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.UnaryOperator Unary Operator}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.UnaryOperator + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getUnaryOperator() + * @generated + */ + EEnum UNARY_OPERATOR = eINSTANCE.getUnaryOperator(); + + /** + * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.ComparisonOperator Comparison Operator}' enum. + * + * + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator + * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getComparisonOperator() + * @generated + */ + EEnum COMPARISON_OPERATOR = eINSTANCE.getComparisonOperator(); + /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.impl.StepPropertyImpl Step Property}' class. * @@ -1949,16 +2567,6 @@ interface Literals { */ EReference EVENT_PRECONDITION__EVENT = eINSTANCE.getEventPrecondition_Event(); - /** - * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.Operator Operator}' enum. - * - * - * @see fr.inria.diverse.event.commons.model.property.Operator - * @see fr.inria.diverse.event.commons.model.property.impl.PropertyPackageImpl#getOperator() - * @generated - */ - EEnum OPERATOR = eINSTANCE.getOperator(); - /** * The meta object literal for the '{@link fr.inria.diverse.event.commons.model.property.BooleanOperator Boolean Operator}' enum. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyReference.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyReference.java index 82d3daa4a..48d50f499 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyReference.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/PropertyReference.java @@ -19,7 +19,7 @@ * @model * @generated */ -public interface PropertyReference extends Property { +public interface PropertyReference

    extends Property { /** * Returns the value of the 'Referenced Property' reference. * @@ -34,7 +34,7 @@ public interface PropertyReference extends Property { * @model * @generated */ - Property getReferencedProperty(); + P getReferencedProperty(); /** * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.PropertyReference#getReferencedProperty Referenced Property}' reference. @@ -44,6 +44,6 @@ public interface PropertyReference extends Property { * @see #getReferencedProperty() * @generated */ - void setReferencedProperty(Property value); + void setReferencedProperty(P value); } // PropertyReference diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ReleaseProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ReleaseProperty.java new file mode 100644 index 000000000..8c5089c47 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/ReleaseProperty.java @@ -0,0 +1,76 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Release Property'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.ReleaseProperty#getLeftFormula Left Formula}
    • + *
    • {@link fr.inria.diverse.event.commons.model.property.ReleaseProperty#getRightFormula Right Formula}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getReleaseProperty() + * @model abstract="true" + * @generated + */ +public interface ReleaseProperty

    extends TemporalProperty { + /** + * Returns the value of the 'Left Formula' containment reference. + * + *

    + * If the meaning of the 'Left Formula' containment reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Left Formula' containment reference. + * @see #setLeftFormula(AbstractProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getReleaseProperty_LeftFormula() + * @model containment="true" + * @generated + */ + P getLeftFormula(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ReleaseProperty#getLeftFormula Left Formula}' containment reference. + * + * + * @param value the new value of the 'Left Formula' containment reference. + * @see #getLeftFormula() + * @generated + */ + void setLeftFormula(P value); + + /** + * Returns the value of the 'Right Formula' containment reference. + * + *

    + * If the meaning of the 'Right Formula' containment reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Right Formula' containment reference. + * @see #setRightFormula(AbstractProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getReleaseProperty_RightFormula() + * @model containment="true" + * @generated + */ + P getRightFormula(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.ReleaseProperty#getRightFormula Right Formula}' containment reference. + * + * + * @param value the new value of the 'Right Formula' containment reference. + * @see #getRightFormula() + * @generated + */ + void setRightFormula(P value); + +} // ReleaseProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java index 83e04e95e..63df4d6bd 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/StringAttributeProperty.java @@ -49,7 +49,7 @@ public interface StringAttributeProperty extends StateProperty { /** * Returns the value of the 'Operator' attribute. - * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.Operator}. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.ComparisonOperator}. * *

    * If the meaning of the 'Operator' attribute isn't clear, @@ -57,23 +57,23 @@ public interface StringAttributeProperty extends StateProperty { *

    * * @return the value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator - * @see #setOperator(Operator) + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator + * @see #setOperator(ComparisonOperator) * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getStringAttributeProperty_Operator() * @model * @generated */ - Operator getOperator(); + ComparisonOperator getOperator(); /** * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.StringAttributeProperty#getOperator Operator}' attribute. * * * @param value the new value of the 'Operator' attribute. - * @see fr.inria.diverse.event.commons.model.property.Operator + * @see fr.inria.diverse.event.commons.model.property.ComparisonOperator * @see #getOperator() * @generated */ - void setOperator(Operator value); + void setOperator(ComparisonOperator value); } // StringAttributeProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/TemporalProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/TemporalProperty.java new file mode 100644 index 000000000..1c6ae78e6 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/TemporalProperty.java @@ -0,0 +1,16 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +/** + * + * A representation of the model object 'Temporal Property'. + * + * + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getTemporalProperty() + * @model abstract="true" + * @generated + */ +public interface TemporalProperty extends AbstractProperty { +} // TemporalProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UnaryOperator.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UnaryOperator.java new file mode 100644 index 000000000..d87e012b8 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UnaryOperator.java @@ -0,0 +1,187 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + +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 'Unary Operator', + * and utility methods for working with them. + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getUnaryOperator() + * @model + * @generated + */ +public enum UnaryOperator implements Enumerator { + /** + * The 'NOT' literal object. + * + * + * @see #NOT_VALUE + * @generated + * @ordered + */ + NOT(0, "NOT", "NOT"); + + /** + * The 'NOT' literal value. + * + *

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

    + * + * @see #NOT + * @model + * @generated + * @ordered + */ + public static final int NOT_VALUE = 0; + + /** + * An array of all the 'Unary Operator' enumerators. + * + * + * @generated + */ + private static final UnaryOperator[] VALUES_ARRAY = + new UnaryOperator[] { + NOT, + }; + + /** + * A public read-only list of all the 'Unary Operator' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Unary Operator' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static UnaryOperator get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + UnaryOperator result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Unary Operator' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static UnaryOperator getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + UnaryOperator result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Unary Operator' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static UnaryOperator get(int value) { + switch (value) { + case NOT_VALUE: return NOT; + } + 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 UnaryOperator(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //UnaryOperator diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UnaryProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UnaryProperty.java new file mode 100644 index 000000000..2d07d062b --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UnaryProperty.java @@ -0,0 +1,79 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Unary Property'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.UnaryProperty#getOperator Operator}
    • + *
    • {@link fr.inria.diverse.event.commons.model.property.UnaryProperty#getProperty Property}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getUnaryProperty() + * @model abstract="true" + * @generated + */ +public interface UnaryProperty

    , T> extends StateProperty { + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link fr.inria.diverse.event.commons.model.property.UnaryOperator}. + * + *

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

    + * + * @return the value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.UnaryOperator + * @see #setOperator(UnaryOperator) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getUnaryProperty_Operator() + * @model required="true" + * @generated + */ + UnaryOperator getOperator(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.UnaryProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see fr.inria.diverse.event.commons.model.property.UnaryOperator + * @see #getOperator() + * @generated + */ + void setOperator(UnaryOperator value); + + /** + * Returns the value of the 'Property' containment reference. + * + *

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

    + * + * @return the value of the 'Property' containment reference. + * @see #setProperty(StateProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getUnaryProperty_Property() + * @model containment="true" required="true" + * @generated + */ + P getProperty(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.UnaryProperty#getProperty Property}' containment reference. + * + * + * @param value the new value of the 'Property' containment reference. + * @see #getProperty() + * @generated + */ + void setProperty(P value); + +} // UnaryProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UntilProperty.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UntilProperty.java new file mode 100644 index 000000000..e8d7655f8 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/UntilProperty.java @@ -0,0 +1,76 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property; + + +/** + * + * A representation of the model object 'Until Property'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.UntilProperty#getLeftFormula Left Formula}
    • + *
    • {@link fr.inria.diverse.event.commons.model.property.UntilProperty#getRightFormula Right Formula}
    • + *
    + * + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getUntilProperty() + * @model abstract="true" + * @generated + */ +public interface UntilProperty

    extends TemporalProperty { + /** + * Returns the value of the 'Left Formula' containment reference. + * + *

    + * If the meaning of the 'Left Formula' containment reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Left Formula' containment reference. + * @see #setLeftFormula(AbstractProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getUntilProperty_LeftFormula() + * @model containment="true" + * @generated + */ + P getLeftFormula(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.UntilProperty#getLeftFormula Left Formula}' containment reference. + * + * + * @param value the new value of the 'Left Formula' containment reference. + * @see #getLeftFormula() + * @generated + */ + void setLeftFormula(P value); + + /** + * Returns the value of the 'Right Formula' containment reference. + * + *

    + * If the meaning of the 'Right Formula' containment reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Right Formula' containment reference. + * @see #setRightFormula(AbstractProperty) + * @see fr.inria.diverse.event.commons.model.property.PropertyPackage#getUntilProperty_RightFormula() + * @model containment="true" + * @generated + */ + P getRightFormula(); + + /** + * Sets the value of the '{@link fr.inria.diverse.event.commons.model.property.UntilProperty#getRightFormula Right Formula}' containment reference. + * + * + * @param value the new value of the 'Right Formula' containment reference. + * @see #getRightFormula() + * @generated + */ + void setRightFormula(P value); + +} // UntilProperty diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/AbstractPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/AbstractPropertyImpl.java new file mode 100644 index 000000000..07a581ef4 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/AbstractPropertyImpl.java @@ -0,0 +1,39 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.AbstractProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Abstract Property'. + * + * + * @generated + */ +public class AbstractPropertyImpl extends MinimalEObjectImpl.Container implements AbstractProperty { + /** + * + * + * @generated + */ + protected AbstractPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.ABSTRACT_PROPERTY; + } + +} //AbstractPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java index 70a4fc829..53ac6c2c4 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/BooleanAttributePropertyImpl.java @@ -3,7 +3,7 @@ package fr.inria.diverse.event.commons.model.property.impl; import fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty; -import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.ComparisonOperator; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import org.eclipse.emf.common.notify.Notification; @@ -55,7 +55,7 @@ public abstract class BooleanAttributePropertyImpl extends StatePropertyImpl< * @generated * @ordered */ - protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + protected static final ComparisonOperator OPERATOR_EDEFAULT = ComparisonOperator.EQUAL; /** * The cached value of the '{@link #getOperator() Operator}' attribute. @@ -65,7 +65,7 @@ public abstract class BooleanAttributePropertyImpl extends StatePropertyImpl< * @generated * @ordered */ - protected Operator operator = OPERATOR_EDEFAULT; + protected ComparisonOperator operator = OPERATOR_EDEFAULT; /** * @@ -123,7 +123,7 @@ public void setValue(boolean newValue) { * * @generated */ - public Operator getOperator() { + public ComparisonOperator getOperator() { return operator; } @@ -132,8 +132,8 @@ public Operator getOperator() { * * @generated */ - public void setOperator(Operator newOperator) { - Operator oldOperator = operator; + public void setOperator(ComparisonOperator newOperator) { + ComparisonOperator oldOperator = operator; operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); @@ -167,7 +167,7 @@ public void eSet(int featureID, Object newValue) { setValue((Boolean)newValue); return; case PropertyPackage.BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: - setOperator((Operator)newValue); + setOperator((ComparisonOperator)newValue); return; } super.eSet(featureID, newValue); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/CompositePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/CompositePropertyImpl.java index a13c2a11f..6df498873 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/CompositePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/CompositePropertyImpl.java @@ -31,7 +31,7 @@ * * @generated */ -public class CompositePropertyImpl extends PropertyImpl implements CompositeProperty { +public class CompositePropertyImpl

    extends PropertyImpl implements CompositeProperty

    { /** * The cached value of the '{@link #getProperties() Properties}' containment reference list. * @@ -40,7 +40,7 @@ public class CompositePropertyImpl extends PropertyImpl implements CompositeProp * @generated * @ordered */ - protected EList properties; + protected EList

    properties; /** * @@ -66,9 +66,9 @@ protected EClass eStaticClass() { * * @generated */ - public EList getProperties() { + public EList

    getProperties() { if (properties == null) { - properties = new EObjectContainmentEList(Property.class, this, PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES); + properties = new EObjectContainmentEList

    (Property.class, this, PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES); } return properties; } @@ -112,7 +112,7 @@ public void eSet(int featureID, Object newValue) { switch (featureID) { case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: getProperties().clear(); - getProperties().addAll((Collection)newValue); + getProperties().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/EventPreconditionImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/EventPreconditionImpl.java index 1dbc469d9..9ae143fd5 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/EventPreconditionImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/EventPreconditionImpl.java @@ -26,7 +26,7 @@ * * @generated */ -public class EventPreconditionImpl extends PropertyImpl implements EventPrecondition { +public class EventPreconditionImpl> extends PropertyImpl implements EventPrecondition { /** * The cached value of the '{@link #getEvent() Event}' reference. * @@ -35,7 +35,7 @@ public class EventPreconditionImpl extends PropertyImpl implements EventPrecondi * @generated * @ordered */ - protected Event event; + protected E event; /** * @@ -61,10 +61,11 @@ protected EClass eStaticClass() { * * @generated */ - public Event getEvent() { + @SuppressWarnings("unchecked") + public E getEvent() { if (event != null && event.eIsProxy()) { InternalEObject oldEvent = (InternalEObject)event; - event = (Event)eResolveProxy(oldEvent); + event = (E)eResolveProxy(oldEvent); if (event != oldEvent) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertyPackage.EVENT_PRECONDITION__EVENT, oldEvent, event)); @@ -78,7 +79,7 @@ public Event getEvent() { * * @generated */ - public Event basicGetEvent() { + public E basicGetEvent() { return event; } @@ -87,8 +88,8 @@ public Event basicGetEvent() { * * @generated */ - public void setEvent(Event newEvent) { - Event oldEvent = event; + public void setEvent(E newEvent) { + E oldEvent = event; event = newEvent; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.EVENT_PRECONDITION__EVENT, oldEvent, event)); @@ -114,11 +115,12 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { * * @generated */ + @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case PropertyPackage.EVENT_PRECONDITION__EVENT: - setEvent((Event)newValue); + setEvent((E)newValue); return; } super.eSet(featureID, newValue); @@ -133,7 +135,7 @@ public void eSet(int featureID, Object newValue) { public void eUnset(int featureID) { switch (featureID) { case PropertyPackage.EVENT_PRECONDITION__EVENT: - setEvent((Event)null); + setEvent((E)null); return; } super.eUnset(featureID); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java index 2b572243b..de72aa041 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/IntegerAttributePropertyImpl.java @@ -2,8 +2,8 @@ */ package fr.inria.diverse.event.commons.model.property.impl; +import fr.inria.diverse.event.commons.model.property.ComparisonOperator; import fr.inria.diverse.event.commons.model.property.IntegerAttributeProperty; -import fr.inria.diverse.event.commons.model.property.Operator; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import org.eclipse.emf.common.notify.Notification; @@ -55,7 +55,7 @@ public abstract class IntegerAttributePropertyImpl extends StatePropertyImpl< * @generated * @ordered */ - protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + protected static final ComparisonOperator OPERATOR_EDEFAULT = ComparisonOperator.EQUAL; /** * The cached value of the '{@link #getOperator() Operator}' attribute. @@ -65,7 +65,7 @@ public abstract class IntegerAttributePropertyImpl extends StatePropertyImpl< * @generated * @ordered */ - protected Operator operator = OPERATOR_EDEFAULT; + protected ComparisonOperator operator = OPERATOR_EDEFAULT; /** * @@ -123,7 +123,7 @@ public void setValue(int newValue) { * * @generated */ - public Operator getOperator() { + public ComparisonOperator getOperator() { return operator; } @@ -132,8 +132,8 @@ public Operator getOperator() { * * @generated */ - public void setOperator(Operator newOperator) { - Operator oldOperator = operator; + public void setOperator(ComparisonOperator newOperator) { + ComparisonOperator oldOperator = operator; operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); @@ -167,7 +167,7 @@ public void eSet(int featureID, Object newValue) { setValue((Integer)newValue); return; case PropertyPackage.INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: - setOperator((Operator)newValue); + setOperator((ComparisonOperator)newValue); return; } super.eSet(featureID, newValue); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java index 521d7661a..2bc0eda9d 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyBooleanAttributePropertyImpl.java @@ -2,8 +2,8 @@ */ package fr.inria.diverse.event.commons.model.property.impl; +import fr.inria.diverse.event.commons.model.property.ComparisonOperator; import fr.inria.diverse.event.commons.model.property.ManyBooleanAttributeProperty; -import fr.inria.diverse.event.commons.model.property.Operator; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.Quantifier; @@ -77,7 +77,7 @@ public class ManyBooleanAttributePropertyImpl extends StatePropertyImpl im * @generated * @ordered */ - protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + protected static final ComparisonOperator OPERATOR_EDEFAULT = ComparisonOperator.EQUAL; /** * The cached value of the '{@link #getOperator() Operator}' attribute. @@ -87,7 +87,7 @@ public class ManyBooleanAttributePropertyImpl extends StatePropertyImpl im * @generated * @ordered */ - protected Operator operator = OPERATOR_EDEFAULT; + protected ComparisonOperator operator = OPERATOR_EDEFAULT; /** * @@ -166,7 +166,7 @@ public void setValue(boolean newValue) { * * @generated */ - public Operator getOperator() { + public ComparisonOperator getOperator() { return operator; } @@ -175,8 +175,8 @@ public Operator getOperator() { * * @generated */ - public void setOperator(Operator newOperator) { - Operator oldOperator = operator; + public void setOperator(ComparisonOperator newOperator) { + ComparisonOperator oldOperator = operator; operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); @@ -215,7 +215,7 @@ public void eSet(int featureID, Object newValue) { setValue((Boolean)newValue); return; case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY__OPERATOR: - setOperator((Operator)newValue); + setOperator((ComparisonOperator)newValue); return; } super.eSet(featureID, newValue); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java index aba92556b..419ba99f8 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyIntegerAttributePropertyImpl.java @@ -2,8 +2,8 @@ */ package fr.inria.diverse.event.commons.model.property.impl; +import fr.inria.diverse.event.commons.model.property.ComparisonOperator; import fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty; -import fr.inria.diverse.event.commons.model.property.Operator; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.Quantifier; @@ -77,7 +77,7 @@ public class ManyIntegerAttributePropertyImpl extends StatePropertyImpl im * @generated * @ordered */ - protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + protected static final ComparisonOperator OPERATOR_EDEFAULT = ComparisonOperator.EQUAL; /** * The cached value of the '{@link #getOperator() Operator}' attribute. @@ -87,7 +87,7 @@ public class ManyIntegerAttributePropertyImpl extends StatePropertyImpl im * @generated * @ordered */ - protected Operator operator = OPERATOR_EDEFAULT; + protected ComparisonOperator operator = OPERATOR_EDEFAULT; /** * @@ -166,7 +166,7 @@ public void setValue(int newValue) { * * @generated */ - public Operator getOperator() { + public ComparisonOperator getOperator() { return operator; } @@ -175,8 +175,8 @@ public Operator getOperator() { * * @generated */ - public void setOperator(Operator newOperator) { - Operator oldOperator = operator; + public void setOperator(ComparisonOperator newOperator) { + ComparisonOperator oldOperator = operator; operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); @@ -215,7 +215,7 @@ public void eSet(int featureID, Object newValue) { setValue((Integer)newValue); return; case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY__OPERATOR: - setOperator((Operator)newValue); + setOperator((ComparisonOperator)newValue); return; } super.eSet(featureID, newValue); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java index 434857f35..0a55fa498 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ManyStringAttributePropertyImpl.java @@ -2,8 +2,8 @@ */ package fr.inria.diverse.event.commons.model.property.impl; +import fr.inria.diverse.event.commons.model.property.ComparisonOperator; import fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty; -import fr.inria.diverse.event.commons.model.property.Operator; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.Quantifier; @@ -77,7 +77,7 @@ public class ManyStringAttributePropertyImpl extends StatePropertyImpl imp * @generated * @ordered */ - protected static final Operator OPERATOR_EDEFAULT = Operator.EQUAL; + protected static final ComparisonOperator OPERATOR_EDEFAULT = ComparisonOperator.EQUAL; /** * The cached value of the '{@link #getOperator() Operator}' attribute. @@ -87,7 +87,7 @@ public class ManyStringAttributePropertyImpl extends StatePropertyImpl imp * @generated * @ordered */ - protected Operator operator = OPERATOR_EDEFAULT; + protected ComparisonOperator operator = OPERATOR_EDEFAULT; /** * @@ -166,7 +166,7 @@ public void setValue(String newValue) { * * @generated */ - public Operator getOperator() { + public ComparisonOperator getOperator() { return operator; } @@ -175,8 +175,8 @@ public Operator getOperator() { * * @generated */ - public void setOperator(Operator newOperator) { - Operator oldOperator = operator; + public void setOperator(ComparisonOperator newOperator) { + ComparisonOperator oldOperator = operator; operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); @@ -215,7 +215,7 @@ public void eSet(int featureID, Object newValue) { setValue((String)newValue); return; case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY__OPERATOR: - setOperator((Operator)newValue); + setOperator((ComparisonOperator)newValue); return; } super.eSet(featureID, newValue); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/NegationTemporalPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/NegationTemporalPropertyImpl.java new file mode 100644 index 000000000..b2f5bdb72 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/NegationTemporalPropertyImpl.java @@ -0,0 +1,176 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.NegationTemporalProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.TemporalProperty; + +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; + +/** + * + * An implementation of the model object 'Negation Temporal Property'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.NegationTemporalPropertyImpl#getFormula Formula}
    • + *
    + * + * @generated + */ +public abstract class NegationTemporalPropertyImpl

    extends TemporalPropertyImpl implements NegationTemporalProperty

    { + /** + * The cached value of the '{@link #getFormula() Formula}' containment reference. + * + * + * @see #getFormula() + * @generated + * @ordered + */ + protected P formula; + + /** + * + * + * @generated + */ + protected NegationTemporalPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.NEGATION_TEMPORAL_PROPERTY; + } + + /** + * + * + * @generated + */ + public P getFormula() { + return formula; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFormula(P newFormula, NotificationChain msgs) { + P oldFormula = formula; + formula = newFormula; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA, oldFormula, newFormula); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setFormula(P newFormula) { + if (newFormula != formula) { + NotificationChain msgs = null; + if (formula != null) + msgs = ((InternalEObject)formula).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA, null, msgs); + if (newFormula != null) + msgs = ((InternalEObject)newFormula).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA, null, msgs); + msgs = basicSetFormula(newFormula, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA, newFormula, newFormula)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA: + return basicSetFormula(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA: + return getFormula(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA: + setFormula((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA: + setFormula((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.NEGATION_TEMPORAL_PROPERTY__FORMULA: + return formula != null; + } + return super.eIsSet(featureID); + } + +} //NegationTemporalPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/NextPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/NextPropertyImpl.java new file mode 100644 index 000000000..85fd9b8a7 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/NextPropertyImpl.java @@ -0,0 +1,175 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.AbstractProperty; +import fr.inria.diverse.event.commons.model.property.NextProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +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; + +/** + * + * An implementation of the model object 'Next Property'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.NextPropertyImpl#getFormula Formula}
    • + *
    + * + * @generated + */ +public abstract class NextPropertyImpl

    extends TemporalPropertyImpl implements NextProperty

    { + /** + * The cached value of the '{@link #getFormula() Formula}' containment reference. + * + * + * @see #getFormula() + * @generated + * @ordered + */ + protected P formula; + + /** + * + * + * @generated + */ + protected NextPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.NEXT_PROPERTY; + } + + /** + * + * + * @generated + */ + public P getFormula() { + return formula; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFormula(P newFormula, NotificationChain msgs) { + P oldFormula = formula; + formula = newFormula; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.NEXT_PROPERTY__FORMULA, oldFormula, newFormula); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setFormula(P newFormula) { + if (newFormula != formula) { + NotificationChain msgs = null; + if (formula != null) + msgs = ((InternalEObject)formula).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.NEXT_PROPERTY__FORMULA, null, msgs); + if (newFormula != null) + msgs = ((InternalEObject)newFormula).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.NEXT_PROPERTY__FORMULA, null, msgs); + msgs = basicSetFormula(newFormula, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.NEXT_PROPERTY__FORMULA, newFormula, newFormula)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.NEXT_PROPERTY__FORMULA: + return basicSetFormula(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.NEXT_PROPERTY__FORMULA: + return getFormula(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.NEXT_PROPERTY__FORMULA: + setFormula((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.NEXT_PROPERTY__FORMULA: + setFormula((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.NEXT_PROPERTY__FORMULA: + return formula != null; + } + return super.eIsSet(featureID); + } + +} //NextPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java index 539220131..fc6d57541 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyFactoryImpl.java @@ -4,6 +4,7 @@ import fr.inria.diverse.event.commons.model.property.*; +import fr.inria.diverse.event.commons.model.scenario.Event; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EObject; @@ -57,13 +58,14 @@ public PropertyFactoryImpl() { @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { + case PropertyPackage.ABSTRACT_PROPERTY: return createAbstractProperty(); + case PropertyPackage.PROPERTY_REFERENCE: return createPropertyReference(); case PropertyPackage.COMPOSITE_PROPERTY: return createCompositeProperty(); case PropertyPackage.EVENT_PRECONDITION: return createEventPrecondition(); case PropertyPackage.CONTAINER_REFERENCE_PROPERTY: return createContainerReferenceProperty(); case PropertyPackage.MANY_BOOLEAN_ATTRIBUTE_PROPERTY: return createManyBooleanAttributeProperty(); case PropertyPackage.MANY_INTEGER_ATTRIBUTE_PROPERTY: return createManyIntegerAttributeProperty(); case PropertyPackage.MANY_STRING_ATTRIBUTE_PROPERTY: return createManyStringAttributeProperty(); - case PropertyPackage.PROPERTY_REFERENCE: return createPropertyReference(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -77,8 +79,10 @@ public EObject create(EClass eClass) { @Override public Object createFromString(EDataType eDataType, String initialValue) { switch (eDataType.getClassifierID()) { - case PropertyPackage.OPERATOR: - return createOperatorFromString(eDataType, initialValue); + case PropertyPackage.UNARY_OPERATOR: + return createUnaryOperatorFromString(eDataType, initialValue); + case PropertyPackage.COMPARISON_OPERATOR: + return createComparisonOperatorFromString(eDataType, initialValue); case PropertyPackage.BOOLEAN_OPERATOR: return createBooleanOperatorFromString(eDataType, initialValue); case PropertyPackage.QUANTIFIER: @@ -98,8 +102,10 @@ public Object createFromString(EDataType eDataType, String initialValue) { @Override public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { - case PropertyPackage.OPERATOR: - return convertOperatorToString(eDataType, instanceValue); + case PropertyPackage.UNARY_OPERATOR: + return convertUnaryOperatorToString(eDataType, instanceValue); + case PropertyPackage.COMPARISON_OPERATOR: + return convertComparisonOperatorToString(eDataType, instanceValue); case PropertyPackage.BOOLEAN_OPERATOR: return convertBooleanOperatorToString(eDataType, instanceValue); case PropertyPackage.QUANTIFIER: @@ -116,19 +122,9 @@ public String convertToString(EDataType eDataType, Object instanceValue) { * * @generated */ - public CompositeProperty createCompositeProperty() { - CompositePropertyImpl compositeProperty = new CompositePropertyImpl(); - return compositeProperty; - } - - /** - * - * - * @generated - */ - public EventPrecondition createEventPrecondition() { - EventPreconditionImpl eventPrecondition = new EventPreconditionImpl(); - return eventPrecondition; + public AbstractProperty createAbstractProperty() { + AbstractPropertyImpl abstractProperty = new AbstractPropertyImpl(); + return abstractProperty; } /** @@ -176,9 +172,10 @@ public ManyStringAttributeProperty createManyStringAttributeProperty() { * * @generated */ - public PropertyReference createPropertyReference() { - PropertyReferenceImpl propertyReference = new PropertyReferenceImpl(); - return propertyReference; + public UnaryOperator createUnaryOperatorFromString(EDataType eDataType, String initialValue) { + UnaryOperator result = UnaryOperator.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; } /** @@ -186,8 +183,17 @@ public PropertyReference createPropertyReference() { * * @generated */ - public Operator createOperatorFromString(EDataType eDataType, String initialValue) { - Operator result = Operator.get(initialValue); + public String convertUnaryOperatorToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public ComparisonOperator createComparisonOperatorFromString(EDataType eDataType, String initialValue) { + ComparisonOperator result = ComparisonOperator.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; } @@ -197,10 +203,40 @@ public Operator createOperatorFromString(EDataType eDataType, String initialValu * * @generated */ - public String convertOperatorToString(EDataType eDataType, Object instanceValue) { + public String convertComparisonOperatorToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } + /** + * + * + * @generated + */ + public

    PropertyReference

    createPropertyReference() { + PropertyReferenceImpl

    propertyReference = new PropertyReferenceImpl

    (); + return propertyReference; + } + + /** + * + * + * @generated + */ + public

    CompositeProperty

    createCompositeProperty() { + CompositePropertyImpl

    compositeProperty = new CompositePropertyImpl

    (); + return compositeProperty; + } + + /** + * + * + * @generated + */ + public > EventPrecondition createEventPrecondition() { + EventPreconditionImpl eventPrecondition = new EventPreconditionImpl(); + return eventPrecondition; + } + /** * * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyImpl.java index 9b9d903a0..76fe7cad2 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyImpl.java @@ -7,8 +7,6 @@ import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - /** * * An implementation of the model object 'Property'. @@ -16,7 +14,7 @@ * * @generated */ -public abstract class PropertyImpl extends MinimalEObjectImpl.Container implements Property { +public abstract class PropertyImpl extends AbstractPropertyImpl implements Property { /** * * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java index f6b8e219f..eaf826004 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyPackageImpl.java @@ -2,9 +2,11 @@ */ package fr.inria.diverse.event.commons.model.property.impl; +import fr.inria.diverse.event.commons.model.property.AbstractProperty; import fr.inria.diverse.event.commons.model.property.BinaryProperty; import fr.inria.diverse.event.commons.model.property.BooleanAttributeProperty; import fr.inria.diverse.event.commons.model.property.BooleanOperator; +import fr.inria.diverse.event.commons.model.property.ComparisonOperator; import fr.inria.diverse.event.commons.model.property.CompositeProperty; import fr.inria.diverse.event.commons.model.property.ContainerReferenceProperty; import fr.inria.diverse.event.commons.model.property.EventPrecondition; @@ -13,18 +15,24 @@ import fr.inria.diverse.event.commons.model.property.ManyIntegerAttributeProperty; import fr.inria.diverse.event.commons.model.property.ManyReferenceProperty; import fr.inria.diverse.event.commons.model.property.ManyStringAttributeProperty; -import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.NegationTemporalProperty; +import fr.inria.diverse.event.commons.model.property.NextProperty; import fr.inria.diverse.event.commons.model.property.Property; import fr.inria.diverse.event.commons.model.property.PropertyFactory; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.PropertyReference; import fr.inria.diverse.event.commons.model.property.Quantifier; +import fr.inria.diverse.event.commons.model.property.ReleaseProperty; import fr.inria.diverse.event.commons.model.property.SingleReferenceProperty; import fr.inria.diverse.event.commons.model.property.StateProperty; import fr.inria.diverse.event.commons.model.property.StepProperty; import fr.inria.diverse.event.commons.model.property.Stepping; import fr.inria.diverse.event.commons.model.property.StringAttributeProperty; +import fr.inria.diverse.event.commons.model.property.TemporalProperty; +import fr.inria.diverse.event.commons.model.property.UnaryOperator; +import fr.inria.diverse.event.commons.model.property.UnaryProperty; +import fr.inria.diverse.event.commons.model.property.UntilProperty; import fr.inria.diverse.event.commons.model.scenario.ScenarioPackage; import fr.inria.diverse.event.commons.model.scenario.impl.ScenarioPackageImpl; import org.eclipse.emf.ecore.EAttribute; @@ -46,6 +54,48 @@ * @generated */ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage { + /** + * + * + * @generated + */ + private EClass abstractPropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass temporalPropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass nextPropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass untilPropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass releasePropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass negationTemporalPropertyEClass = null; + /** * * @@ -53,6 +103,13 @@ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage */ private EClass statePropertyEClass = null; + /** + * + * + * @generated + */ + private EClass unaryPropertyEClass = null; + /** * * @@ -128,42 +185,49 @@ public class PropertyPackageImpl extends EPackageImpl implements PropertyPackage * * @generated */ - private EClass stepPropertyEClass = null; + private EEnum unaryOperatorEEnum = null; /** * * * @generated */ - private EClass propertyReferenceEClass = null; + private EEnum comparisonOperatorEEnum = null; /** * * * @generated */ - private EClass propertyEClass = null; + private EClass stepPropertyEClass = null; /** * * * @generated */ - private EClass compositePropertyEClass = null; + private EClass propertyReferenceEClass = null; /** * * * @generated */ - private EClass eventPreconditionEClass = null; + private EClass propertyEClass = null; + + /** + * + * + * @generated + */ + private EClass compositePropertyEClass = null; /** * * * @generated */ - private EEnum operatorEEnum = null; + private EClass eventPreconditionEClass = null; /** * @@ -252,6 +316,114 @@ public static PropertyPackage init() { return thePropertyPackage; } + /** + * + * + * @generated + */ + public EClass getAbstractProperty() { + return abstractPropertyEClass; + } + + /** + * + * + * @generated + */ + public EClass getTemporalProperty() { + return temporalPropertyEClass; + } + + /** + * + * + * @generated + */ + public EClass getNextProperty() { + return nextPropertyEClass; + } + + /** + * + * + * @generated + */ + public EReference getNextProperty_Formula() { + return (EReference)nextPropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getUntilProperty() { + return untilPropertyEClass; + } + + /** + * + * + * @generated + */ + public EReference getUntilProperty_LeftFormula() { + return (EReference)untilPropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getUntilProperty_RightFormula() { + return (EReference)untilPropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getReleaseProperty() { + return releasePropertyEClass; + } + + /** + * + * + * @generated + */ + public EReference getReleaseProperty_LeftFormula() { + return (EReference)releasePropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getReleaseProperty_RightFormula() { + return (EReference)releasePropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getNegationTemporalProperty() { + return negationTemporalPropertyEClass; + } + + /** + * + * + * @generated + */ + public EReference getNegationTemporalProperty_Formula() { + return (EReference)negationTemporalPropertyEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -279,6 +451,33 @@ public EOperation getStateProperty__GetFeature() { return statePropertyEClass.getEOperations().get(0); } + /** + * + * + * @generated + */ + public EClass getUnaryProperty() { + return unaryPropertyEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getUnaryProperty_Operator() { + return (EAttribute)unaryPropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getUnaryProperty_Property() { + return (EReference)unaryPropertyEClass.getEStructuralFeatures().get(1); + } + /** * * @@ -567,6 +766,24 @@ public EAttribute getStringAttributeProperty_Operator() { return (EAttribute)stringAttributePropertyEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + public EEnum getUnaryOperator() { + return unaryOperatorEEnum; + } + + /** + * + * + * @generated + */ + public EEnum getComparisonOperator() { + return comparisonOperatorEEnum; + } + /** * * @@ -666,15 +883,6 @@ public EReference getEventPrecondition_Event() { return (EReference)eventPreconditionEClass.getEStructuralFeatures().get(0); } - /** - * - * - * @generated - */ - public EEnum getOperator() { - return operatorEEnum; - } - /** * * @@ -730,18 +938,48 @@ public void createPackageContents() { isCreated = true; // Create classes and their features + abstractPropertyEClass = createEClass(ABSTRACT_PROPERTY); + + temporalPropertyEClass = createEClass(TEMPORAL_PROPERTY); + + nextPropertyEClass = createEClass(NEXT_PROPERTY); + createEReference(nextPropertyEClass, NEXT_PROPERTY__FORMULA); + + untilPropertyEClass = createEClass(UNTIL_PROPERTY); + createEReference(untilPropertyEClass, UNTIL_PROPERTY__LEFT_FORMULA); + createEReference(untilPropertyEClass, UNTIL_PROPERTY__RIGHT_FORMULA); + + releasePropertyEClass = createEClass(RELEASE_PROPERTY); + createEReference(releasePropertyEClass, RELEASE_PROPERTY__LEFT_FORMULA); + createEReference(releasePropertyEClass, RELEASE_PROPERTY__RIGHT_FORMULA); + + negationTemporalPropertyEClass = createEClass(NEGATION_TEMPORAL_PROPERTY); + createEReference(negationTemporalPropertyEClass, NEGATION_TEMPORAL_PROPERTY__FORMULA); + propertyEClass = createEClass(PROPERTY); + propertyReferenceEClass = createEClass(PROPERTY_REFERENCE); + createEReference(propertyReferenceEClass, PROPERTY_REFERENCE__REFERENCED_PROPERTY); + compositePropertyEClass = createEClass(COMPOSITE_PROPERTY); createEReference(compositePropertyEClass, COMPOSITE_PROPERTY__PROPERTIES); eventPreconditionEClass = createEClass(EVENT_PRECONDITION); createEReference(eventPreconditionEClass, EVENT_PRECONDITION__EVENT); + stepPropertyEClass = createEClass(STEP_PROPERTY); + createEAttribute(stepPropertyEClass, STEP_PROPERTY__STEPPING); + createEReference(stepPropertyEClass, STEP_PROPERTY__TARGET_PROVIDER); + createEOperation(stepPropertyEClass, STEP_PROPERTY___GET_OPERATION); + statePropertyEClass = createEClass(STATE_PROPERTY); createEReference(statePropertyEClass, STATE_PROPERTY__TARGET); createEOperation(statePropertyEClass, STATE_PROPERTY___GET_FEATURE); + unaryPropertyEClass = createEClass(UNARY_PROPERTY); + createEAttribute(unaryPropertyEClass, UNARY_PROPERTY__OPERATOR); + createEReference(unaryPropertyEClass, UNARY_PROPERTY__PROPERTY); + binaryPropertyEClass = createEClass(BINARY_PROPERTY); createEAttribute(binaryPropertyEClass, BINARY_PROPERTY__OPERATOR); createEReference(binaryPropertyEClass, BINARY_PROPERTY__LEFT); @@ -784,16 +1022,9 @@ public void createPackageContents() { createEAttribute(stringAttributePropertyEClass, STRING_ATTRIBUTE_PROPERTY__VALUE); createEAttribute(stringAttributePropertyEClass, STRING_ATTRIBUTE_PROPERTY__OPERATOR); - stepPropertyEClass = createEClass(STEP_PROPERTY); - createEAttribute(stepPropertyEClass, STEP_PROPERTY__STEPPING); - createEReference(stepPropertyEClass, STEP_PROPERTY__TARGET_PROVIDER); - createEOperation(stepPropertyEClass, STEP_PROPERTY___GET_OPERATION); - - propertyReferenceEClass = createEClass(PROPERTY_REFERENCE); - createEReference(propertyReferenceEClass, PROPERTY_REFERENCE__REFERENCED_PROPERTY); - // Create enums - operatorEEnum = createEEnum(OPERATOR); + unaryOperatorEEnum = createEEnum(UNARY_OPERATOR); + comparisonOperatorEEnum = createEEnum(COMPARISON_OPERATOR); booleanOperatorEEnum = createEEnum(BOOLEAN_OPERATOR); quantifierEEnum = createEEnum(QUANTIFIER); steppingEEnum = createEEnum(STEPPING); @@ -827,7 +1058,17 @@ public void initializePackageContents() { EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); // Create type parameters + ETypeParameter nextPropertyEClass_P = addETypeParameter(nextPropertyEClass, "P"); + ETypeParameter untilPropertyEClass_P = addETypeParameter(untilPropertyEClass, "P"); + ETypeParameter releasePropertyEClass_P = addETypeParameter(releasePropertyEClass, "P"); + ETypeParameter negationTemporalPropertyEClass_P = addETypeParameter(negationTemporalPropertyEClass, "P"); + ETypeParameter propertyReferenceEClass_P = addETypeParameter(propertyReferenceEClass, "P"); + ETypeParameter compositePropertyEClass_P = addETypeParameter(compositePropertyEClass, "P"); + ETypeParameter eventPreconditionEClass_E = addETypeParameter(eventPreconditionEClass, "E"); + ETypeParameter stepPropertyEClass_T = addETypeParameter(stepPropertyEClass, "T"); ETypeParameter statePropertyEClass_T = addETypeParameter(statePropertyEClass, "T"); + ETypeParameter unaryPropertyEClass_P = addETypeParameter(unaryPropertyEClass, "P"); + ETypeParameter unaryPropertyEClass_T = addETypeParameter(unaryPropertyEClass, "T"); ETypeParameter binaryPropertyEClass_P = addETypeParameter(binaryPropertyEClass, "P"); ETypeParameter binaryPropertyEClass_T = addETypeParameter(binaryPropertyEClass, "T"); ETypeParameter manyReferencePropertyEClass_P = addETypeParameter(manyReferencePropertyEClass, "P"); @@ -842,12 +1083,31 @@ public void initializePackageContents() { ETypeParameter booleanAttributePropertyEClass_T = addETypeParameter(booleanAttributePropertyEClass, "T"); ETypeParameter integerAttributePropertyEClass_T = addETypeParameter(integerAttributePropertyEClass, "T"); ETypeParameter stringAttributePropertyEClass_T = addETypeParameter(stringAttributePropertyEClass, "T"); - ETypeParameter stepPropertyEClass_T = addETypeParameter(stepPropertyEClass, "T"); // Set bounds for type parameters - EGenericType g1 = createEGenericType(this.getStateProperty()); + EGenericType g1 = createEGenericType(this.getAbstractProperty()); + nextPropertyEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getAbstractProperty()); + untilPropertyEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getAbstractProperty()); + releasePropertyEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getTemporalProperty()); + negationTemporalPropertyEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getProperty()); + propertyReferenceEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getProperty()); + compositePropertyEClass_P.getEBounds().add(g1); + g1 = createEGenericType(theScenarioPackage.getEvent()); EGenericType g2 = createEGenericType(); g1.getETypeArguments().add(g2); + eventPreconditionEClass_E.getEBounds().add(g1); + g1 = createEGenericType(this.getStateProperty()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); + unaryPropertyEClass_P.getEBounds().add(g1); + g1 = createEGenericType(this.getStateProperty()); + g2 = createEGenericType(); + g1.getETypeArguments().add(g2); binaryPropertyEClass_P.getEBounds().add(g1); g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(); @@ -863,10 +1123,22 @@ public void initializePackageContents() { containerReferencePropertyEClass_P.getEBounds().add(g1); // Add supertypes to classes + temporalPropertyEClass.getESuperTypes().add(this.getAbstractProperty()); + nextPropertyEClass.getESuperTypes().add(this.getTemporalProperty()); + untilPropertyEClass.getESuperTypes().add(this.getTemporalProperty()); + releasePropertyEClass.getESuperTypes().add(this.getTemporalProperty()); + negationTemporalPropertyEClass.getESuperTypes().add(this.getTemporalProperty()); + propertyEClass.getESuperTypes().add(this.getAbstractProperty()); + propertyReferenceEClass.getESuperTypes().add(this.getProperty()); compositePropertyEClass.getESuperTypes().add(this.getProperty()); eventPreconditionEClass.getESuperTypes().add(this.getProperty()); + stepPropertyEClass.getESuperTypes().add(this.getProperty()); statePropertyEClass.getESuperTypes().add(this.getProperty()); g1 = createEGenericType(this.getStateProperty()); + g2 = createEGenericType(unaryPropertyEClass_T); + g1.getETypeArguments().add(g2); + unaryPropertyEClass.getEGenericSuperTypes().add(g1); + g1 = createEGenericType(this.getStateProperty()); g2 = createEGenericType(binaryPropertyEClass_T); g1.getETypeArguments().add(g2); binaryPropertyEClass.getEGenericSuperTypes().add(g1); @@ -906,27 +1178,66 @@ public void initializePackageContents() { g2 = createEGenericType(stringAttributePropertyEClass_T); g1.getETypeArguments().add(g2); stringAttributePropertyEClass.getEGenericSuperTypes().add(g1); - stepPropertyEClass.getESuperTypes().add(this.getProperty()); - propertyReferenceEClass.getESuperTypes().add(this.getProperty()); // Initialize classes, features, and operations; add parameters + initEClass(abstractPropertyEClass, AbstractProperty.class, "AbstractProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(temporalPropertyEClass, TemporalProperty.class, "TemporalProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(nextPropertyEClass, NextProperty.class, "NextProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(nextPropertyEClass_P); + initEReference(getNextProperty_Formula(), g1, null, "formula", null, 0, 1, NextProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(untilPropertyEClass, UntilProperty.class, "UntilProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(untilPropertyEClass_P); + initEReference(getUntilProperty_LeftFormula(), g1, null, "leftFormula", null, 0, 1, UntilProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(untilPropertyEClass_P); + initEReference(getUntilProperty_RightFormula(), g1, null, "rightFormula", null, 0, 1, UntilProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(releasePropertyEClass, ReleaseProperty.class, "ReleaseProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(releasePropertyEClass_P); + initEReference(getReleaseProperty_LeftFormula(), g1, null, "leftFormula", null, 0, 1, ReleaseProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(releasePropertyEClass_P); + initEReference(getReleaseProperty_RightFormula(), g1, null, "rightFormula", null, 0, 1, ReleaseProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(negationTemporalPropertyEClass, NegationTemporalProperty.class, "NegationTemporalProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(negationTemporalPropertyEClass_P); + initEReference(getNegationTemporalProperty_Formula(), g1, null, "formula", null, 0, 1, NegationTemporalProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(propertyEClass, Property.class, "Property", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(propertyReferenceEClass, PropertyReference.class, "PropertyReference", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + g1 = createEGenericType(propertyReferenceEClass_P); + initEReference(getPropertyReference_ReferencedProperty(), g1, null, "referencedProperty", null, 0, 1, PropertyReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(compositePropertyEClass, CompositeProperty.class, "CompositeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getCompositeProperty_Properties(), this.getProperty(), null, "properties", null, 0, -1, CompositeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(compositePropertyEClass_P); + initEReference(getCompositeProperty_Properties(), g1, null, "properties", null, 0, -1, CompositeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(eventPreconditionEClass, EventPrecondition.class, "EventPrecondition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(theScenarioPackage.getEvent()); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); + g1 = createEGenericType(eventPreconditionEClass_E); initEReference(getEventPrecondition_Event(), g1, null, "event", null, 0, 1, EventPrecondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(stepPropertyEClass, StepProperty.class, "StepProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getStepProperty_Stepping(), this.getStepping(), "stepping", null, 0, 1, StepProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(theScenarioPackage.getElementProvider()); + g2 = createEGenericType(stepPropertyEClass_T); + g1.getETypeArguments().add(g2); + initEReference(getStepProperty_TargetProvider(), g1, null, "targetProvider", null, 0, 1, StepProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEOperation(getStepProperty__GetOperation(), theEcorePackage.getEOperation(), "getOperation", 0, 1, IS_UNIQUE, IS_ORDERED); + initEClass(statePropertyEClass, StateProperty.class, "StateProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(statePropertyEClass_T); initEReference(getStateProperty_Target(), g1, null, "target", null, 0, 1, StateProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEOperation(getStateProperty__GetFeature(), theEcorePackage.getEStructuralFeature(), "getFeature", 0, 1, IS_UNIQUE, IS_ORDERED); + initEClass(unaryPropertyEClass, UnaryProperty.class, "UnaryProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getUnaryProperty_Operator(), this.getUnaryOperator(), "operator", null, 1, 1, UnaryProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(unaryPropertyEClass_P); + initEReference(getUnaryProperty_Property(), g1, null, "property", null, 1, 1, UnaryProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(binaryPropertyEClass, BinaryProperty.class, "BinaryProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getBinaryProperty_Operator(), this.getBooleanOperator(), "operator", null, 1, 1, BinaryProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(binaryPropertyEClass_P); @@ -950,45 +1261,36 @@ public void initializePackageContents() { initEClass(manyBooleanAttributePropertyEClass, ManyBooleanAttributeProperty.class, "ManyBooleanAttributeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getManyBooleanAttributeProperty_Quantifier(), this.getQuantifier(), "quantifier", null, 0, 1, ManyBooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getManyBooleanAttributeProperty_Value(), theEcorePackage.getEBoolean(), "value", null, 0, 1, ManyBooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getManyBooleanAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, ManyBooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyBooleanAttributeProperty_Operator(), this.getComparisonOperator(), "operator", null, 0, 1, ManyBooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(manyIntegerAttributePropertyEClass, ManyIntegerAttributeProperty.class, "ManyIntegerAttributeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getManyIntegerAttributeProperty_Quantifier(), this.getQuantifier(), "quantifier", null, 0, 1, ManyIntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getManyIntegerAttributeProperty_Value(), theEcorePackage.getEInt(), "value", null, 0, 1, ManyIntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getManyIntegerAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, ManyIntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyIntegerAttributeProperty_Operator(), this.getComparisonOperator(), "operator", null, 0, 1, ManyIntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(manyStringAttributePropertyEClass, ManyStringAttributeProperty.class, "ManyStringAttributeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getManyStringAttributeProperty_Quantifier(), this.getQuantifier(), "quantifier", null, 0, 1, ManyStringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getManyStringAttributeProperty_Value(), theEcorePackage.getEString(), "value", null, 0, 1, ManyStringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getManyStringAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, ManyStringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getManyStringAttributeProperty_Operator(), this.getComparisonOperator(), "operator", null, 0, 1, ManyStringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(booleanAttributePropertyEClass, BooleanAttributeProperty.class, "BooleanAttributeProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getBooleanAttributeProperty_Value(), theEcorePackage.getEBoolean(), "value", null, 0, 1, BooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getBooleanAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, BooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getBooleanAttributeProperty_Operator(), this.getComparisonOperator(), "operator", null, 0, 1, BooleanAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(integerAttributePropertyEClass, IntegerAttributeProperty.class, "IntegerAttributeProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getIntegerAttributeProperty_Value(), theEcorePackage.getEInt(), "value", null, 0, 1, IntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIntegerAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, IntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getIntegerAttributeProperty_Operator(), this.getComparisonOperator(), "operator", null, 0, 1, IntegerAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(stringAttributePropertyEClass, StringAttributeProperty.class, "StringAttributeProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getStringAttributeProperty_Value(), theEcorePackage.getEString(), "value", null, 0, 1, StringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getStringAttributeProperty_Operator(), this.getOperator(), "operator", null, 0, 1, StringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(stepPropertyEClass, StepProperty.class, "StepProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getStepProperty_Stepping(), this.getStepping(), "stepping", null, 0, 1, StepProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - g1 = createEGenericType(theScenarioPackage.getElementProvider()); - g2 = createEGenericType(stepPropertyEClass_T); - g1.getETypeArguments().add(g2); - initEReference(getStepProperty_TargetProvider(), g1, null, "targetProvider", null, 0, 1, StepProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEOperation(getStepProperty__GetOperation(), theEcorePackage.getEOperation(), "getOperation", 0, 1, IS_UNIQUE, IS_ORDERED); - - initEClass(propertyReferenceEClass, PropertyReference.class, "PropertyReference", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getPropertyReference_ReferencedProperty(), this.getProperty(), null, "referencedProperty", null, 0, 1, PropertyReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getStringAttributeProperty_Operator(), this.getComparisonOperator(), "operator", null, 0, 1, StringAttributeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Initialize enums and add enum literals - initEEnum(operatorEEnum, Operator.class, "Operator"); - addEEnumLiteral(operatorEEnum, Operator.EQUAL); + initEEnum(unaryOperatorEEnum, UnaryOperator.class, "UnaryOperator"); + addEEnumLiteral(unaryOperatorEEnum, UnaryOperator.NOT); + + initEEnum(comparisonOperatorEEnum, ComparisonOperator.class, "ComparisonOperator"); + addEEnumLiteral(comparisonOperatorEEnum, ComparisonOperator.EQUAL); initEEnum(booleanOperatorEEnum, BooleanOperator.class, "BooleanOperator"); addEEnumLiteral(booleanOperatorEEnum, BooleanOperator.AND); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyReferenceImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyReferenceImpl.java index 046ff94d3..d10f1a311 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyReferenceImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/PropertyReferenceImpl.java @@ -26,7 +26,7 @@ * * @generated */ -public class PropertyReferenceImpl extends PropertyImpl implements PropertyReference { +public class PropertyReferenceImpl

    extends PropertyImpl implements PropertyReference

    { /** * The cached value of the '{@link #getReferencedProperty() Referenced Property}' reference. * @@ -35,7 +35,7 @@ public class PropertyReferenceImpl extends PropertyImpl implements PropertyRefer * @generated * @ordered */ - protected Property referencedProperty; + protected P referencedProperty; /** * @@ -61,10 +61,11 @@ protected EClass eStaticClass() { * * @generated */ - public Property getReferencedProperty() { + @SuppressWarnings("unchecked") + public P getReferencedProperty() { if (referencedProperty != null && referencedProperty.eIsProxy()) { InternalEObject oldReferencedProperty = (InternalEObject)referencedProperty; - referencedProperty = (Property)eResolveProxy(oldReferencedProperty); + referencedProperty = (P)eResolveProxy(oldReferencedProperty); if (referencedProperty != oldReferencedProperty) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY, oldReferencedProperty, referencedProperty)); @@ -78,7 +79,7 @@ public Property getReferencedProperty() { * * @generated */ - public Property basicGetReferencedProperty() { + public P basicGetReferencedProperty() { return referencedProperty; } @@ -87,8 +88,8 @@ public Property basicGetReferencedProperty() { * * @generated */ - public void setReferencedProperty(Property newReferencedProperty) { - Property oldReferencedProperty = referencedProperty; + public void setReferencedProperty(P newReferencedProperty) { + P oldReferencedProperty = referencedProperty; referencedProperty = newReferencedProperty; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY, oldReferencedProperty, referencedProperty)); @@ -114,11 +115,12 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { * * @generated */ + @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY: - setReferencedProperty((Property)newValue); + setReferencedProperty((P)newValue); return; } super.eSet(featureID, newValue); @@ -133,7 +135,7 @@ public void eSet(int featureID, Object newValue) { public void eUnset(int featureID) { switch (featureID) { case PropertyPackage.PROPERTY_REFERENCE__REFERENCED_PROPERTY: - setReferencedProperty((Property)null); + setReferencedProperty((P)null); return; } super.eUnset(featureID); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ReleasePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ReleasePropertyImpl.java new file mode 100644 index 000000000..0fa73767f --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/ReleasePropertyImpl.java @@ -0,0 +1,241 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.AbstractProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.ReleaseProperty; +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; + +/** + * + * An implementation of the model object 'Release Property'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.ReleasePropertyImpl#getLeftFormula Left Formula}
    • + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.ReleasePropertyImpl#getRightFormula Right Formula}
    • + *
    + * + * @generated + */ +public abstract class ReleasePropertyImpl

    extends TemporalPropertyImpl implements ReleaseProperty

    { + /** + * The cached value of the '{@link #getLeftFormula() Left Formula}' containment reference. + * + * + * @see #getLeftFormula() + * @generated + * @ordered + */ + protected P leftFormula; + + /** + * The cached value of the '{@link #getRightFormula() Right Formula}' containment reference. + * + * + * @see #getRightFormula() + * @generated + * @ordered + */ + protected P rightFormula; + + /** + * + * + * @generated + */ + protected ReleasePropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.RELEASE_PROPERTY; + } + + /** + * + * + * @generated + */ + public P getLeftFormula() { + return leftFormula; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLeftFormula(P newLeftFormula, NotificationChain msgs) { + P oldLeftFormula = leftFormula; + leftFormula = newLeftFormula; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA, oldLeftFormula, newLeftFormula); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setLeftFormula(P newLeftFormula) { + if (newLeftFormula != leftFormula) { + NotificationChain msgs = null; + if (leftFormula != null) + msgs = ((InternalEObject)leftFormula).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA, null, msgs); + if (newLeftFormula != null) + msgs = ((InternalEObject)newLeftFormula).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA, null, msgs); + msgs = basicSetLeftFormula(newLeftFormula, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA, newLeftFormula, newLeftFormula)); + } + + /** + * + * + * @generated + */ + public P getRightFormula() { + return rightFormula; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRightFormula(P newRightFormula, NotificationChain msgs) { + P oldRightFormula = rightFormula; + rightFormula = newRightFormula; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA, oldRightFormula, newRightFormula); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setRightFormula(P newRightFormula) { + if (newRightFormula != rightFormula) { + NotificationChain msgs = null; + if (rightFormula != null) + msgs = ((InternalEObject)rightFormula).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA, null, msgs); + if (newRightFormula != null) + msgs = ((InternalEObject)newRightFormula).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA, null, msgs); + msgs = basicSetRightFormula(newRightFormula, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA, newRightFormula, newRightFormula)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA: + return basicSetLeftFormula(null, msgs); + case PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA: + return basicSetRightFormula(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA: + return getLeftFormula(); + case PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA: + return getRightFormula(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA: + setLeftFormula((P)newValue); + return; + case PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA: + setRightFormula((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA: + setLeftFormula((P)null); + return; + case PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA: + setRightFormula((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.RELEASE_PROPERTY__LEFT_FORMULA: + return leftFormula != null; + case PropertyPackage.RELEASE_PROPERTY__RIGHT_FORMULA: + return rightFormula != null; + } + return super.eIsSet(featureID); + } + +} //ReleasePropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java index 502a1b238..68e3f757c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/StringAttributePropertyImpl.java @@ -2,7 +2,7 @@ */ package fr.inria.diverse.event.commons.model.property.impl; -import fr.inria.diverse.event.commons.model.property.Operator; +import fr.inria.diverse.event.commons.model.property.ComparisonOperator; import fr.inria.diverse.event.commons.model.property.PropertyPackage; import fr.inria.diverse.event.commons.model.property.StringAttributeProperty; @@ -55,7 +55,7 @@ public abstract class StringAttributePropertyImpl extends StatePropertyImplOperator}' attribute. @@ -65,7 +65,7 @@ public abstract class StringAttributePropertyImpl extends StatePropertyImpl @@ -123,7 +123,7 @@ public void setValue(String newValue) { * * @generated */ - public Operator getOperator() { + public ComparisonOperator getOperator() { return operator; } @@ -132,8 +132,8 @@ public Operator getOperator() { * * @generated */ - public void setOperator(Operator newOperator) { - Operator oldOperator = operator; + public void setOperator(ComparisonOperator newOperator) { + ComparisonOperator oldOperator = operator; operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.STRING_ATTRIBUTE_PROPERTY__OPERATOR, oldOperator, operator)); @@ -167,7 +167,7 @@ public void eSet(int featureID, Object newValue) { setValue((String)newValue); return; case PropertyPackage.STRING_ATTRIBUTE_PROPERTY__OPERATOR: - setOperator((Operator)newValue); + setOperator((ComparisonOperator)newValue); return; } super.eSet(featureID, newValue); diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/TemporalPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/TemporalPropertyImpl.java new file mode 100644 index 000000000..eb350aede --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/TemporalPropertyImpl.java @@ -0,0 +1,37 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.TemporalProperty; + +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'Temporal Property'. + * + * + * @generated + */ +public abstract class TemporalPropertyImpl extends AbstractPropertyImpl implements TemporalProperty { + /** + * + * + * @generated + */ + protected TemporalPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.TEMPORAL_PROPERTY; + } + +} //TemporalPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/UnaryPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/UnaryPropertyImpl.java new file mode 100644 index 000000000..a90ec4ef3 --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/UnaryPropertyImpl.java @@ -0,0 +1,256 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.StateProperty; +import fr.inria.diverse.event.commons.model.property.UnaryOperator; +import fr.inria.diverse.event.commons.model.property.UnaryProperty; + +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; + +/** + * + * An implementation of the model object 'Unary Property'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.UnaryPropertyImpl#getOperator Operator}
    • + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.UnaryPropertyImpl#getProperty Property}
    • + *
    + * + * @generated + */ +public abstract class UnaryPropertyImpl

    , T> extends StatePropertyImpl implements UnaryProperty { + /** + * The default value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected static final UnaryOperator OPERATOR_EDEFAULT = UnaryOperator.NOT; + + /** + * The cached value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected UnaryOperator operator = OPERATOR_EDEFAULT; + + /** + * The cached value of the '{@link #getProperty() Property}' containment reference. + * + * + * @see #getProperty() + * @generated + * @ordered + */ + protected P property; + + /** + * + * + * @generated + */ + protected UnaryPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.UNARY_PROPERTY; + } + + /** + * + * + * This is specialized for the more specific type known in this context. + * @generated + */ + @Override + public void setTarget(T newTarget) { + super.setTarget(newTarget); + } + + /** + * + * + * @generated + */ + public UnaryOperator getOperator() { + return operator; + } + + /** + * + * + * @generated + */ + public void setOperator(UnaryOperator newOperator) { + UnaryOperator oldOperator = operator; + operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.UNARY_PROPERTY__OPERATOR, oldOperator, operator)); + } + + /** + * + * + * @generated + */ + public P getProperty() { + return property; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetProperty(P newProperty, NotificationChain msgs) { + P oldProperty = property; + property = newProperty; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.UNARY_PROPERTY__PROPERTY, oldProperty, newProperty); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setProperty(P newProperty) { + if (newProperty != property) { + NotificationChain msgs = null; + if (property != null) + msgs = ((InternalEObject)property).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.UNARY_PROPERTY__PROPERTY, null, msgs); + if (newProperty != null) + msgs = ((InternalEObject)newProperty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.UNARY_PROPERTY__PROPERTY, null, msgs); + msgs = basicSetProperty(newProperty, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.UNARY_PROPERTY__PROPERTY, newProperty, newProperty)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.UNARY_PROPERTY__PROPERTY: + return basicSetProperty(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.UNARY_PROPERTY__OPERATOR: + return getOperator(); + case PropertyPackage.UNARY_PROPERTY__PROPERTY: + return getProperty(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.UNARY_PROPERTY__OPERATOR: + setOperator((UnaryOperator)newValue); + return; + case PropertyPackage.UNARY_PROPERTY__PROPERTY: + setProperty((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.UNARY_PROPERTY__OPERATOR: + setOperator(OPERATOR_EDEFAULT); + return; + case PropertyPackage.UNARY_PROPERTY__PROPERTY: + setProperty((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.UNARY_PROPERTY__OPERATOR: + return operator != OPERATOR_EDEFAULT; + case PropertyPackage.UNARY_PROPERTY__PROPERTY: + return property != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (operator: "); + result.append(operator); + result.append(')'); + return result.toString(); + } + +} //UnaryPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/UntilPropertyImpl.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/UntilPropertyImpl.java new file mode 100644 index 000000000..c88a066aa --- /dev/null +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/impl/UntilPropertyImpl.java @@ -0,0 +1,242 @@ +/** + */ +package fr.inria.diverse.event.commons.model.property.impl; + +import fr.inria.diverse.event.commons.model.property.AbstractProperty; +import fr.inria.diverse.event.commons.model.property.PropertyPackage; +import fr.inria.diverse.event.commons.model.property.UntilProperty; + +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; + +/** + * + * An implementation of the model object 'Until Property'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.UntilPropertyImpl#getLeftFormula Left Formula}
    • + *
    • {@link fr.inria.diverse.event.commons.model.property.impl.UntilPropertyImpl#getRightFormula Right Formula}
    • + *
    + * + * @generated + */ +public abstract class UntilPropertyImpl

    extends TemporalPropertyImpl implements UntilProperty

    { + /** + * The cached value of the '{@link #getLeftFormula() Left Formula}' containment reference. + * + * + * @see #getLeftFormula() + * @generated + * @ordered + */ + protected P leftFormula; + + /** + * The cached value of the '{@link #getRightFormula() Right Formula}' containment reference. + * + * + * @see #getRightFormula() + * @generated + * @ordered + */ + protected P rightFormula; + + /** + * + * + * @generated + */ + protected UntilPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PropertyPackage.Literals.UNTIL_PROPERTY; + } + + /** + * + * + * @generated + */ + public P getLeftFormula() { + return leftFormula; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLeftFormula(P newLeftFormula, NotificationChain msgs) { + P oldLeftFormula = leftFormula; + leftFormula = newLeftFormula; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA, oldLeftFormula, newLeftFormula); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setLeftFormula(P newLeftFormula) { + if (newLeftFormula != leftFormula) { + NotificationChain msgs = null; + if (leftFormula != null) + msgs = ((InternalEObject)leftFormula).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA, null, msgs); + if (newLeftFormula != null) + msgs = ((InternalEObject)newLeftFormula).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA, null, msgs); + msgs = basicSetLeftFormula(newLeftFormula, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA, newLeftFormula, newLeftFormula)); + } + + /** + * + * + * @generated + */ + public P getRightFormula() { + return rightFormula; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRightFormula(P newRightFormula, NotificationChain msgs) { + P oldRightFormula = rightFormula; + rightFormula = newRightFormula; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA, oldRightFormula, newRightFormula); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setRightFormula(P newRightFormula) { + if (newRightFormula != rightFormula) { + NotificationChain msgs = null; + if (rightFormula != null) + msgs = ((InternalEObject)rightFormula).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA, null, msgs); + if (newRightFormula != null) + msgs = ((InternalEObject)newRightFormula).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA, null, msgs); + msgs = basicSetRightFormula(newRightFormula, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA, newRightFormula, newRightFormula)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA: + return basicSetLeftFormula(null, msgs); + case PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA: + return basicSetRightFormula(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA: + return getLeftFormula(); + case PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA: + return getRightFormula(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA: + setLeftFormula((P)newValue); + return; + case PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA: + setRightFormula((P)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA: + setLeftFormula((P)null); + return; + case PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA: + setRightFormula((P)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PropertyPackage.UNTIL_PROPERTY__LEFT_FORMULA: + return leftFormula != null; + case PropertyPackage.UNTIL_PROPERTY__RIGHT_FORMULA: + return rightFormula != null; + } + return super.eIsSet(featureID); + } + +} //UntilPropertyImpl diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java index bd6e49488..871a21957 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertyAdapterFactory.java @@ -4,6 +4,7 @@ import fr.inria.diverse.event.commons.model.property.*; +import fr.inria.diverse.event.commons.model.scenario.Event; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; @@ -67,23 +68,59 @@ public boolean isFactoryForType(Object object) { */ protected PropertySwitch modelSwitch = new PropertySwitch() { + @Override + public Adapter caseAbstractProperty(AbstractProperty object) { + return createAbstractPropertyAdapter(); + } + @Override + public Adapter caseTemporalProperty(TemporalProperty object) { + return createTemporalPropertyAdapter(); + } + @Override + public

    Adapter caseNextProperty(NextProperty

    object) { + return createNextPropertyAdapter(); + } + @Override + public

    Adapter caseUntilProperty(UntilProperty

    object) { + return createUntilPropertyAdapter(); + } + @Override + public

    Adapter caseReleaseProperty(ReleaseProperty

    object) { + return createReleasePropertyAdapter(); + } + @Override + public

    Adapter caseNegationTemporalProperty(NegationTemporalProperty

    object) { + return createNegationTemporalPropertyAdapter(); + } @Override public Adapter caseProperty(Property object) { return createPropertyAdapter(); } @Override - public Adapter caseCompositeProperty(CompositeProperty object) { + public

    Adapter casePropertyReference(PropertyReference

    object) { + return createPropertyReferenceAdapter(); + } + @Override + public

    Adapter caseCompositeProperty(CompositeProperty

    object) { return createCompositePropertyAdapter(); } @Override - public Adapter caseEventPrecondition(EventPrecondition object) { + public > Adapter caseEventPrecondition(EventPrecondition object) { return createEventPreconditionAdapter(); } @Override + public Adapter caseStepProperty(StepProperty object) { + return createStepPropertyAdapter(); + } + @Override public Adapter caseStateProperty(StateProperty object) { return createStatePropertyAdapter(); } @Override + public

    , T> Adapter caseUnaryProperty(UnaryProperty object) { + return createUnaryPropertyAdapter(); + } + @Override public

    , T> Adapter caseBinaryProperty(BinaryProperty object) { return createBinaryPropertyAdapter(); } @@ -124,14 +161,6 @@ public Adapter caseStringAttributeProperty(StringAttributeProperty object return createStringAttributePropertyAdapter(); } @Override - public Adapter caseStepProperty(StepProperty object) { - return createStepPropertyAdapter(); - } - @Override - public Adapter casePropertyReference(PropertyReference object) { - return createPropertyReferenceAdapter(); - } - @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -151,6 +180,90 @@ public Adapter createAdapter(Notifier target) { } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.AbstractProperty Abstract 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 fr.inria.diverse.event.commons.model.property.AbstractProperty + * @generated + */ + public Adapter createAbstractPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.TemporalProperty Temporal 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 fr.inria.diverse.event.commons.model.property.TemporalProperty + * @generated + */ + public Adapter createTemporalPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.NextProperty Next 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 fr.inria.diverse.event.commons.model.property.NextProperty + * @generated + */ + public Adapter createNextPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.UntilProperty Until 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 fr.inria.diverse.event.commons.model.property.UntilProperty + * @generated + */ + public Adapter createUntilPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.ReleaseProperty Release 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 fr.inria.diverse.event.commons.model.property.ReleaseProperty + * @generated + */ + public Adapter createReleasePropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.NegationTemporalProperty Negation Temporal 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 fr.inria.diverse.event.commons.model.property.NegationTemporalProperty + * @generated + */ + public Adapter createNegationTemporalPropertyAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.StateProperty State Property}'. * @@ -165,6 +278,20 @@ public Adapter createStatePropertyAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.UnaryProperty Unary 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 fr.inria.diverse.event.commons.model.property.UnaryProperty + * @generated + */ + public Adapter createUnaryPropertyAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link fr.inria.diverse.event.commons.model.property.BinaryProperty Binary Property}'. * diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java index 62ab641a7..22990420c 100644 --- a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java +++ b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model/src/fr/inria/diverse/event/commons/model/property/util/PropertySwitch.java @@ -4,6 +4,7 @@ import fr.inria.diverse.event.commons.model.property.*; +import fr.inria.diverse.event.commons.model.scenario.Event; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; @@ -66,23 +67,87 @@ protected boolean isSwitchFor(EPackage ePackage) { @Override protected T1 doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { + case PropertyPackage.ABSTRACT_PROPERTY: { + AbstractProperty abstractProperty = (AbstractProperty)theEObject; + T1 result = caseAbstractProperty(abstractProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.TEMPORAL_PROPERTY: { + TemporalProperty temporalProperty = (TemporalProperty)theEObject; + T1 result = caseTemporalProperty(temporalProperty); + if (result == null) result = caseAbstractProperty(temporalProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.NEXT_PROPERTY: { + NextProperty nextProperty = (NextProperty)theEObject; + T1 result = caseNextProperty(nextProperty); + if (result == null) result = caseTemporalProperty(nextProperty); + if (result == null) result = caseAbstractProperty(nextProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.UNTIL_PROPERTY: { + UntilProperty untilProperty = (UntilProperty)theEObject; + T1 result = caseUntilProperty(untilProperty); + if (result == null) result = caseTemporalProperty(untilProperty); + if (result == null) result = caseAbstractProperty(untilProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.RELEASE_PROPERTY: { + ReleaseProperty releaseProperty = (ReleaseProperty)theEObject; + T1 result = caseReleaseProperty(releaseProperty); + if (result == null) result = caseTemporalProperty(releaseProperty); + if (result == null) result = caseAbstractProperty(releaseProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.NEGATION_TEMPORAL_PROPERTY: { + NegationTemporalProperty negationTemporalProperty = (NegationTemporalProperty)theEObject; + T1 result = caseNegationTemporalProperty(negationTemporalProperty); + if (result == null) result = caseTemporalProperty(negationTemporalProperty); + if (result == null) result = caseAbstractProperty(negationTemporalProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } case PropertyPackage.PROPERTY: { Property property = (Property)theEObject; T1 result = caseProperty(property); + if (result == null) result = caseAbstractProperty(property); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.PROPERTY_REFERENCE: { + PropertyReference propertyReference = (PropertyReference)theEObject; + T1 result = casePropertyReference(propertyReference); + if (result == null) result = caseProperty(propertyReference); + if (result == null) result = caseAbstractProperty(propertyReference); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.COMPOSITE_PROPERTY: { - CompositeProperty compositeProperty = (CompositeProperty)theEObject; + CompositeProperty compositeProperty = (CompositeProperty)theEObject; T1 result = caseCompositeProperty(compositeProperty); if (result == null) result = caseProperty(compositeProperty); + if (result == null) result = caseAbstractProperty(compositeProperty); if (result == null) result = defaultCase(theEObject); return result; } case PropertyPackage.EVENT_PRECONDITION: { - EventPrecondition eventPrecondition = (EventPrecondition)theEObject; + EventPrecondition eventPrecondition = (EventPrecondition)theEObject; T1 result = caseEventPrecondition(eventPrecondition); if (result == null) result = caseProperty(eventPrecondition); + if (result == null) result = caseAbstractProperty(eventPrecondition); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.STEP_PROPERTY: { + StepProperty stepProperty = (StepProperty)theEObject; + T1 result = caseStepProperty(stepProperty); + if (result == null) result = caseProperty(stepProperty); + if (result == null) result = caseAbstractProperty(stepProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -90,6 +155,16 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { StateProperty stateProperty = (StateProperty)theEObject; T1 result = caseStateProperty(stateProperty); if (result == null) result = caseProperty(stateProperty); + if (result == null) result = caseAbstractProperty(stateProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PropertyPackage.UNARY_PROPERTY: { + UnaryProperty unaryProperty = (UnaryProperty)theEObject; + T1 result = caseUnaryProperty(unaryProperty); + if (result == null) result = caseStateProperty(unaryProperty); + if (result == null) result = caseProperty(unaryProperty); + if (result == null) result = caseAbstractProperty(unaryProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -98,6 +173,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseBinaryProperty(binaryProperty); if (result == null) result = caseStateProperty(binaryProperty); if (result == null) result = caseProperty(binaryProperty); + if (result == null) result = caseAbstractProperty(binaryProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -106,6 +182,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseManyReferenceProperty(manyReferenceProperty); if (result == null) result = caseStateProperty(manyReferenceProperty); if (result == null) result = caseProperty(manyReferenceProperty); + if (result == null) result = caseAbstractProperty(manyReferenceProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -114,6 +191,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseSingleReferenceProperty(singleReferenceProperty); if (result == null) result = caseStateProperty(singleReferenceProperty); if (result == null) result = caseProperty(singleReferenceProperty); + if (result == null) result = caseAbstractProperty(singleReferenceProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -122,6 +200,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseContainerReferenceProperty(containerReferenceProperty); if (result == null) result = caseStateProperty(containerReferenceProperty); if (result == null) result = caseProperty(containerReferenceProperty); + if (result == null) result = caseAbstractProperty(containerReferenceProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -130,6 +209,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseManyBooleanAttributeProperty(manyBooleanAttributeProperty); if (result == null) result = caseStateProperty(manyBooleanAttributeProperty); if (result == null) result = caseProperty(manyBooleanAttributeProperty); + if (result == null) result = caseAbstractProperty(manyBooleanAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -138,6 +218,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseManyIntegerAttributeProperty(manyIntegerAttributeProperty); if (result == null) result = caseStateProperty(manyIntegerAttributeProperty); if (result == null) result = caseProperty(manyIntegerAttributeProperty); + if (result == null) result = caseAbstractProperty(manyIntegerAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -146,6 +227,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseManyStringAttributeProperty(manyStringAttributeProperty); if (result == null) result = caseStateProperty(manyStringAttributeProperty); if (result == null) result = caseProperty(manyStringAttributeProperty); + if (result == null) result = caseAbstractProperty(manyStringAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -154,6 +236,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseBooleanAttributeProperty(booleanAttributeProperty); if (result == null) result = caseStateProperty(booleanAttributeProperty); if (result == null) result = caseProperty(booleanAttributeProperty); + if (result == null) result = caseAbstractProperty(booleanAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -162,6 +245,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseIntegerAttributeProperty(integerAttributeProperty); if (result == null) result = caseStateProperty(integerAttributeProperty); if (result == null) result = caseProperty(integerAttributeProperty); + if (result == null) result = caseAbstractProperty(integerAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -170,20 +254,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { T1 result = caseStringAttributeProperty(stringAttributeProperty); if (result == null) result = caseStateProperty(stringAttributeProperty); if (result == null) result = caseProperty(stringAttributeProperty); - if (result == null) result = defaultCase(theEObject); - return result; - } - case PropertyPackage.STEP_PROPERTY: { - StepProperty stepProperty = (StepProperty)theEObject; - T1 result = caseStepProperty(stepProperty); - if (result == null) result = caseProperty(stepProperty); - if (result == null) result = defaultCase(theEObject); - return result; - } - case PropertyPackage.PROPERTY_REFERENCE: { - PropertyReference propertyReference = (PropertyReference)theEObject; - T1 result = casePropertyReference(propertyReference); - if (result == null) result = caseProperty(propertyReference); + if (result == null) result = caseAbstractProperty(stringAttributeProperty); if (result == null) result = defaultCase(theEObject); return result; } @@ -191,6 +262,96 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { } } + /** + * Returns the result of interpreting the object as an instance of 'Abstract 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 'Abstract Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseAbstractProperty(AbstractProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Temporal 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 'Temporal Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T1 caseTemporalProperty(TemporalProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Next 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 'Next Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    T1 caseNextProperty(NextProperty

    object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Until 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 'Until Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    T1 caseUntilProperty(UntilProperty

    object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Release 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 'Release Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    T1 caseReleaseProperty(ReleaseProperty

    object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Negation Temporal 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 'Negation Temporal Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    T1 caseNegationTemporalProperty(NegationTemporalProperty

    object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'State Property'. * @@ -206,6 +367,21 @@ public T1 caseStateProperty(StateProperty object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Unary 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 'Unary Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public

    , T> T1 caseUnaryProperty(UnaryProperty object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Binary Property'. * @@ -382,7 +558,7 @@ public T1 caseStepProperty(StepProperty object) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public T1 casePropertyReference(PropertyReference object) { + public

    T1 casePropertyReference(PropertyReference

    object) { return null; } @@ -412,7 +588,7 @@ public T1 caseProperty(Property object) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public T1 caseCompositeProperty(CompositeProperty object) { + public

    T1 caseCompositeProperty(CompositeProperty

    object) { return null; } @@ -427,7 +603,7 @@ public T1 caseCompositeProperty(CompositeProperty object) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public T1 caseEventPrecondition(EventPrecondition object) { + public > T1 caseEventPrecondition(EventPrecondition object) { return null; } diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java index aee6675f0..1c9b70945 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java @@ -85,6 +85,8 @@ public EventManagerRenderer() { sendButton.setOnAction(e -> { pushedEvents.forEach(eventManager::sendEvent); + eventTypeToEventTableView.values().forEach(t -> t.getSelectionModel().clearSelection()); +// eventTypeToSelectedEvents.forEach((k,v) -> v.clear()); pushedEvents.clear(); }); diff --git a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java index bdbc014da..c32b28d14 100644 --- a/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java +++ b/framework/execution_framework/plugins/org.gemoc.executionframework.eventmanager/src/org/gemoc/executionframework/eventmanager/views/EventTableView.java @@ -133,7 +133,6 @@ public void refreshEvents() { final List toRemove = events.stream().filter(event -> !canDisplayEventFunction.apply(event)) .collect(Collectors.toList()); - events.removeAll(toRemove); events.addAll(newEvents); }); From 87f8a49b70f685f2a6e21e6b98426f123a9a40a0 Mon Sep 17 00:00:00 2001 From: d-leroy Date: Mon, 24 Jul 2017 16:38:46 +0200 Subject: [PATCH 23/31] [Scenario metamodel] changed from tree to graph structure --- .../META-INF/MANIFEST.MF | 2 +- .../plugin.properties | 1 + .../provider/ScenarioElementItemProvider.java | 49 +++- .../META-INF/MANIFEST.MF | 2 +- .../presentation/ScenarioModelWizard.java | 3 +- .../model/property.ecore | 203 +++++++-------- .../model/scenario.ecore | 233 ++++++++++-------- .../model/scenario/ScenarioElement.java | 27 +- .../model/scenario/ScenarioPackage.java | 64 ++++- .../scenario/impl/ScenarioElementImpl.java | 60 ++++- .../scenario/impl/ScenarioPackageImpl.java | 20 +- 11 files changed, 435 insertions(+), 229 deletions(-) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/META-INF/MANIFEST.MF index c870d2512..7a78202b4 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.gemoc.event.commons.model.edit;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: org.eclipse.gemoc.event.commons.model.arbiter.provider.ArbiterEditPlugin$Implementation +Bundle-Activator: org.eclipse.gemoc.event.commons.model.scenario.provider.ScenarioEditPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/plugin.properties b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/plugin.properties index 54a8e6ca1..976e33e89 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/plugin.properties +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/plugin.properties @@ -152,3 +152,4 @@ _UI_EventReport_event_feature = Event _UI_EventReport_matches_feature = Matches _UI_EventReport_target_feature = Target _UI_EventReport_time_feature = Time +_UI_ScenarioElement_previousElements_feature = Previous Elements diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/src/org/eclipse/gemoc/event/commons/model/scenario/provider/ScenarioElementItemProvider.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/src/org/eclipse/gemoc/event/commons/model/scenario/provider/ScenarioElementItemProvider.java index 030349991..fa79f9ead 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/src/org/eclipse/gemoc/event/commons/model/scenario/provider/ScenarioElementItemProvider.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/src/org/eclipse/gemoc/event/commons/model/scenario/provider/ScenarioElementItemProvider.java @@ -13,6 +13,7 @@ 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; @@ -62,10 +63,56 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + addPreviousElementsPropertyDescriptor(object); + addNextElementsPropertyDescriptor(object); } return itemPropertyDescriptors; } + /** + * This adds a property descriptor for the Previous Elements feature. + * + * + * @generated + */ + protected void addPreviousElementsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioElement_previousElements_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioElement_previousElements_feature", "_UI_ScenarioElement_type"), + ScenarioPackage.Literals.SCENARIO_ELEMENT__PREVIOUS_ELEMENTS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Next Elements feature. + * + * + * @generated + */ + protected void addNextElementsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ScenarioElement_nextElements_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ScenarioElement_nextElements_feature", "_UI_ScenarioElement_type"), + ScenarioPackage.Literals.SCENARIO_ELEMENT__NEXT_ELEMENTS, + true, + false, + true, + null, + 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 @@ -78,7 +125,6 @@ public List getPropertyDescriptors(Object object) { public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(ScenarioPackage.Literals.SCENARIO_ELEMENT__NEXT_ELEMENTS); childrenFeatures.add(ScenarioPackage.Literals.SCENARIO_ELEMENT__GUARD); } return childrenFeatures; @@ -121,7 +167,6 @@ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ScenarioElement.class)) { - case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: case ScenarioPackage.SCENARIO_ELEMENT__GUARD: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/META-INF/MANIFEST.MF index 1438630c7..02ad672e0 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.gemoc.event.commons.model.editor;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: org.eclipse.gemoc.event.commons.model.report.presentation.ReportEditorPlugin$Implementation +Bundle-Activator: org.eclipse.gemoc.event.commons.model.scenario.presentation.ScenarioEditorPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/src/org/eclipse/gemoc/event/commons/model/scenario/presentation/ScenarioModelWizard.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/src/org/eclipse/gemoc/event/commons/model/scenario/presentation/ScenarioModelWizard.java index 7be3050ce..d626520ff 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/src/org/eclipse/gemoc/event/commons/model/scenario/presentation/ScenarioModelWizard.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/src/org/eclipse/gemoc/event/commons/model/scenario/presentation/ScenarioModelWizard.java @@ -395,8 +395,7 @@ public ScenarioModelWizardInitialObjectCreationPage(String pageId) { * @generated */ public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - { + Composite composite = new Composite(parent, SWT.NONE); { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore index 1a25e6569..4b3ebca5b 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore @@ -1,221 +1,232 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - + - + + - + - + - - + + + + - - + + + - + - + + + - + - + - - - - - - + + + + + + - + - + - + - + - - + + - + - - + + - - - + + + - + - + - - + + - + - + - - + + - - - - - + + + + + + + - - - - - + + + + + + + - - - - - + + + + + + + - - - - + + + + + + - - - - + + + + + + - - - - + + + + + + diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/scenario.ecore b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/scenario.ecore index b0a1ff4b7..d08971639 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/scenario.ecore +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/scenario.ecore @@ -1,23 +1,20 @@ - + - + - - + + - - - + + + @@ -27,221 +24,241 @@ - + - - + + - - + + + - + - - + + - + - + + + - + + + + - - - + + - + + + - - - + + + + + + + + - + - + + + - + - - - + + + - - - + + + - - + + - + - + - - + + - - - + + + + + - + - + - + + + + - - + + - - + + - - + + + - + - + + + + - - + + - - + + - - + + + - - - + + + - - - + + + - - + + - - + + - + - + + + + - - + + + - - + + - - + + + + + - - + + + - - - + + + - - + + - + + + + - - + + - - + + - diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioElement.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioElement.java index d6e47b2f3..5dec06500 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioElement.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioElement.java @@ -17,6 +17,7 @@ * The following features are supported: *

    *
      + *
    • {@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getPreviousElements Previous Elements}
    • *
    • {@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getNextElements Next Elements}
    • *
    • {@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getGuard Guard}
    • *
    @@ -27,17 +28,37 @@ */ public interface ScenarioElement

    extends EObject { /** - * Returns the value of the 'Next Elements' containment reference list. + * Returns the value of the 'Previous Elements' reference list. * The list contents are of type {@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement}<P>. + * It is bidirectional and its opposite is '{@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getNextElements Next Elements}'. + * + *

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

    + * + * @return the value of the 'Previous Elements' reference list. + * @see org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage#getScenarioElement_PreviousElements() + * @see org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getNextElements + * @model opposite="nextElements" + * @generated + */ + EList> getPreviousElements(); + + /** + * Returns the value of the 'Next Elements' reference list. + * The list contents are of type {@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement}<P>. + * It is bidirectional and its opposite is '{@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getPreviousElements Previous Elements}'. * *

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

    * - * @return the value of the 'Next Elements' containment reference list. + * @return the value of the 'Next Elements' reference list. * @see org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage#getScenarioElement_NextElements() - * @model containment="true" + * @see org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getPreviousElements + * @model opposite="previousElements" * @generated */ EList> getNextElements(); diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioPackage.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioPackage.java index ae3435106..45379586a 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioPackage.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioPackage.java @@ -244,13 +244,22 @@ public interface ScenarioPackage extends EPackage { int SCENARIO_ELEMENT = 6; /** - * The feature id for the 'Next Elements' containment reference list. + * The feature id for the 'Previous Elements' reference list. * * * @generated * @ordered */ - int SCENARIO_ELEMENT__NEXT_ELEMENTS = 0; + int SCENARIO_ELEMENT__PREVIOUS_ELEMENTS = 0; + + /** + * The feature id for the 'Next Elements' reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO_ELEMENT__NEXT_ELEMENTS = 1; /** * The feature id for the 'Guard' containment reference. @@ -259,7 +268,7 @@ public interface ScenarioPackage extends EPackage { * @generated * @ordered */ - int SCENARIO_ELEMENT__GUARD = 1; + int SCENARIO_ELEMENT__GUARD = 2; /** * The number of structural features of the 'Element' class. @@ -268,7 +277,7 @@ public interface ScenarioPackage extends EPackage { * @generated * @ordered */ - int SCENARIO_ELEMENT_FEATURE_COUNT = 2; + int SCENARIO_ELEMENT_FEATURE_COUNT = 3; /** * The number of operations of the 'Element' class. @@ -290,7 +299,16 @@ public interface ScenarioPackage extends EPackage { int EVENT_OCCURRENCE = 5; /** - * The feature id for the 'Next Elements' containment reference list. + * The feature id for the 'Previous Elements' reference list. + * + * + * @generated + * @ordered + */ + int EVENT_OCCURRENCE__PREVIOUS_ELEMENTS = SCENARIO_ELEMENT__PREVIOUS_ELEMENTS; + + /** + * The feature id for the 'Next Elements' reference list. * * * @generated @@ -354,7 +372,16 @@ public interface ScenarioPackage extends EPackage { int SCENARIO_FSM = 7; /** - * The feature id for the 'Next Elements' containment reference list. + * The feature id for the 'Previous Elements' reference list. + * + * + * @generated + * @ordered + */ + int SCENARIO_FSM__PREVIOUS_ELEMENTS = SCENARIO_ELEMENT__PREVIOUS_ELEMENTS; + + /** + * The feature id for the 'Next Elements' reference list. * * * @generated @@ -911,10 +938,21 @@ public interface ScenarioPackage extends EPackage { EClass getScenarioElement(); /** - * Returns the meta object for the containment reference list '{@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getNextElements Next Elements}'. + * Returns the meta object for the reference list '{@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getPreviousElements Previous Elements}'. * * - * @return the meta object for the containment reference list 'Next Elements'. + * @return the meta object for the reference list 'Previous Elements'. + * @see org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getPreviousElements() + * @see #getScenarioElement() + * @generated + */ + EReference getScenarioElement_PreviousElements(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getNextElements Next Elements}'. + * + * + * @return the meta object for the reference list 'Next Elements'. * @see org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getNextElements() * @see #getScenarioElement() * @generated @@ -1430,7 +1468,15 @@ interface Literals { EClass SCENARIO_ELEMENT = eINSTANCE.getScenarioElement(); /** - * The meta object literal for the 'Next Elements' containment reference list feature. + * The meta object literal for the 'Previous Elements' reference list feature. + * + * + * @generated + */ + EReference SCENARIO_ELEMENT__PREVIOUS_ELEMENTS = eINSTANCE.getScenarioElement_PreviousElements(); + + /** + * The meta object literal for the 'Next Elements' reference list feature. * * * @generated diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioElementImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioElementImpl.java index b169c87f7..fb79f0930 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioElementImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioElementImpl.java @@ -14,8 +14,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.gemoc.event.commons.model.property.Property; @@ -31,6 +30,7 @@ * The following features are implemented: *

    *
      + *
    • {@link org.eclipse.gemoc.event.commons.model.scenario.impl.ScenarioElementImpl#getPreviousElements Previous Elements}
    • *
    • {@link org.eclipse.gemoc.event.commons.model.scenario.impl.ScenarioElementImpl#getNextElements Next Elements}
    • *
    • {@link org.eclipse.gemoc.event.commons.model.scenario.impl.ScenarioElementImpl#getGuard Guard}
    • *
    @@ -39,7 +39,17 @@ */ public abstract class ScenarioElementImpl

    extends MinimalEObjectImpl.Container implements ScenarioElement

    { /** - * The cached value of the '{@link #getNextElements() Next Elements}' containment reference list. + * The cached value of the '{@link #getPreviousElements() Previous Elements}' reference list. + * + * + * @see #getPreviousElements() + * @generated + * @ordered + */ + protected EList> previousElements; + + /** + * The cached value of the '{@link #getNextElements() Next Elements}' reference list. * * * @see #getNextElements() @@ -77,6 +87,18 @@ protected EClass eStaticClass() { return ScenarioPackage.Literals.SCENARIO_ELEMENT; } + /** + * + * + * @generated + */ + public EList> getPreviousElements() { + if (previousElements == null) { + previousElements = new EObjectWithInverseResolvingEList.ManyInverse>(ScenarioElement.class, this, ScenarioPackage.SCENARIO_ELEMENT__PREVIOUS_ELEMENTS, ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS); + } + return previousElements; + } + /** * * @@ -84,7 +106,7 @@ protected EClass eStaticClass() { */ public EList> getNextElements() { if (nextElements == null) { - nextElements = new EObjectContainmentEList>(ScenarioElement.class, this, ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS); + nextElements = new EObjectWithInverseResolvingEList.ManyInverse>(ScenarioElement.class, this, ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS, ScenarioPackage.SCENARIO_ELEMENT__PREVIOUS_ELEMENTS); } return nextElements; } @@ -132,6 +154,23 @@ else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.SCENARIO_ELEMENT__GUARD, newGuard, newGuard)); } + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__PREVIOUS_ELEMENTS: + return ((InternalEList)(InternalEList)getPreviousElements()).basicAdd(otherEnd, msgs); + case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: + return ((InternalEList)(InternalEList)getNextElements()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + /** * * @@ -140,6 +179,8 @@ else if (eNotificationRequired()) @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__PREVIOUS_ELEMENTS: + return ((InternalEList)getPreviousElements()).basicRemove(otherEnd, msgs); case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: return ((InternalEList)getNextElements()).basicRemove(otherEnd, msgs); case ScenarioPackage.SCENARIO_ELEMENT__GUARD: @@ -156,6 +197,8 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__PREVIOUS_ELEMENTS: + return getPreviousElements(); case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: return getNextElements(); case ScenarioPackage.SCENARIO_ELEMENT__GUARD: @@ -173,6 +216,10 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__PREVIOUS_ELEMENTS: + getPreviousElements().clear(); + getPreviousElements().addAll((Collection>)newValue); + return; case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: getNextElements().clear(); getNextElements().addAll((Collection>)newValue); @@ -192,6 +239,9 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__PREVIOUS_ELEMENTS: + getPreviousElements().clear(); + return; case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: getNextElements().clear(); return; @@ -210,6 +260,8 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { + case ScenarioPackage.SCENARIO_ELEMENT__PREVIOUS_ELEMENTS: + return previousElements != null && !previousElements.isEmpty(); case ScenarioPackage.SCENARIO_ELEMENT__NEXT_ELEMENTS: return nextElements != null && !nextElements.isEmpty(); case ScenarioPackage.SCENARIO_ELEMENT__GUARD: diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioPackageImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioPackageImpl.java index 95c8ddd78..a497fbe1b 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioPackageImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioPackageImpl.java @@ -326,7 +326,7 @@ public EClass getScenarioElement() { * * @generated */ - public EReference getScenarioElement_NextElements() { + public EReference getScenarioElement_PreviousElements() { return (EReference)scenarioElementEClass.getEStructuralFeatures().get(0); } @@ -335,10 +335,19 @@ public EReference getScenarioElement_NextElements() { * * @generated */ - public EReference getScenarioElement_Guard() { + public EReference getScenarioElement_NextElements() { return (EReference)scenarioElementEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + public EReference getScenarioElement_Guard() { + return (EReference)scenarioElementEClass.getEStructuralFeatures().get(2); + } + /** * * @@ -683,6 +692,7 @@ public void createPackageContents() { createEAttribute(eventOccurrenceEClass, EVENT_OCCURRENCE__TIME); scenarioElementEClass = createEClass(SCENARIO_ELEMENT); + createEReference(scenarioElementEClass, SCENARIO_ELEMENT__PREVIOUS_ELEMENTS); createEReference(scenarioElementEClass, SCENARIO_ELEMENT__NEXT_ELEMENTS); createEReference(scenarioElementEClass, SCENARIO_ELEMENT__GUARD); @@ -912,7 +922,11 @@ public void initializePackageContents() { g1 = createEGenericType(this.getScenarioElement()); g2 = createEGenericType(scenarioElementEClass_P); g1.getETypeArguments().add(g2); - initEReference(getScenarioElement_NextElements(), g1, null, "nextElements", null, 0, -1, ScenarioElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getScenarioElement_PreviousElements(), g1, this.getScenarioElement_NextElements(), "previousElements", null, 0, -1, ScenarioElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + g1 = createEGenericType(this.getScenarioElement()); + g2 = createEGenericType(scenarioElementEClass_P); + g1.getETypeArguments().add(g2); + initEReference(getScenarioElement_NextElements(), g1, this.getScenarioElement_PreviousElements(), "nextElements", null, 0, -1, ScenarioElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(scenarioElementEClass_P); initEReference(getScenarioElement_Guard(), g1, null, "guard", null, 0, 1, ScenarioElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); From 6d06137aece8a64887fa36b07b3d4e3ccddf84bd Mon Sep 17 00:00:00 2001 From: d-leroy Date: Mon, 24 Jul 2017 17:08:56 +0200 Subject: [PATCH 24/31] [jdom] updated manifests to use correct jdom version --- .../META-INF/MANIFEST.MF | 3 +-- .../META-INF/MANIFEST.MF | 3 ++- .../ide/ui/builder/GemocSequentialLanguageBuilder.java | 2 -- .../org.eclipse.gemoc.trace.commons/META-INF/MANIFEST.MF | 4 +--- .../src/org/eclipse/gemoc/trace/commons/PluginXMLHelper.java | 1 - .../META-INF/MANIFEST.MF | 3 ++- .../gemoc/generator/GenericEngineTraceAddonGenerator.xtend | 2 +- 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.ide.ui/META-INF/MANIFEST.MF b/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.ide.ui/META-INF/MANIFEST.MF index 5d063052b..9522801f7 100644 --- a/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.ide.ui/META-INF/MANIFEST.MF +++ b/framework/xdsml_framework/plugins/org.eclipse.gemoc.xdsmlframework.ide.ui/META-INF/MANIFEST.MF @@ -31,6 +31,5 @@ Export-Package: org.eclipse.gemoc.xdsmlframework.ide.ui, org.eclipse.gemoc.xdsmlframework.ide.ui.builder.pde, org.eclipse.gemoc.xdsmlframework.ide.ui.commands, org.eclipse.gemoc.xdsmlframework.ide.ui.xdsml.wizards, - org.eclipse.gemoc.xdsmlframework.ide.ui.xdsml.wizards.pages, - org.jdom2 + org.eclipse.gemoc.xdsmlframework.ide.ui.xdsml.wizards.pages diff --git a/java_execution/java_xdsml/plugins/org.eclipse.gemoc.execution.sequential.javaxdsml.ide.ui/META-INF/MANIFEST.MF b/java_execution/java_xdsml/plugins/org.eclipse.gemoc.execution.sequential.javaxdsml.ide.ui/META-INF/MANIFEST.MF index 4b5a4909c..92c5935e8 100644 --- a/java_execution/java_xdsml/plugins/org.eclipse.gemoc.execution.sequential.javaxdsml.ide.ui/META-INF/MANIFEST.MF +++ b/java_execution/java_xdsml/plugins/org.eclipse.gemoc.execution.sequential.javaxdsml.ide.ui/META-INF/MANIFEST.MF @@ -27,7 +27,8 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.xtext.ui, org.eclipse.gemoc.xdsmlframework.ui.utils, org.eclipse.emf.ecoretools.design.ui, - org.eclipse.gemoc.commons.eclipse.pde + org.eclipse.gemoc.commons.eclipse.pde, + org.jdom2;bundle-version="2.0.6" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-ClassPath: . diff --git a/java_execution/java_xdsml/plugins/org.eclipse.gemoc.execution.sequential.javaxdsml.ide.ui/src/org/eclipse/gemoc/execution/sequential/javaxdsml/ide/ui/builder/GemocSequentialLanguageBuilder.java b/java_execution/java_xdsml/plugins/org.eclipse.gemoc.execution.sequential.javaxdsml.ide.ui/src/org/eclipse/gemoc/execution/sequential/javaxdsml/ide/ui/builder/GemocSequentialLanguageBuilder.java index d2590ecce..448d8c9cd 100644 --- a/java_execution/java_xdsml/plugins/org.eclipse.gemoc.execution.sequential.javaxdsml.ide.ui/src/org/eclipse/gemoc/execution/sequential/javaxdsml/ide/ui/builder/GemocSequentialLanguageBuilder.java +++ b/java_execution/java_xdsml/plugins/org.eclipse.gemoc.execution.sequential.javaxdsml.ide.ui/src/org/eclipse/gemoc/execution/sequential/javaxdsml/ide/ui/builder/GemocSequentialLanguageBuilder.java @@ -162,8 +162,6 @@ protected void updateModelLoaderClass(IProject project, String modelLoaderClass) LanguageDefinitionExtensionPoint.GEMOC_LANGUAGE_EXTENSION_POINT_XDSML_DEF_LOADMODEL_ATT, modelLoaderClass != null ? modelLoaderClass : "org.eclipse.gemoc.executionframework.extensions.sirius.modelloader.DefaultModelLoader"); helper.saveDocument(pluginfile); - - } protected void setPluginLanguageNameAndFilePath(IProject project, IFile melangeFile , final String languageName) { diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons/META-INF/MANIFEST.MF b/trace/commons/plugins/org.eclipse.gemoc.trace.commons/META-INF/MANIFEST.MF index bbc2baa06..94d01de83 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons/META-INF/MANIFEST.MF +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons/META-INF/MANIFEST.MF @@ -4,9 +4,7 @@ Bundle-Name: Util Bundle-SymbolicName: org.eclipse.gemoc.trace.commons Bundle-Version: 2.3.0.qualifier Export-Package: org.eclipse.gemoc.trace.commons, - org.eclipse.gemoc.trace.commons.tracemetamodel, - org.jdom2, - org.jdom2.filter + org.eclipse.gemoc.trace.commons.tracemetamodel Require-Bundle: com.google.guava, org.eclipse.xtext.xbase.lib, org.eclipse.xtend.lib, diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons/src/org/eclipse/gemoc/trace/commons/PluginXMLHelper.java b/trace/commons/plugins/org.eclipse.gemoc.trace.commons/src/org/eclipse/gemoc/trace/commons/PluginXMLHelper.java index c00f997eb..371bb1c03 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons/src/org/eclipse/gemoc/trace/commons/PluginXMLHelper.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons/src/org/eclipse/gemoc/trace/commons/PluginXMLHelper.java @@ -92,7 +92,6 @@ public void saveDocument(IFile pluginXmlFile) { } } - public Element getOrCreateExtensionPoint(String extensionPointName){ Element result; List elements = root.getContent(new ExtensionFilter(extensionPointName)); diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc.generator/META-INF/MANIFEST.MF b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc.generator/META-INF/MANIFEST.MF index 0652f66ea..601479fa6 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc.generator/META-INF/MANIFEST.MF +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc.generator/META-INF/MANIFEST.MF @@ -22,7 +22,8 @@ Require-Bundle: com.google.guava, org.eclipse.jdt.ui, org.eclipse.gemoc.xdsmlframework.api, org.eclipse.gemoc.opsemanticsview.model;bundle-version="0.1.0", - org.eclipse.gemoc.opsemanticsview.gen;bundle-version="1.0.0" + org.eclipse.gemoc.opsemanticsview.gen;bundle-version="1.0.0", + org.jdom2;bundle-version="2.0.6" Bundle-ClassPath: . Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.eclipse.gemoc.trace.gemoc.generator, diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc.generator/src/org/eclipse/gemoc/trace/gemoc/generator/GenericEngineTraceAddonGenerator.xtend b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc.generator/src/org/eclipse/gemoc/trace/gemoc/generator/GenericEngineTraceAddonGenerator.xtend index f4892376b..bb339286f 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc.generator/src/org/eclipse/gemoc/trace/gemoc/generator/GenericEngineTraceAddonGenerator.xtend +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc.generator/src/org/eclipse/gemoc/trace/gemoc/generator/GenericEngineTraceAddonGenerator.xtend @@ -14,7 +14,6 @@ import org.eclipse.gemoc.trace.commons.CodeGenUtil import org.eclipse.gemoc.trace.commons.EclipseUtil import org.eclipse.gemoc.trace.commons.EcoreCraftingUtil import org.eclipse.gemoc.trace.commons.ManifestUtil -import org.eclipse.gemoc.trace.commons.PluginXMLHelper import org.eclipse.gemoc.trace.gemoc.generator.codegen.StateManagerGeneratorJava import org.eclipse.gemoc.trace.gemoc.generator.codegen.TraceConstructorGeneratorJava import org.eclipse.gemoc.trace.gemoc.generator.util.StandaloneEMFProjectGenerator @@ -42,6 +41,7 @@ import org.eclipse.xtend.lib.annotations.Accessors import org.eclipse.gemoc.xdsmlframework.api.extensions.engine_addon.EngineAddonSpecificationExtensionPoint import org.jdom2.Element import org.jdom2.filter.ElementFilter +import org.eclipse.gemoc.xdsmlframework.ide.ui.builder.pde.PluginXMLHelper class GenericEngineTraceAddonGenerator { From 975057f106207ecf0ee5938040ca4ea7f457e162 Mon Sep 17 00:00:00 2001 From: d-leroy Date: Tue, 25 Jul 2017 14:37:04 +0200 Subject: [PATCH 25/31] [Property Monitor] use default engine addon --- .../interpreter/property/PropertyMonitor.java | 51 ++----------------- 1 file changed, 3 insertions(+), 48 deletions(-) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java index 16731fa6c..e7de7d6c2 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java @@ -1,8 +1,6 @@ package org.eclipse.gemoc.event.commons.interpreter.property; import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -18,10 +16,6 @@ import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; -import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; -import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; - import org.eclipse.gemoc.event.commons.interpreter.scenario.ElementProviderAspect; import org.eclipse.gemoc.event.commons.model.EventInstance; import org.eclipse.gemoc.event.commons.model.IEventManager; @@ -37,8 +31,10 @@ import org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage; import org.eclipse.gemoc.trace.commons.model.trace.MSE; import org.eclipse.gemoc.trace.commons.model.trace.Step; +import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; +import org.eclipse.gemoc.xdsmlframework.api.engine_addon.DefaultEngineAddon; -public class PropertyMonitor implements IEngineAddon, IPropertyMonitor { +public class PropertyMonitor extends DefaultEngineAddon implements IPropertyMonitor { private Resource executedModel; @@ -189,47 +185,6 @@ public void engineAboutToStart(IExecutionEngine engine) { eventManager = engine.getAddonsTypedBy(IEventManager.class).stream().findFirst().orElse(null); eventManagerAvailable = eventManager != null; } - - @Override - public void engineInitialized(IExecutionEngine engine) { - } - - @Override - public void engineStarted(IExecutionEngine engine) { - } - - @Override - public void engineAboutToStop(IExecutionEngine engine) { - } - - @Override - public void engineStopped(IExecutionEngine engine) { - } - - @Override - public void engineAboutToDispose(IExecutionEngine engine) { - } - - @Override - public void aboutToSelectStep(IExecutionEngine engine, Collection> steps) { - } - - @Override - public void proposedStepsChanged(IExecutionEngine engine, Collection> steps) { - } - - @Override - public void stepSelected(IExecutionEngine engine, Step selectedStep) { - } - - @Override - public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { - } - - @Override - public List validate(List otherAddons) { - return Collections.emptyList(); - } private EventInstance createEvent(Event originalEvent) { final ElementProvider targetProvider = originalEvent.getTargetProvider(); From 9d19ed9fdb05ddd2fac4d52c511a0179298d87f1 Mon Sep 17 00:00:00 2001 From: d-leroy Date: Tue, 25 Jul 2017 15:45:14 +0200 Subject: [PATCH 26/31] [Event Metamodel] target feature in event classes is now generated, not parameterized --- .../interpreter/property/PropertyMonitor.java | 49 +++--- .../interpreter/scenario/ScenarioManager.java | 65 ++++---- .../META-INF/MANIFEST.MF | 2 +- .../scenario/provider/EventItemProvider.java | 42 ------ .../META-INF/MANIFEST.MF | 2 +- .../presentation/ScenarioModelWizard.java | 3 +- .../model/property.ecore | 1 - .../model/report.ecore | 23 +-- .../model/scenario.ecore | 21 +-- .../event/commons/model/EventInstance.java | 6 +- .../model/property/EventPrecondition.java | 2 +- .../model/property/PropertyFactory.java | 2 +- .../property/impl/EventPreconditionImpl.java | 2 +- .../property/impl/PropertyFactoryImpl.java | 2 +- .../property/impl/PropertyPackageImpl.java | 4 +- .../property/util/PropertyAdapterFactory.java | 2 +- .../model/property/util/PropertySwitch.java | 2 +- .../commons/model/report/EventReport.java | 4 +- .../model/report/impl/EventReportImpl.java | 16 +- .../model/report/impl/ReportPackageImpl.java | 6 +- .../event/commons/model/scenario/Event.java | 34 +---- .../model/scenario/EventOccurrence.java | 2 +- .../model/scenario/ScenarioElement.java | 2 +- .../commons/model/scenario/ScenarioFSM.java | 2 +- .../model/scenario/ScenarioFSMState.java | 2 +- .../model/scenario/ScenarioPackage.java | 30 +--- .../model/scenario/impl/EventImpl.java | 140 +----------------- .../scenario/impl/EventOccurrenceImpl.java | 2 +- .../scenario/impl/ScenarioElementImpl.java | 1 + .../model/scenario/impl/ScenarioFSMImpl.java | 2 +- .../scenario/impl/ScenarioFSMStateImpl.java | 2 +- .../scenario/impl/ScenarioPackageImpl.java | 21 --- .../scenario/util/ScenarioAdapterFactory.java | 8 +- .../model/scenario/util/ScenarioSwitch.java | 10 +- .../eventmanager/views/EventTableView.java | 12 +- 35 files changed, 109 insertions(+), 417 deletions(-) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java index e7de7d6c2..5394fc099 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java @@ -28,7 +28,6 @@ import org.eclipse.gemoc.event.commons.model.property.Stepping; import org.eclipse.gemoc.event.commons.model.scenario.ElementProvider; import org.eclipse.gemoc.event.commons.model.scenario.Event; -import org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage; import org.eclipse.gemoc.trace.commons.model.trace.MSE; import org.eclipse.gemoc.trace.commons.model.trace.Step; import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; @@ -47,11 +46,11 @@ public class PropertyMonitor extends DefaultEngineAddon implements IPropertyMoni private final Set endedSteps = new HashSet<>(); private final Set endingSteps = new HashSet<>(); - + private IEventManager eventManager; - + private boolean eventManagerAvailable = false; - + private boolean monitor(Property property) { if (property == null) { return true; @@ -60,7 +59,7 @@ private boolean monitor(Property property) { monitoredProperties.put(property, result); return result; } - + private boolean evaluateProperty(Property property) { boolean result = false; if (property instanceof StepProperty) { @@ -102,7 +101,7 @@ public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { endingSteps.add(stepExecuted.getMseoccurrence().getMse()); updateProperties(); } - + private boolean evaluateEventPrecondition(EventPrecondition property) { if (eventManagerAvailable) { final EventInstance eventInstance = createEvent(property.getEvent()); @@ -112,7 +111,8 @@ private boolean evaluateEventPrecondition(EventPrecondition property) { } private boolean evaluateCompositeProperty(CompositeProperty property) { - final List list = property.getProperties().stream().map(p -> evaluateProperty(p)).collect(Collectors.toList()); + final List list = property.getProperties().stream().map(p -> evaluateProperty(p)) + .collect(Collectors.toList()); return list.stream().allMatch(b -> b); } @@ -185,31 +185,22 @@ public void engineAboutToStart(IExecutionEngine engine) { eventManager = engine.getAddonsTypedBy(IEventManager.class).stream().findFirst().orElse(null); eventManagerAvailable = eventManager != null; } - - private EventInstance createEvent(Event originalEvent) { - final ElementProvider targetProvider = originalEvent.getTargetProvider(); + + private EventInstance createEvent(Event originalEvent) { final List eventParameterMatches = new ArrayList<>(); - if (targetProvider != null) { - final EObject target = ElementProviderAspect.resolve(targetProvider, executedModel); - if (target != null) { - eventParameterMatches.add(target); - final Map parameters = new HashMap<>(); - parameters.put(ScenarioPackage.Literals.EVENT__TARGET_PROVIDER, target); - for (EStructuralFeature f : originalEvent.eClass().getEStructuralFeatures()) { - if (f instanceof EAttribute) { - parameters.put(f, originalEvent.eGet(f)); - } else { - final ElementProvider paramProvider = (ElementProvider) originalEvent.eGet(f); - final EObject parameter = ElementProviderAspect.resolve(paramProvider, executedModel); - if (parameter != null) { - parameters.put(f, parameter); - eventParameterMatches.add(parameter); - } - } + final Map parameters = new HashMap<>(); + for (EStructuralFeature f : originalEvent.eClass().getEStructuralFeatures()) { + if (f instanceof EAttribute) { + parameters.put(f, originalEvent.eGet(f)); + } else { + final ElementProvider paramProvider = (ElementProvider) originalEvent.eGet(f); + final EObject parameter = ElementProviderAspect.resolve(paramProvider, executedModel); + if (parameter != null) { + parameters.put(f, parameter); + eventParameterMatches.add(parameter); } - return new EventInstance(originalEvent, parameters); } } - return null; + return new EventInstance(originalEvent, parameters); } } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ScenarioManager.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ScenarioManager.java index 199a5742d..e5026cfee 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ScenarioManager.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ScenarioManager.java @@ -20,7 +20,6 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.emf.transaction.impl.EMFCommandTransaction; import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; - import org.eclipse.gemoc.event.commons.interpreter.property.IPropertyListener; import org.eclipse.gemoc.event.commons.interpreter.property.IPropertyMonitor; import org.eclipse.gemoc.event.commons.model.EventInstance; @@ -40,7 +39,6 @@ import org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement; import org.eclipse.gemoc.event.commons.model.scenario.ScenarioFSM; import org.eclipse.gemoc.event.commons.model.scenario.ScenarioFSMState; -import org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage; public class ScenarioManager implements IScenarioManager { @@ -79,14 +77,14 @@ private void setupFSMStatePropertyListeners(ScenarioFSM fsm, Scenari final Map fsmGuards = new HashMap<>(); state.getOutgoingTransitions().forEach(t -> { final Property property = t.getGuard(); - final Event event = t.getTarget().getEvent(); + final Event event = t.getTarget().getEvent(); if (property != null && event != null) { // If the FSM state sends an event, we add the event // precondition to the guard of the transition by // using a composite property. final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); final PropertyReference propertyReference = propertyFactory.createPropertyReference(); - final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); propertyReference.setReferencedProperty(property); precondition.setEvent(event); compositeProperty.getProperties().add(propertyReference); @@ -97,7 +95,7 @@ private void setupFSMStatePropertyListeners(ScenarioFSM fsm, Scenari IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), property, fsmGuards); fsmGuards.put(property, listener); } else if (event != null) { - final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); precondition.setEvent(event); IPropertyListener listener = new FSMGuardListener(fsm, t.getTarget(), precondition, fsmGuards); fsmGuards.put(precondition, listener); @@ -117,7 +115,7 @@ private void setupFSMStatePropertyListeners(ScenarioFSM fsm, Scenari } private void handleEventOccurrence(EventOccurrence eventOccurrence) { - final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); precondition.setEvent((eventOccurrence).getEvent()); final Property property = eventOccurrence.getGuard(); if (property != null) { @@ -137,20 +135,20 @@ private void handleEventOccurrence(EventOccurrence eventOccurrence) { private void handleFSM(ScenarioFSM fsm) { final ScenarioFSMState initialState = fsm.getInitialState(); final Property property = fsm.getGuard(); - final Event event = initialState.getEvent(); + final Event event = initialState.getEvent(); if (event != null && property != null) { // We create a composite property containing // both the guard of the fsm and the event precondition final CompositeProperty compositeProperty = propertyFactory.createCompositeProperty(); final PropertyReference propertyReference = propertyFactory.createPropertyReference(); - final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); propertyReference.setReferencedProperty(property); precondition.setEvent(event); compositeProperty.getProperties().add(propertyReference); compositeProperty.getProperties().add(precondition); propertyMonitor.monitorProperty(compositeProperty, new ScenarioGuardListener(fsm, compositeProperty)); } else if (event != null) { - final EventPrecondition> precondition = propertyFactory.createEventPrecondition(); + final EventPrecondition precondition = propertyFactory.createEventPrecondition(); precondition.setEvent(event); propertyMonitor.monitorProperty(precondition, new ScenarioGuardListener(fsm, precondition)); } else if (property != null) { @@ -160,37 +158,28 @@ private void handleFSM(ScenarioFSM fsm) { } } - private EventInstance createEvent(Event originalEvent) { - final ElementProvider targetProvider = originalEvent.getTargetProvider(); + private EventInstance createEvent(Event originalEvent) { final List eventParameterMatches = new ArrayList<>(); - if (targetProvider != null) { - final EObject target = ElementProviderAspect.resolve(targetProvider, executedModel); - if (target != null) { - eventParameterMatches.add(target); - final Map parameters = new HashMap<>(); - parameters.put(ScenarioPackage.Literals.EVENT__TARGET_PROVIDER, target); - for (EStructuralFeature f : originalEvent.eClass().getEStructuralFeatures()) { - if (f instanceof EAttribute) { - parameters.put(f, originalEvent.eGet(f)); - } else { - final ElementProvider paramProvider = (ElementProvider) originalEvent.eGet(f); - final EObject parameter = ElementProviderAspect.resolve(paramProvider, executedModel); - if (parameter != null) { - parameters.put(f, parameter); - eventParameterMatches.add(parameter); - } - } - } - final EventReport eventReport = ReportFactory.eINSTANCE.createEventReport(); - if (eventParameterMatches.size() > 1) { - eventReport.getMatches().addAll(eventParameterMatches.subList(1, eventParameterMatches.size() - 1)); + final Map parameters = new HashMap<>(); + for (EStructuralFeature f : originalEvent.eClass().getEStructuralFeatures()) { + if (f instanceof EAttribute) { + parameters.put(f, originalEvent.eGet(f)); + } else { + final ElementProvider paramProvider = (ElementProvider) originalEvent.eGet(f); + final EObject parameter = ElementProviderAspect.resolve(paramProvider, executedModel); + if (parameter != null) { + parameters.put(f, parameter); + eventParameterMatches.add(parameter); } - eventReport.setEvent(originalEvent); - report.getEvents().add(eventReport); - return new EventInstance(originalEvent, parameters); } } - return null; + final EventReport eventReport = ReportFactory.eINSTANCE.createEventReport(); + if (eventParameterMatches.size() > 1) { + eventReport.getMatches().addAll(eventParameterMatches.subList(1, eventParameterMatches.size() - 1)); + } + eventReport.setEvent(originalEvent); + report.getEvents().add(eventReport); + return new EventInstance(originalEvent, parameters); } @Override @@ -259,7 +248,7 @@ public void update(boolean propertyValue) { // scenario tree yet because they must only be evaluated once the // FSM reaches an accepting state. final ScenarioFSM fsm = (ScenarioFSM) element; - final Event event = fsm.getInitialState().getEvent(); + final Event event = fsm.getInitialState().getEvent(); if (event != null) { eventManager.sendEvent(createEvent(event)); } @@ -290,7 +279,7 @@ public void update(boolean propertyValue) { // We send the event associated to the newly reached state of // the FSM, if any. We do not have to check if it can be sent // as this check is part of the guard of the incoming transition. - final Event event = state.getEvent(); + final Event event = state.getEvent(); if (event != null) { eventManager.sendEvent(createEvent(event)); } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/META-INF/MANIFEST.MF index 7a78202b4..0a450e2ea 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.gemoc.event.commons.model.edit;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: org.eclipse.gemoc.event.commons.model.scenario.provider.ScenarioEditPlugin$Implementation +Bundle-Activator: org.eclipse.gemoc.event.commons.model.report.provider.ReportEditPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/src/org/eclipse/gemoc/event/commons/model/scenario/provider/EventItemProvider.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/src/org/eclipse/gemoc/event/commons/model/scenario/provider/EventItemProvider.java index 85411ca1b..060792d29 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/src/org/eclipse/gemoc/event/commons/model/scenario/provider/EventItemProvider.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.edit/src/org/eclipse/gemoc/event/commons/model/scenario/provider/EventItemProvider.java @@ -11,8 +11,6 @@ import org.eclipse.emf.common.util.ResourceLocator; -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; @@ -20,10 +18,6 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; - -import org.eclipse.gemoc.event.commons.model.scenario.Event; -import org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage; /** * This is the item provider adapter for a {@link org.eclipse.gemoc.event.commons.model.scenario.Event} object. @@ -64,36 +58,6 @@ public List getPropertyDescriptors(Object 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(ScenarioPackage.Literals.EVENT__TARGET_PROVIDER); - } - 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 Event.gif. * @@ -127,12 +91,6 @@ public String getText(Object object) { @Override public void notifyChanged(Notification notification) { updateChildren(notification); - - switch (notification.getFeatureID(Event.class)) { - case ScenarioPackage.EVENT__TARGET_PROVIDER: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } super.notifyChanged(notification); } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/META-INF/MANIFEST.MF index 02ad672e0..1438630c7 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.gemoc.event.commons.model.editor;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . -Bundle-Activator: org.eclipse.gemoc.event.commons.model.scenario.presentation.ScenarioEditorPlugin$Implementation +Bundle-Activator: org.eclipse.gemoc.event.commons.model.report.presentation.ReportEditorPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/src/org/eclipse/gemoc/event/commons/model/scenario/presentation/ScenarioModelWizard.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/src/org/eclipse/gemoc/event/commons/model/scenario/presentation/ScenarioModelWizard.java index d626520ff..7be3050ce 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/src/org/eclipse/gemoc/event/commons/model/scenario/presentation/ScenarioModelWizard.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model.editor/src/org/eclipse/gemoc/event/commons/model/scenario/presentation/ScenarioModelWizard.java @@ -395,7 +395,8 @@ public ScenarioModelWizardInitialObjectCreationPage(String pageId) { * @generated */ public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); { + Composite composite = new Composite(parent, SWT.NONE); + { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore index 4b3ebca5b..474063e7e 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore @@ -60,7 +60,6 @@ - diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/report.ecore b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/report.ecore index b90c7e3e5..1e6a20631 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/report.ecore +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/report.ecore @@ -1,19 +1,20 @@ - + - + - - - + + + + + + + + + + - - - diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/scenario.ecore b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/scenario.ecore index d08971639..688db809a 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/scenario.ecore +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/scenario.ecore @@ -10,14 +10,7 @@ - - - - - - - - + @@ -47,9 +40,7 @@ - - - + @@ -93,9 +84,7 @@ - - - + @@ -130,9 +119,7 @@ - - - + diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventInstance.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventInstance.java index 5df1907b5..75eb9223b 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventInstance.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventInstance.java @@ -8,16 +8,16 @@ public class EventInstance { - private final Event originalEvent; + private final Event originalEvent; private final Map parameters; - public EventInstance(Event originalEvent, Map parameters) { + public EventInstance(Event originalEvent, Map parameters) { this.originalEvent = originalEvent; this.parameters = parameters; } - public Event getOriginalEvent() { + public Event getOriginalEvent() { return originalEvent; } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/EventPrecondition.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/EventPrecondition.java index 0976e3d9b..456f1a94e 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/EventPrecondition.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/EventPrecondition.java @@ -20,7 +20,7 @@ * @model * @generated */ -public interface EventPrecondition> extends Property { +public interface EventPrecondition extends Property { /** * Returns the value of the 'Event' reference. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/PropertyFactory.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/PropertyFactory.java index c8a7e5cc0..e182e3664 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/PropertyFactory.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/PropertyFactory.java @@ -57,7 +57,7 @@ public interface PropertyFactory extends EFactory { * @return a new object of class 'Event Precondition'. * @generated */ - > EventPrecondition createEventPrecondition(); + EventPrecondition createEventPrecondition(); /** * Returns a new object of class 'Container Reference Property'. diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/EventPreconditionImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/EventPreconditionImpl.java index 86443e7a4..bd155b134 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/EventPreconditionImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/EventPreconditionImpl.java @@ -27,7 +27,7 @@ * * @generated */ -public class EventPreconditionImpl> extends PropertyImpl implements EventPrecondition { +public class EventPreconditionImpl extends PropertyImpl implements EventPrecondition { /** * The cached value of the '{@link #getEvent() Event}' reference. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyFactoryImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyFactoryImpl.java index a9d47feb5..6088dfaad 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyFactoryImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyFactoryImpl.java @@ -153,7 +153,7 @@ public

    CompositeProperty

    createCompositeProperty() { * * @generated */ - public > EventPrecondition createEventPrecondition() { + public EventPrecondition createEventPrecondition() { EventPreconditionImpl eventPrecondition = new EventPreconditionImpl(); return eventPrecondition; } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyPackageImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyPackageImpl.java index 6ac831002..fad0d9c72 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyPackageImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyPackageImpl.java @@ -1100,11 +1100,9 @@ public void initializePackageContents() { g1 = createEGenericType(this.getProperty()); compositePropertyEClass_P.getEBounds().add(g1); g1 = createEGenericType(theScenarioPackage.getEvent()); - EGenericType g2 = createEGenericType(); - g1.getETypeArguments().add(g2); eventPreconditionEClass_E.getEBounds().add(g1); g1 = createEGenericType(this.getStateProperty()); - g2 = createEGenericType(); + EGenericType g2 = createEGenericType(); g1.getETypeArguments().add(g2); unaryPropertyEClass_P.getEBounds().add(g1); g1 = createEGenericType(this.getStateProperty()); diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertyAdapterFactory.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertyAdapterFactory.java index a60b454ee..2721d27cc 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertyAdapterFactory.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertyAdapterFactory.java @@ -106,7 +106,7 @@ public

    Adapter caseCompositeProperty(CompositeProperty

    o return createCompositePropertyAdapter(); } @Override - public > Adapter caseEventPrecondition(EventPrecondition object) { + public Adapter caseEventPrecondition(EventPrecondition object) { return createEventPreconditionAdapter(); } @Override diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertySwitch.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertySwitch.java index 4e931126e..e16cd362c 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertySwitch.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertySwitch.java @@ -409,7 +409,7 @@ public

    T1 caseCompositeProperty(CompositeProperty

    object * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public > T1 caseEventPrecondition(EventPrecondition object) { + public T1 caseEventPrecondition(EventPrecondition object) { return null; } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/EventReport.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/EventReport.java index 29afe9cb8..a192e2a20 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/EventReport.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/EventReport.java @@ -42,7 +42,7 @@ public interface EventReport extends EObject { * @model * @generated */ - Event getEvent(); + Event getEvent(); /** * Sets the value of the '{@link org.eclipse.gemoc.event.commons.model.report.EventReport#getEvent Event}' reference. @@ -52,7 +52,7 @@ public interface EventReport extends EObject { * @see #getEvent() * @generated */ - void setEvent(Event value); + void setEvent(Event value); /** * Returns the value of the 'Matches' reference list. diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/impl/EventReportImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/impl/EventReportImpl.java index a77a0593c..b42e0c886 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/impl/EventReportImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/impl/EventReportImpl.java @@ -47,7 +47,7 @@ public class EventReportImpl extends MinimalEObjectImpl.Container implements Eve * @generated * @ordered */ - protected Event event; + protected Event event; /** * The cached value of the '{@link #getMatches() Matches}' reference list. @@ -113,10 +113,10 @@ protected EClass eStaticClass() { * * @generated */ - public Event getEvent() { + public Event getEvent() { if (event != null && event.eIsProxy()) { InternalEObject oldEvent = (InternalEObject)event; - event = (Event)eResolveProxy(oldEvent); + event = (Event)eResolveProxy(oldEvent); if (event != oldEvent) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReportPackage.EVENT_REPORT__EVENT, oldEvent, event)); @@ -130,7 +130,7 @@ public Event getEvent() { * * @generated */ - public Event basicGetEvent() { + public Event basicGetEvent() { return event; } @@ -139,8 +139,8 @@ public Event basicGetEvent() { * * @generated */ - public void setEvent(Event newEvent) { - Event oldEvent = event; + public void setEvent(Event newEvent) { + Event oldEvent = event; event = newEvent; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ReportPackage.EVENT_REPORT__EVENT, oldEvent, event)); @@ -249,7 +249,7 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { public void eSet(int featureID, Object newValue) { switch (featureID) { case ReportPackage.EVENT_REPORT__EVENT: - setEvent((Event)newValue); + setEvent((Event)newValue); return; case ReportPackage.EVENT_REPORT__MATCHES: getMatches().clear(); @@ -274,7 +274,7 @@ public void eSet(int featureID, Object newValue) { public void eUnset(int featureID) { switch (featureID) { case ReportPackage.EVENT_REPORT__EVENT: - setEvent((Event)null); + setEvent((Event)null); return; case ReportPackage.EVENT_REPORT__MATCHES: getMatches().clear(); diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/impl/ReportPackageImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/impl/ReportPackageImpl.java index 8cba19592..ea0c37ecb 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/impl/ReportPackageImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/report/impl/ReportPackageImpl.java @@ -4,7 +4,6 @@ import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EGenericType; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; @@ -237,10 +236,7 @@ public void initializePackageContents() { initEReference(getReport_Events(), this.getEventReport(), null, "events", null, 0, -1, Report.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(eventReportEClass, EventReport.class, "EventReport", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - EGenericType g1 = createEGenericType(theScenarioPackage.getEvent()); - EGenericType g2 = createEGenericType(); - g1.getETypeArguments().add(g2); - initEReference(getEventReport_Event(), g1, null, "event", null, 0, 1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getEventReport_Event(), theScenarioPackage.getEvent(), null, "event", null, 0, 1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getEventReport_Matches(), ecorePackage.getEObject(), null, "matches", null, 0, -1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getEventReport_Target(), ecorePackage.getEObject(), null, "target", null, 0, 1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getEventReport_Time(), ecorePackage.getEInt(), "time", null, 0, 1, EventReport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/Event.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/Event.java index 5b4184e9d..cc00312c1 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/Event.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/Event.java @@ -9,42 +9,10 @@ * A representation of the model object 'Event'. * * - *

    - * The following features are supported: - *

    - *
      - *
    • {@link org.eclipse.gemoc.event.commons.model.scenario.Event#getTargetProvider Target Provider}
    • - *
    * * @see org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage#getEvent() * @model abstract="true" * @generated */ -public interface Event extends EObject { - /** - * Returns the value of the 'Target Provider' containment reference. - * - *

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

    - * - * @return the value of the 'Target Provider' containment reference. - * @see #setTargetProvider(ElementProvider) - * @see org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage#getEvent_TargetProvider() - * @model containment="true" required="true" - * @generated - */ - ElementProvider getTargetProvider(); - - /** - * Sets the value of the '{@link org.eclipse.gemoc.event.commons.model.scenario.Event#getTargetProvider Target Provider}' containment reference. - * - * - * @param value the new value of the 'Target Provider' containment reference. - * @see #getTargetProvider() - * @generated - */ - void setTargetProvider(ElementProvider value); - +public interface Event extends EObject { } // Event diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/EventOccurrence.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/EventOccurrence.java index bde792c9b..6372778f4 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/EventOccurrence.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/EventOccurrence.java @@ -21,7 +21,7 @@ * @model abstract="true" * @generated */ -public interface EventOccurrence, P extends Property> extends ScenarioElement

    { +public interface EventOccurrence extends ScenarioElement

    { /** * Returns the value of the 'Event' containment reference. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioElement.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioElement.java index 5dec06500..69869a883 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioElement.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioElement.java @@ -51,7 +51,7 @@ public interface ScenarioElement

    extends EObject { * It is bidirectional and its opposite is '{@link org.eclipse.gemoc.event.commons.model.scenario.ScenarioElement#getPreviousElements Previous Elements}'. * *

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

    * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioFSM.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioFSM.java index c66d9e487..973777f8b 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioFSM.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioFSM.java @@ -26,7 +26,7 @@ * @model abstract="true" * @generated */ -public interface ScenarioFSM

    , S extends ScenarioFSMState, T extends ScenarioFSMTransition> extends ScenarioElement

    { +public interface ScenarioFSM

    , T extends ScenarioFSMTransition> extends ScenarioElement

    { /** * Returns the value of the 'States' containment reference list. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioFSMState.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioFSMState.java index 00c443d22..d630e26ef 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioFSMState.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioFSMState.java @@ -25,7 +25,7 @@ * @model abstract="true" * @generated */ -public interface ScenarioFSMState, T extends ScenarioFSMTransition> extends EObject { +public interface ScenarioFSMState> extends EObject { /** * Returns the value of the 'Event' containment reference. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioPackage.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioPackage.java index 45379586a..1661ef908 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioPackage.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/ScenarioPackage.java @@ -104,15 +104,6 @@ public interface ScenarioPackage extends EPackage { */ int EVENT = 1; - /** - * The feature id for the 'Target Provider' containment reference. - * - * - * @generated - * @ordered - */ - int EVENT__TARGET_PROVIDER = 0; - /** * The number of structural features of the 'Event' class. * @@ -120,7 +111,7 @@ public interface ScenarioPackage extends EPackage { * @generated * @ordered */ - int EVENT_FEATURE_COUNT = 1; + int EVENT_FEATURE_COUNT = 0; /** * The number of operations of the 'Event' class. @@ -832,17 +823,6 @@ public interface ScenarioPackage extends EPackage { */ EClass getEvent(); - /** - * Returns the meta object for the containment reference '{@link org.eclipse.gemoc.event.commons.model.scenario.Event#getTargetProvider Target Provider}'. - * - * - * @return the meta object for the containment reference 'Target Provider'. - * @see org.eclipse.gemoc.event.commons.model.scenario.Event#getTargetProvider() - * @see #getEvent() - * @generated - */ - EReference getEvent_TargetProvider(); - /** * Returns the meta object for class '{@link org.eclipse.gemoc.event.commons.model.scenario.ElementProvider Element Provider}'. * @@ -1377,14 +1357,6 @@ interface Literals { */ EClass EVENT = eINSTANCE.getEvent(); - /** - * The meta object literal for the 'Target Provider' containment reference feature. - * - * - * @generated - */ - EReference EVENT__TARGET_PROVIDER = eINSTANCE.getEvent_TargetProvider(); - /** * The meta object literal for the '{@link org.eclipse.gemoc.event.commons.model.scenario.impl.ElementProviderImpl Element Provider}' class. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/EventImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/EventImpl.java index 977c0d618..366f4765e 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/EventImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/EventImpl.java @@ -2,16 +2,10 @@ */ package org.eclipse.gemoc.event.commons.model.scenario.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.MinimalEObjectImpl; -import org.eclipse.gemoc.event.commons.model.scenario.ElementProvider; import org.eclipse.gemoc.event.commons.model.scenario.Event; import org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage; @@ -19,26 +13,10 @@ * * An implementation of the model object 'Event'. * - *

    - * The following features are implemented: - *

    - *
      - *
    • {@link org.eclipse.gemoc.event.commons.model.scenario.impl.EventImpl#getTargetProvider Target Provider}
    • - *
    * * @generated */ -public abstract class EventImpl extends MinimalEObjectImpl.Container implements Event { - /** - * The cached value of the '{@link #getTargetProvider() Target Provider}' containment reference. - * - * - * @see #getTargetProvider() - * @generated - * @ordered - */ - protected ElementProvider targetProvider; - +public abstract class EventImpl extends MinimalEObjectImpl.Container implements Event { /** * * @@ -58,120 +36,4 @@ protected EClass eStaticClass() { return ScenarioPackage.Literals.EVENT; } - /** - * - * - * @generated - */ - public ElementProvider getTargetProvider() { - return targetProvider; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetTargetProvider(ElementProvider newTargetProvider, NotificationChain msgs) { - ElementProvider oldTargetProvider = targetProvider; - targetProvider = newTargetProvider; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScenarioPackage.EVENT__TARGET_PROVIDER, oldTargetProvider, newTargetProvider); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setTargetProvider(ElementProvider newTargetProvider) { - if (newTargetProvider != targetProvider) { - NotificationChain msgs = null; - if (targetProvider != null) - msgs = ((InternalEObject)targetProvider).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.EVENT__TARGET_PROVIDER, null, msgs); - if (newTargetProvider != null) - msgs = ((InternalEObject)newTargetProvider).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScenarioPackage.EVENT__TARGET_PROVIDER, null, msgs); - msgs = basicSetTargetProvider(newTargetProvider, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScenarioPackage.EVENT__TARGET_PROVIDER, newTargetProvider, newTargetProvider)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ScenarioPackage.EVENT__TARGET_PROVIDER: - return basicSetTargetProvider(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ScenarioPackage.EVENT__TARGET_PROVIDER: - return getTargetProvider(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ScenarioPackage.EVENT__TARGET_PROVIDER: - setTargetProvider((ElementProvider)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ScenarioPackage.EVENT__TARGET_PROVIDER: - setTargetProvider((ElementProvider)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ScenarioPackage.EVENT__TARGET_PROVIDER: - return targetProvider != null; - } - return super.eIsSet(featureID); - } - } //EventImpl diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/EventOccurrenceImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/EventOccurrenceImpl.java index 3c40e7a57..027a0e9a3 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/EventOccurrenceImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/EventOccurrenceImpl.java @@ -30,7 +30,7 @@ * * @generated */ -public abstract class EventOccurrenceImpl, P extends Property> extends ScenarioElementImpl

    implements EventOccurrence { +public abstract class EventOccurrenceImpl extends ScenarioElementImpl

    implements EventOccurrence { /** * The cached value of the '{@link #getEvent() Event}' containment reference. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioElementImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioElementImpl.java index fb79f0930..87d8d5918 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioElementImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioElementImpl.java @@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; import org.eclipse.emf.ecore.util.InternalEList; diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioFSMImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioFSMImpl.java index 0d7706e93..eabfdd257 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioFSMImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioFSMImpl.java @@ -43,7 +43,7 @@ * * @generated */ -public abstract class ScenarioFSMImpl

    , S extends ScenarioFSMState, T extends ScenarioFSMTransition> extends ScenarioElementImpl

    implements ScenarioFSM { +public abstract class ScenarioFSMImpl

    , T extends ScenarioFSMTransition> extends ScenarioElementImpl

    implements ScenarioFSM { /** * The cached value of the '{@link #getStates() States}' containment reference list. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java index fef94207b..279cbe465 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioFSMStateImpl.java @@ -39,7 +39,7 @@ * * @generated */ -public abstract class ScenarioFSMStateImpl, T extends ScenarioFSMTransition> extends MinimalEObjectImpl.Container implements ScenarioFSMState { +public abstract class ScenarioFSMStateImpl> extends MinimalEObjectImpl.Container implements ScenarioFSMState { /** * The cached value of the '{@link #getEvent() Event}' containment reference. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioPackageImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioPackageImpl.java index a497fbe1b..5afdc0eb4 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioPackageImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/impl/ScenarioPackageImpl.java @@ -231,15 +231,6 @@ public EClass getEvent() { return eventEClass; } - /** - * - * - * @generated - */ - public EReference getEvent_TargetProvider() { - return (EReference)eventEClass.getEStructuralFeatures().get(0); - } - /** * * @@ -677,7 +668,6 @@ public void createPackageContents() { createEReference(scenarioEClass, SCENARIO__ELEMENTS); eventEClass = createEClass(EVENT); - createEReference(eventEClass, EVENT__TARGET_PROVIDER); elementProviderEClass = createEClass(ELEMENT_PROVIDER); @@ -766,7 +756,6 @@ public void initializePackageContents() { // Create type parameters ETypeParameter scenarioEClass_T = addETypeParameter(scenarioEClass, "T"); - ETypeParameter eventEClass_T = addETypeParameter(eventEClass, "T"); addETypeParameter(elementProviderEClass, "T"); ETypeParameter elementReferenceEClass_T = addETypeParameter(elementReferenceEClass, "T"); ETypeParameter elementQueryEClass_T = addETypeParameter(elementQueryEClass, "T"); @@ -800,8 +789,6 @@ public void initializePackageContents() { g1.getETypeArguments().add(g2); elementQueryEClass_P.getEBounds().add(g1); g1 = createEGenericType(this.getEvent()); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); eventOccurrenceEClass_E.getEBounds().add(g1); g1 = createEGenericType(thePropertyPackage.getProperty()); eventOccurrenceEClass_P.getEBounds().add(g1); @@ -810,8 +797,6 @@ public void initializePackageContents() { g1 = createEGenericType(thePropertyPackage.getProperty()); scenarioFSMEClass_P.getEBounds().add(g1); g1 = createEGenericType(this.getEvent()); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); scenarioFSMEClass_E.getEBounds().add(g1); g1 = createEGenericType(this.getScenarioFSMState()); g2 = createEGenericType(scenarioFSMEClass_E); @@ -826,8 +811,6 @@ public void initializePackageContents() { g1.getETypeArguments().add(g2); scenarioFSMEClass_T.getEBounds().add(g1); g1 = createEGenericType(this.getEvent()); - g2 = createEGenericType(); - g1.getETypeArguments().add(g2); scenarioFSMStateEClass_E.getEBounds().add(g1); g1 = createEGenericType(this.getScenarioFSMTransition()); g2 = createEGenericType(); @@ -898,10 +881,6 @@ public void initializePackageContents() { initEReference(getScenario_Elements(), g1, null, "elements", null, 0, -1, Scenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(eventEClass, Event.class, "Event", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(this.getElementProvider()); - g2 = createEGenericType(eventEClass_T); - g1.getETypeArguments().add(g2); - initEReference(getEvent_TargetProvider(), g1, null, "targetProvider", null, 1, 1, Event.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(elementProviderEClass, ElementProvider.class, "ElementProvider", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/util/ScenarioAdapterFactory.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/util/ScenarioAdapterFactory.java index cf8640ed5..712587eb9 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/util/ScenarioAdapterFactory.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/util/ScenarioAdapterFactory.java @@ -75,7 +75,7 @@ public > Adapter caseScenario(Scenario object) { return createScenarioAdapter(); } @Override - public Adapter caseEvent(Event object) { + public Adapter caseEvent(Event object) { return createEventAdapter(); } @Override @@ -91,7 +91,7 @@ public > Adapter caseElementQuery(ElementQuery, P extends Property> Adapter caseEventOccurrence(EventOccurrence object) { + public Adapter caseEventOccurrence(EventOccurrence object) { return createEventOccurrenceAdapter(); } @Override @@ -99,11 +99,11 @@ public

    Adapter caseScenarioElement(ScenarioElement

    objec return createScenarioElementAdapter(); } @Override - public

    , S extends ScenarioFSMState, T extends ScenarioFSMTransition> Adapter caseScenarioFSM(ScenarioFSM object) { + public

    , T extends ScenarioFSMTransition> Adapter caseScenarioFSM(ScenarioFSM object) { return createScenarioFSMAdapter(); } @Override - public , T extends ScenarioFSMTransition> Adapter caseScenarioFSMState(ScenarioFSMState object) { + public > Adapter caseScenarioFSMState(ScenarioFSMState object) { return createScenarioFSMStateAdapter(); } @Override diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/util/ScenarioSwitch.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/util/ScenarioSwitch.java index 2d58e735e..a6774f256 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/util/ScenarioSwitch.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/scenario/util/ScenarioSwitch.java @@ -76,7 +76,7 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { return result; } case ScenarioPackage.EVENT: { - Event event = (Event)theEObject; + Event event = (Event)theEObject; T1 result = caseEvent(event); if (result == null) result = defaultCase(theEObject); return result; @@ -181,7 +181,7 @@ public > T1 caseScenario(Scenario object) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public T1 caseEvent(Event object) { + public T1 caseEvent(Event object) { return null; } @@ -241,7 +241,7 @@ public > T1 caseElementQuery(ElementQuery ob * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public , P extends Property> T1 caseEventOccurrence(EventOccurrence object) { + public T1 caseEventOccurrence(EventOccurrence object) { return null; } @@ -271,7 +271,7 @@ public

    T1 caseScenarioElement(ScenarioElement

    object) { * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public

    , S extends ScenarioFSMState, T extends ScenarioFSMTransition> T1 caseScenarioFSM(ScenarioFSM object) { + public

    , T extends ScenarioFSMTransition> T1 caseScenarioFSM(ScenarioFSM object) { return null; } @@ -286,7 +286,7 @@ public

    , S extends ScenarioFSMState * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public , T extends ScenarioFSMTransition> T1 caseScenarioFSMState(ScenarioFSMState object) { + public > T1 caseScenarioFSMState(ScenarioFSMState object) { return null; } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventTableView.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventTableView.java index 78b3b595b..27fbb15c8 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventTableView.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventTableView.java @@ -29,7 +29,6 @@ import org.eclipse.gemoc.event.commons.model.EventInstance; import org.eclipse.gemoc.event.commons.model.IEventManager; import org.eclipse.gemoc.event.commons.model.scenario.Event; -import org.eclipse.gemoc.event.commons.model.scenario.ScenarioPackage; import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; import org.eclipse.xtext.naming.QualifiedName; @@ -66,7 +65,6 @@ public EventTableView(final EClass eventClass, final Resource executedModel, fin this.eventClass = eventClass; this.factory = eventClass.getEPackage().getEFactoryInstance(); this.executedModel = executedModel; - extractEventTarget(); extractEventParameters(); setItems(events); setEditable(true); @@ -115,7 +113,7 @@ public void refreshEvents() { }); }); }).map(m -> { - return new EventInstance((Event) factory.create(eventClass), m); + return new EventInstance((Event) factory.create(eventClass), m); }).filter(event -> canDisplayEventFunction.apply(event)).collect(Collectors.toList()); final List toRemove = events.stream().filter(event -> !canDisplayEventFunction.apply(event)) @@ -125,14 +123,6 @@ public void refreshEvents() { }); } - private void extractEventTarget() { - final List genericTypes = eventClass.getEGenericSuperTypes(); - final List typeArguments = genericTypes.get(0).getETypeArguments(); - final EClass correspondingClass = (EClass) typeArguments.get(0).getEClassifier(); - eventParameterClasses.add(correspondingClass); - referenceToParameterClass.put(ScenarioPackage.Literals.EVENT__TARGET_PROVIDER, correspondingClass); - } - private void extractEventParameters() { eventClass.getEReferences().forEach(f -> { final List genericTypes = ((EClass) f.getEType()).getEGenericSuperTypes(); From 8adfeba0a1f1e27d4b22bc2485e654219f6d64aa Mon Sep 17 00:00:00 2001 From: d-leroy Date: Thu, 27 Jul 2017 09:48:55 +0200 Subject: [PATCH 27/31] [Event manager] changed how event manager is notified of output events --- .../interpreter/event/AbstractEventManager.java | 12 +----------- .../gemoc/event/commons/model/IEventManager.java | 2 -- .../event/commons/model/IEventManagerListener.java | 4 +++- .../javaengine/PlainK3ExecutionEngine.java | 5 +---- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java index c8b8fb208..686353efc 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java @@ -56,15 +56,7 @@ public void sendEvent(Object input) { } } - @Override - public void receiveEvent(Object result, Object caller, String className, String methodName) { - final EventInstance event = rebuildEvent(result, caller, className, methodName); - if (event != null) { - listeners.forEach(l -> l.eventReceived(event)); - } - } - - private List listeners = new ArrayList<>(); + protected List listeners = new ArrayList<>(); @Override public void addListener(IEventManagerListener listener) { @@ -76,8 +68,6 @@ public void removeListener(IEventManagerListener listener) { listeners.remove(listener); } - protected abstract EventInstance rebuildEvent(Object result, Object caller, String className, String methodName); - @Override public void manageEvents() { if (canManageEvents) { diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManager.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManager.java index 20b1b2573..c8cfd0871 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManager.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManager.java @@ -11,8 +11,6 @@ public interface IEventManager extends IEngineAddon { void sendEvent(Object event); - void receiveEvent(Object result, Object caller, String className, String methodName); - void manageEvents(); void waitForEvents(); diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManagerListener.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManagerListener.java index f27954a3c..74f17cdfb 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManagerListener.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManagerListener.java @@ -1,6 +1,8 @@ package org.eclipse.gemoc.event.commons.model; +import org.eclipse.gemoc.event.commons.model.scenario.Event; + public interface IEventManagerListener { - public void eventReceived(EventInstance event); + public void eventReceived(Event event); } diff --git a/java_execution/java_engine/plugins/org.eclipse.gemoc.execution.sequential.javaengine/src/org/eclipse/gemoc/execution/sequential/javaengine/PlainK3ExecutionEngine.java b/java_execution/java_engine/plugins/org.eclipse.gemoc.execution.sequential.javaengine/src/org/eclipse/gemoc/execution/sequential/javaengine/PlainK3ExecutionEngine.java index 198003149..e7bf103ef 100644 --- a/java_execution/java_engine/plugins/org.eclipse.gemoc.execution.sequential.javaengine/src/org/eclipse/gemoc/execution/sequential/javaengine/PlainK3ExecutionEngine.java +++ b/java_execution/java_engine/plugins/org.eclipse.gemoc.execution.sequential.javaengine/src/org/eclipse/gemoc/execution/sequential/javaengine/PlainK3ExecutionEngine.java @@ -301,16 +301,13 @@ protected void executeEntryPoint() { * fr.inria.diverse.k3.al.annotationprocessor.stepmanager.StepCommand, * java.lang.String) */ - public void executeStep(Object caller, final StepCommand command, String className, String methodName, boolean output) { + public void executeStep(Object caller, final StepCommand command, String className, String methodName) { executeOperation(caller, className, methodName, new Runnable() { @Override public void run() { command.execute(); } }); - if (output) { - handleOutputEvent(command.getResult(), caller, className, methodName); - } } @Override From 3c19d0a4ba8713a996cf4ccaf52c51db42c4c868 Mon Sep 17 00:00:00 2001 From: d-leroy Date: Thu, 27 Jul 2017 09:59:13 +0200 Subject: [PATCH 28/31] [Execution engine] fix call to deleted method --- .../engine/core/AbstractSequentialExecutionEngine.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java index 28c5b2472..b8eee4781 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java @@ -97,10 +97,6 @@ protected final void performStart() { executeEntryPoint(); Activator.getDefault().info("Execution finished"); } - - protected void handleOutputEvent(Object result, Object caller, String className, String methodName) { - eventManagerAddon.receiveEvent(result, caller, className, methodName); - } private void manageEvents() { if (eventManagerAddon != null) { From 94747cc35f65ead6e6b181287456dd31cea7ff73 Mon Sep 17 00:00:00 2001 From: d-leroy Date: Thu, 27 Jul 2017 10:54:54 +0200 Subject: [PATCH 29/31] [Engine addons] changed from DefaultEngineAddon to IEngineAddon --- .../interpreter/property/PropertyMonitor.java | 4 +-- .../SimpleModelChangeListenerAddon.java | 3 +-- .../gemoc/traceaddon/AbstractTraceAddon.xtend | 27 +++++++++---------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java index 5394fc099..67780ff20 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java @@ -31,9 +31,9 @@ import org.eclipse.gemoc.trace.commons.model.trace.MSE; import org.eclipse.gemoc.trace.commons.model.trace.Step; import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; -import org.eclipse.gemoc.xdsmlframework.api.engine_addon.DefaultEngineAddon; +import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; -public class PropertyMonitor extends DefaultEngineAddon implements IPropertyMonitor { +public class PropertyMonitor implements IEngineAddon, IPropertyMonitor { private Resource executedModel; diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/modelchangelistener/SimpleModelChangeListenerAddon.java b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/modelchangelistener/SimpleModelChangeListenerAddon.java index 0b35376a5..a88abfc09 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/modelchangelistener/SimpleModelChangeListenerAddon.java +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.xdsmlframework.api/src/org/eclipse/gemoc/xdsmlframework/api/engine_addon/modelchangelistener/SimpleModelChangeListenerAddon.java @@ -23,10 +23,9 @@ import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.util.EContentAdapter; import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; -import org.eclipse.gemoc.xdsmlframework.api.engine_addon.DefaultEngineAddon; import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; -public class SimpleModelChangeListenerAddon extends DefaultEngineAddon implements IModelChangeListenerAddon { +public class SimpleModelChangeListenerAddon implements IEngineAddon, IModelChangeListenerAddon { private EContentAdapter adapter; private IExecutionEngine engine; diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/AbstractTraceAddon.xtend b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/AbstractTraceAddon.xtend index 9f77868d3..9ebed8a40 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/AbstractTraceAddon.xtend +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/AbstractTraceAddon.xtend @@ -12,18 +12,6 @@ package org.eclipse.gemoc.trace.gemoc.traceaddon import com.google.common.collect.BiMap import com.google.common.collect.HashBiMap -import org.eclipse.gemoc.trace.commons.model.trace.Dimension -import org.eclipse.gemoc.trace.commons.model.trace.State -import org.eclipse.gemoc.trace.commons.model.trace.Step -import org.eclipse.gemoc.trace.commons.model.trace.Trace -import org.eclipse.gemoc.trace.commons.model.trace.TracedObject -import org.eclipse.gemoc.trace.commons.model.trace.Value -import org.eclipse.gemoc.trace.gemoc.api.IMultiDimensionalTraceAddon -import org.eclipse.gemoc.trace.gemoc.api.IStateManager -import org.eclipse.gemoc.trace.gemoc.api.ITraceConstructor -import org.eclipse.gemoc.trace.gemoc.api.ITraceExplorer -import org.eclipse.gemoc.trace.gemoc.api.ITraceExtractor -import org.eclipse.gemoc.trace.gemoc.api.ITraceNotifier import java.util.ArrayList import java.util.HashSet import java.util.List @@ -39,14 +27,25 @@ import org.eclipse.emf.transaction.RecordingCommand import org.eclipse.emf.transaction.util.TransactionUtil import org.eclipse.gemoc.commons.eclipse.emf.EMFResource import org.eclipse.gemoc.executionframework.engine.core.CommandExecution +import org.eclipse.gemoc.trace.commons.model.trace.Dimension +import org.eclipse.gemoc.trace.commons.model.trace.State +import org.eclipse.gemoc.trace.commons.model.trace.Step +import org.eclipse.gemoc.trace.commons.model.trace.Trace +import org.eclipse.gemoc.trace.commons.model.trace.TracedObject +import org.eclipse.gemoc.trace.commons.model.trace.Value +import org.eclipse.gemoc.trace.gemoc.api.IMultiDimensionalTraceAddon +import org.eclipse.gemoc.trace.gemoc.api.IStateManager +import org.eclipse.gemoc.trace.gemoc.api.ITraceConstructor +import org.eclipse.gemoc.trace.gemoc.api.ITraceExplorer +import org.eclipse.gemoc.trace.gemoc.api.ITraceExtractor +import org.eclipse.gemoc.trace.gemoc.api.ITraceNotifier import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionContext import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine -import org.eclipse.gemoc.xdsmlframework.api.engine_addon.DefaultEngineAddon import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon import org.eclipse.gemoc.xdsmlframework.api.engine_addon.modelchangelistener.BatchModelChangeListener import org.eclipse.gemoc.xdsmlframework.api.extensions.engine_addon.EngineAddonSpecificationExtensionPoint -abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDimensionalTraceAddon, State, TracedObject, Dimension, Value> { +abstract class AbstractTraceAddon implements IEngineAddon, IMultiDimensionalTraceAddon, State, TracedObject, Dimension, Value> { private IExecutionContext _executionContext private ITraceExplorer, State, TracedObject, Dimension, Value> traceExplorer From 2f49bad17492f8fa6fdd7c48d0eeda723fe75997 Mon Sep 17 00:00:00 2001 From: d-leroy Date: Mon, 31 Jul 2017 11:02:40 +0200 Subject: [PATCH 30/31] [Events] minor refactorings --- .../event/AbstractEventManager.java | 13 +++++++------ .../interpreter/scenario/ArbiterManager.java | 18 ++++++++++-------- .../gen/k3/K3StepExtractor.xtend | 2 +- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java index 686353efc..b61eeda10 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java @@ -12,12 +12,10 @@ import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; -import org.eclipse.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; -import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; -import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; - import org.eclipse.gemoc.event.commons.interpreter.property.PropertyMonitor; import org.eclipse.gemoc.event.commons.interpreter.scenario.ArbiterManager; +import org.eclipse.gemoc.event.commons.interpreter.scenario.IArbiterManager; +import org.eclipse.gemoc.event.commons.interpreter.scenario.IScenarioManager; import org.eclipse.gemoc.event.commons.interpreter.scenario.ScenarioManager; import org.eclipse.gemoc.event.commons.model.EventInstance; import org.eclipse.gemoc.event.commons.model.EventManagerRegistry; @@ -26,6 +24,9 @@ import org.eclipse.gemoc.event.commons.model.scenario.Arbiter; import org.eclipse.gemoc.event.commons.model.scenario.Scenario; import org.eclipse.gemoc.trace.commons.model.trace.Step; +import org.eclipse.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; +import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; +import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; public abstract class AbstractEventManager implements IEventManager { @@ -39,9 +40,9 @@ public abstract class AbstractEventManager implements IEventManager { private Thread t = null; - protected ScenarioManager scenarioManager; + protected IScenarioManager scenarioManager; - protected ArbiterManager arbiterManager; + protected IArbiterManager arbiterManager; @Override public void sendEvent(Object input) { diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ArbiterManager.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ArbiterManager.java index 3f4d8e4ef..2eb4dc349 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ArbiterManager.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ArbiterManager.java @@ -11,7 +11,7 @@ import org.eclipse.gemoc.event.commons.model.scenario.TruthValue; import org.eclipse.gemoc.event.commons.model.property.Property; -public class ArbiterManager { +public class ArbiterManager implements IArbiterManager { private ArbiterState currentState; private final IPropertyMonitor propertyMonitor; @@ -20,6 +20,7 @@ public ArbiterManager(IPropertyMonitor propertyMonitor) { this.propertyMonitor = propertyMonitor; } + @Override public TruthValue getTruthValue() { return currentState.getTruthValue(); } @@ -39,6 +40,7 @@ private void setupArbiterStatePropertyListeners(Arbiter arbiter, Arbite }); } + @Override public void loadArbiter(Arbiter arbiter) { currentState = arbiter.getInitialState(); setupArbiterStatePropertyListeners(arbiter, currentState); @@ -61,20 +63,20 @@ public ArbiterTransitionGuardListener(Arbiter arbiter, ArbiterState propertyMonitor.unmonitorProperty(p, l)); guards.clear(); if (arbiter.getAcceptingStates().contains(currentState)) { - // If the current state is an accepting state, - // we print the final verdict. + /* If the current state is an accepting state, + * we print the final verdict.*/ System.out.println("Arbiter has reached a verdict: " + currentState.getTruthValue()); } else { - // Otherwise we start monitoring the guards of the outgoing - // transitions. + /* Otherwise we start monitoring the guards of the outgoing + * transitions.*/ setupArbiterStatePropertyListeners(arbiter, state); } } diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.opsemanticsview.gen.k3/src/org/eclipse/gemoc/opsemanticsview/gen/k3/K3StepExtractor.xtend b/framework/framework_commons/plugins/org.eclipse.gemoc.opsemanticsview.gen.k3/src/org/eclipse/gemoc/opsemanticsview/gen/k3/K3StepExtractor.xtend index 0c07f2ad9..bf34fb905 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.opsemanticsview.gen.k3/src/org/eclipse/gemoc/opsemanticsview/gen/k3/K3StepExtractor.xtend +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.opsemanticsview.gen.k3/src/org/eclipse/gemoc/opsemanticsview/gen/k3/K3StepExtractor.xtend @@ -428,7 +428,7 @@ class K3StepExtractor { return simpleName == "Step" ] annotation != null && annotation.memberValuePairs.exists [ p | - p.memberName == "eventTriggerable" && p.value instanceof Boolean && p.value as Boolean + p.memberName == "eventHandler" && p.value instanceof Boolean && p.value as Boolean ] } From d97410da0e39038497c3c5e98d7afd6823b4060f Mon Sep 17 00:00:00 2001 From: d-leroy Date: Thu, 14 Sep 2017 16:13:58 +0200 Subject: [PATCH 31/31] [Behavioral Interface] changed relationship between generic and generated parts from inheritance to reference --- .../META-INF/MANIFEST.MF | 6 +- .../commons/interpreter}/EventInstance.java | 2 +- ...ventManager.java => EventInterpreter.java} | 97 +++++-------------- .../interpreter/EventInterpreterRegistry.java | 38 ++++++++ .../commons/interpreter/IBehavioralAPI.java | 16 +++ .../interpreter/IEventInterpreter.java | 24 +++++ .../IEventInterpreterListener.java} | 4 +- .../interpreter/property/PropertyMonitor.java | 37 ++++++- .../interpreter/scenario/IArbiterManager.java | 12 +++ .../interpreter/scenario/ScenarioManager.java | 14 +-- .../META-INF/MANIFEST.MF | 6 +- .../model/property.ecore | 1 + .../commons/model/EventManagerRegistry.java | 38 -------- .../event/commons/model/IEventManager.java | 29 ------ .../model/property/CompositeProperty.java | 30 ++++++ .../model/property/EnumAttributeProperty.java | 80 +++++++++++++++ .../model/property/PropertyPackage.java | 30 +++++- .../property/impl/CompositePropertyImpl.java | 70 +++++++++++++ .../property/impl/PropertyPackageImpl.java | 11 +++ .../property/util/PropertyAdapterFactory.java | 1 - .../META-INF/MANIFEST.MF | 3 +- .../AbstractSequentialExecutionEngine.java | 30 +++--- .../views/EventManagerRenderer.java | 31 +++--- .../eventmanager/views/EventPane.java | 4 +- .../eventmanager/views/EventTableView.java | 6 +- .../traceaddon/GenericTraceConstructor.java | 2 +- 26 files changed, 429 insertions(+), 193 deletions(-) rename framework/execution_framework/plugins/{org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model => org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter}/EventInstance.java (91%) rename framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/{event/AbstractEventManager.java => EventInterpreter.java} (64%) create mode 100644 framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInterpreterRegistry.java create mode 100644 framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IBehavioralAPI.java create mode 100644 framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IEventInterpreter.java rename framework/execution_framework/plugins/{org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManagerListener.java => org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IEventInterpreterListener.java} (52%) create mode 100644 framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/IArbiterManager.java delete mode 100644 framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventManagerRegistry.java delete mode 100644 framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManager.java create mode 100644 framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/EnumAttributeProperty.java diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/META-INF/MANIFEST.MF index 223f6f4b0..fa8219521 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-SymbolicName: org.eclipse.gemoc.event.commons.interpreter; singleton:=true Export-Package: org.eclipse.gemoc.event.commons.interpreter.property, org.eclipse.gemoc.event.commons.interpreter.scenario, - org.eclipse.gemoc.event.commons.interpreter.event + org.eclipse.gemoc.event.commons.interpreter Bundle-Name: org.eclipse.gemoc.event.commons.interpreter Bundle-Version: 1.0.0 Bundle-ClassPath: . @@ -16,6 +16,8 @@ Require-Bundle: fr.inria.diverse.k3.al.annotationprocessor.plugin;bundle-version org.eclipse.gemoc.event.commons.model;bundle-version="0.0.0";visibility:=private, org.eclipse.emf.transaction;bundle-version="1.9.0", org.eclipse.gemoc.xdsmlframework.api;bundle-version="2.3.0", - org.eclipse.gemoc.trace.commons.model + org.eclipse.gemoc.trace.commons.model, + org.eclipse.ocl, + org.eclipse.ocl.ecore Bundle-ManifestVersion: 2 Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventInstance.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInstance.java similarity index 91% rename from framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventInstance.java rename to framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInstance.java index 75eb9223b..81e80525a 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventInstance.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInstance.java @@ -1,4 +1,4 @@ -package org.eclipse.gemoc.event.commons.model; +package org.eclipse.gemoc.event.commons.interpreter; import java.util.Map; diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInterpreter.java similarity index 64% rename from framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java rename to framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInterpreter.java index b61eeda10..44666ebb8 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/event/AbstractEventManager.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInterpreter.java @@ -1,10 +1,9 @@ -package org.eclipse.gemoc.event.commons.interpreter.event; +package org.eclipse.gemoc.event.commons.interpreter; import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.Queue; +import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; import org.eclipse.emf.common.util.URI; @@ -17,18 +16,11 @@ import org.eclipse.gemoc.event.commons.interpreter.scenario.IArbiterManager; import org.eclipse.gemoc.event.commons.interpreter.scenario.IScenarioManager; import org.eclipse.gemoc.event.commons.interpreter.scenario.ScenarioManager; -import org.eclipse.gemoc.event.commons.model.EventInstance; -import org.eclipse.gemoc.event.commons.model.EventManagerRegistry; -import org.eclipse.gemoc.event.commons.model.IEventManager; -import org.eclipse.gemoc.event.commons.model.IEventManagerListener; import org.eclipse.gemoc.event.commons.model.scenario.Arbiter; import org.eclipse.gemoc.event.commons.model.scenario.Scenario; -import org.eclipse.gemoc.trace.commons.model.trace.Step; -import org.eclipse.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; -import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; -public abstract class AbstractEventManager implements IEventManager { +public class EventInterpreter implements IEventInterpreter { private Resource executedModel; @@ -40,37 +32,42 @@ public abstract class AbstractEventManager implements IEventManager { private Thread t = null; - protected IScenarioManager scenarioManager; + private IScenarioManager scenarioManager; - protected IArbiterManager arbiterManager; + private IArbiterManager arbiterManager; + + private IBehavioralAPI api; @Override - public void sendEvent(Object input) { - if (input instanceof EventInstance) { - eventQueue.add((EventInstance) input); - if (t != null) { - synchronized (t) { - t.notify(); - } - t = null; + public void queueEvent(EventInstance input) { + eventQueue.add((EventInstance) input); + if (t != null) { + synchronized (t) { + t.notify(); } + t = null; } } + + @Override + public boolean canSendEvent(EventInstance event) { + return api.canSendEvent(event); + } - protected List listeners = new ArrayList<>(); + private List listeners = new ArrayList<>(); @Override - public void addListener(IEventManagerListener listener) { + public void addListener(IEventInterpreterListener listener) { listeners.add(listener); } @Override - public void removeListener(IEventManagerListener listener) { + public void removeListener(IEventInterpreterListener listener) { listeners.remove(listener); } @Override - public void manageEvents() { + public void processEvents() { if (canManageEvents) { canManageEvents = false; if (scenarioManager != null && !scenarioManager.isScenarioComplete()) { @@ -90,7 +87,7 @@ public void manageEvents() { } EventInstance event = eventQueue.poll(); while (event != null) { - dispatchEvent(event); + api.dispatchEvent(event); event = eventQueue.poll(); } canManageEvents = true; @@ -130,8 +127,6 @@ public void loadArbiter(URI uri, ResourceSet resourceSet) { } } - protected abstract void dispatchEvent(EventInstance event); - @Override public void engineAboutToStart(IExecutionEngine engine) { executedModel = engine.getExecutionContext().getResourceModel(); @@ -151,15 +146,13 @@ public void engineAboutToStart(IExecutionEngine engine) { } } - } - - @Override - public void engineInitialized(IExecutionEngine executionEngine) { + + final Set apis = engine.getAddonsTypedBy(IBehavioralAPI.class); + api = apis.iterator().next(); } @Override public void engineStarted(IExecutionEngine executionEngine) { - EventManagerRegistry.getInstance().registerManager(this); if (pendingScenario != null) { scenarioManager.loadScenario(pendingScenario); pendingScenario = null; @@ -170,48 +163,10 @@ public void engineStarted(IExecutionEngine executionEngine) { } } - @Override - public void engineAboutToStop(IExecutionEngine engine) { - } - @Override public void engineStopped(IExecutionEngine engine) { if (scenarioManager != null) { scenarioManager.saveScenarioReport(); } - EventManagerRegistry.getInstance().unregisterManager(this); - } - - @Override - public void engineAboutToDispose(IExecutionEngine engine) { - } - - @Override - public void aboutToSelectStep(IExecutionEngine engine, Collection> steps) { - } - - @Override - public void proposedStepsChanged(IExecutionEngine engine, Collection> steps) { - } - - @Override - public void stepSelected(IExecutionEngine engine, Step selectedStep) { - } - - @Override - public void aboutToExecuteStep(IExecutionEngine engine, Step stepToExecute) { - } - - @Override - public void stepExecuted(IExecutionEngine engine, Step stepExecuted) { - } - - @Override - public void engineStatusChanged(IExecutionEngine engine, RunStatus newStatus) { - } - - @Override - public List validate(List otherAddons) { - return Collections.emptyList(); } } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInterpreterRegistry.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInterpreterRegistry.java new file mode 100644 index 000000000..ca36e2b96 --- /dev/null +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/EventInterpreterRegistry.java @@ -0,0 +1,38 @@ +package org.eclipse.gemoc.event.commons.interpreter; + +import java.util.HashSet; +import java.util.Set; + +public class EventInterpreterRegistry { + + private static EventInterpreterRegistry instance; + + private Set registeredManagers; + + private EventInterpreterRegistry () { + this.registeredManagers = new HashSet(); + } + + public static EventInterpreterRegistry getInstance() { + if(instance == null) { + instance = new EventInterpreterRegistry(); + } + return instance; + } + + public void registerManager(IEventInterpreter manager) { + if(manager != null) { + registeredManagers.add(manager); + } + } + + public void unregisterManager(IEventInterpreter manager) { + if(manager != null) { + registeredManagers.remove(manager); + } + } + + public IEventInterpreter findEventInterpreter() { + return registeredManagers.stream().findFirst().orElse(null); + } +} diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IBehavioralAPI.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IBehavioralAPI.java new file mode 100644 index 000000000..0429999d6 --- /dev/null +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IBehavioralAPI.java @@ -0,0 +1,16 @@ +package org.eclipse.gemoc.event.commons.interpreter; + +import java.util.Set; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; +import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; + +public interface IBehavioralAPI extends IEngineAddon { + + void dispatchEvent(EventInstance event); + + boolean canSendEvent(EventInstance event); + + Set getEventClasses(); +} diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IEventInterpreter.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IEventInterpreter.java new file mode 100644 index 000000000..bcf855cab --- /dev/null +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IEventInterpreter.java @@ -0,0 +1,24 @@ +package org.eclipse.gemoc.event.commons.interpreter; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; + +public interface IEventInterpreter extends IEngineAddon { + + void queueEvent(EventInstance event); + + void processEvents(); + + void waitForEvents(); + + void loadScenario(URI uri, ResourceSet resourceSet); + + void loadArbiter(URI arbiterURI, ResourceSet resourceSet); + + void addListener(IEventInterpreterListener listener); + + void removeListener(IEventInterpreterListener listener); + + boolean canSendEvent(EventInstance event); +} diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManagerListener.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IEventInterpreterListener.java similarity index 52% rename from framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManagerListener.java rename to framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IEventInterpreterListener.java index 74f17cdfb..c91467b94 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManagerListener.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/IEventInterpreterListener.java @@ -1,8 +1,8 @@ -package org.eclipse.gemoc.event.commons.model; +package org.eclipse.gemoc.event.commons.interpreter; import org.eclipse.gemoc.event.commons.model.scenario.Event; -public interface IEventManagerListener { +public interface IEventInterpreterListener { public void eventReceived(Event event); } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java index 67780ff20..7fa78af14 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/property/PropertyMonitor.java @@ -11,14 +11,16 @@ import java.util.stream.Collectors; import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EParameter; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.gemoc.event.commons.interpreter.EventInstance; +import org.eclipse.gemoc.event.commons.interpreter.IEventInterpreter; import org.eclipse.gemoc.event.commons.interpreter.scenario.ElementProviderAspect; -import org.eclipse.gemoc.event.commons.model.EventInstance; -import org.eclipse.gemoc.event.commons.model.IEventManager; import org.eclipse.gemoc.event.commons.model.property.CompositeProperty; import org.eclipse.gemoc.event.commons.model.property.EventPrecondition; import org.eclipse.gemoc.event.commons.model.property.Property; @@ -32,6 +34,10 @@ import org.eclipse.gemoc.trace.commons.model.trace.Step; import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; +import org.eclipse.ocl.OCL; +import org.eclipse.ocl.ecore.Constraint; +import org.eclipse.ocl.ecore.EcoreEnvironmentFactory; +import org.eclipse.ocl.helper.OCLHelper; public class PropertyMonitor implements IEngineAddon, IPropertyMonitor { @@ -47,9 +53,17 @@ public class PropertyMonitor implements IEngineAddon, IPropertyMonitor { private final Set endingSteps = new HashSet<>(); - private IEventManager eventManager; + private IEventInterpreter eventManager; private boolean eventManagerAvailable = false; + + private final OCL ocl; + private final OCLHelper helper; + + public PropertyMonitor() { + ocl = OCL.newInstance(EcoreEnvironmentFactory.INSTANCE); + helper = ocl.createOCLHelper(); + } private boolean monitor(Property property) { if (property == null) { @@ -113,7 +127,20 @@ private boolean evaluateEventPrecondition(EventPrecondition property) { private boolean evaluateCompositeProperty(CompositeProperty property) { final List list = property.getProperties().stream().map(p -> evaluateProperty(p)) .collect(Collectors.toList()); - return list.stream().allMatch(b -> b); + boolean result = false; + switch (property.getOperator()) { + case AND: + result = list.stream().allMatch(b -> b); + break; + case IMPLIES: + break; + case OR: + result = list.stream().anyMatch(b -> b); + break; + default: + break; + } + return result; } private boolean evaluateStepProperty(StepProperty property) { @@ -182,7 +209,7 @@ public void unmonitorProperty(Property property, IPropertyListener listener) { @Override public void engineAboutToStart(IExecutionEngine engine) { executedModel = engine.getExecutionContext().getResourceModel(); - eventManager = engine.getAddonsTypedBy(IEventManager.class).stream().findFirst().orElse(null); + eventManager = engine.getAddonsTypedBy(IEventInterpreter.class).stream().findFirst().orElse(null); eventManagerAvailable = eventManager != null; } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/IArbiterManager.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/IArbiterManager.java new file mode 100644 index 000000000..d3a3f3730 --- /dev/null +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/IArbiterManager.java @@ -0,0 +1,12 @@ +package org.eclipse.gemoc.event.commons.interpreter.scenario; + +import org.eclipse.gemoc.event.commons.model.scenario.Arbiter; +import org.eclipse.gemoc.event.commons.model.scenario.TruthValue; + +public interface IArbiterManager { + + TruthValue getTruthValue(); + + void loadArbiter(Arbiter arbiter); + +} \ No newline at end of file diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ScenarioManager.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ScenarioManager.java index e5026cfee..9c036a408 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ScenarioManager.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.interpreter/src/org/eclipse/gemoc/event/commons/interpreter/scenario/ScenarioManager.java @@ -20,10 +20,10 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.emf.transaction.impl.EMFCommandTransaction; import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; +import org.eclipse.gemoc.event.commons.interpreter.EventInstance; +import org.eclipse.gemoc.event.commons.interpreter.IEventInterpreter; import org.eclipse.gemoc.event.commons.interpreter.property.IPropertyListener; import org.eclipse.gemoc.event.commons.interpreter.property.IPropertyMonitor; -import org.eclipse.gemoc.event.commons.model.EventInstance; -import org.eclipse.gemoc.event.commons.model.IEventManager; import org.eclipse.gemoc.event.commons.model.property.CompositeProperty; import org.eclipse.gemoc.event.commons.model.property.EventPrecondition; import org.eclipse.gemoc.event.commons.model.property.Property; @@ -44,13 +44,13 @@ public class ScenarioManager implements IScenarioManager { private Scenario scenario; private final Resource executedModel; - private final IEventManager eventManager; + private final IEventInterpreter eventManager; private final IPropertyMonitor propertyMonitor; private final List> currentElements = new ArrayList<>(); private final Report report = ReportFactory.eINSTANCE.createReport(); private final PropertyFactory propertyFactory = PropertyFactory.eINSTANCE; - public ScenarioManager(Resource executedModel, IEventManager eventManager, IPropertyMonitor propertyMonitor) { + public ScenarioManager(Resource executedModel, IEventInterpreter eventManager, IPropertyMonitor propertyMonitor) { this.executedModel = executedModel; this.eventManager = eventManager; this.propertyMonitor = propertyMonitor; @@ -237,7 +237,7 @@ public void update(boolean propertyValue) { currentElements.remove(element); currentElements.addAll(element.getNextElements()); final EventOccurrence eventOccurrence = (EventOccurrence) element; - eventManager.sendEvent(createEvent(eventOccurrence.getEvent())); + eventManager.queueEvent(createEvent(eventOccurrence.getEvent())); // We start monitoring the guards of the next elements in // the scenario tree. eventOccurrence.getNextElements().stream().forEach(e -> { @@ -250,7 +250,7 @@ public void update(boolean propertyValue) { final ScenarioFSM fsm = (ScenarioFSM) element; final Event event = fsm.getInitialState().getEvent(); if (event != null) { - eventManager.sendEvent(createEvent(event)); + eventManager.queueEvent(createEvent(event)); } setupFSMStatePropertyListeners(fsm, fsm.getInitialState()); } @@ -281,7 +281,7 @@ public void update(boolean propertyValue) { // as this check is part of the guard of the incoming transition. final Event event = state.getEvent(); if (event != null) { - eventManager.sendEvent(createEvent(event)); + eventManager.queueEvent(createEvent(event)); } // We stop monitoring the current guard as well as // the guards of the other outgoing transitions of diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/META-INF/MANIFEST.MF index ed5f065a4..9eaf6f2ca 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/META-INF/MANIFEST.MF @@ -7,8 +7,7 @@ Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.eclipse.gemoc.event.commons.model, - org.eclipse.gemoc.event.commons.model.property, +Export-Package: org.eclipse.gemoc.event.commons.model.property, org.eclipse.gemoc.event.commons.model.property.impl, org.eclipse.gemoc.event.commons.model.property.util, org.eclipse.gemoc.event.commons.model.scenario, @@ -27,5 +26,6 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.xtext.xbase.lib, org.eclipse.xtend.lib, org.eclipse.xtend.lib.macro, - org.eclipse.gemoc.xdsmlframework.api;bundle-version="2.3.0" + org.eclipse.gemoc.xdsmlframework.api;bundle-version="2.3.0", + org.eclipse.gemoc.trace.commons.model Bundle-ActivationPolicy: lazy diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore index 474063e7e..beef81470 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/model/property.ecore @@ -56,6 +56,7 @@ + diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventManagerRegistry.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventManagerRegistry.java deleted file mode 100644 index 13922101a..000000000 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/EventManagerRegistry.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.eclipse.gemoc.event.commons.model; - -import java.util.HashSet; -import java.util.Set; - -public class EventManagerRegistry { - - private static EventManagerRegistry instance; - - private Set registeredManagers; - - private EventManagerRegistry () { - this.registeredManagers = new HashSet(); - } - - public static EventManagerRegistry getInstance() { - if(instance == null) { - instance = new EventManagerRegistry(); - } - return instance; - } - - public void registerManager(IEventManager manager) { - if(manager != null) { - registeredManagers.add(manager); - } - } - - public void unregisterManager(IEventManager manager) { - if(manager != null) { - registeredManagers.remove(manager); - } - } - - public IEventManager findEventManager() { - return registeredManagers.stream().findFirst().orElse(null); - } -} diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManager.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManager.java deleted file mode 100644 index c8cfd0871..000000000 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/IEventManager.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.gemoc.event.commons.model; - -import java.util.Set; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; - -public interface IEventManager extends IEngineAddon { - - void sendEvent(Object event); - - void manageEvents(); - - void waitForEvents(); - - Set getEventClasses(); - - boolean canSendEvent(Object event); - - void loadScenario(URI uri, ResourceSet resourceSet); - - void loadArbiter(URI arbiterURI, ResourceSet resourceSet); - - void addListener(IEventManagerListener listener); - - void removeListener(IEventManagerListener listener); -} diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/CompositeProperty.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/CompositeProperty.java index f92c0709a..841237573 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/CompositeProperty.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/CompositeProperty.java @@ -14,6 +14,7 @@ *

    *
      *
    • {@link org.eclipse.gemoc.event.commons.model.property.CompositeProperty#getProperties Properties}
    • + *
    • {@link org.eclipse.gemoc.event.commons.model.property.CompositeProperty#getOperator Operator}
    • *
    * * @see org.eclipse.gemoc.event.commons.model.property.PropertyPackage#getCompositeProperty() @@ -36,4 +37,33 @@ public interface CompositeProperty

    extends Property { */ EList

    getProperties(); + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link org.eclipse.gemoc.event.commons.model.property.BooleanOperator}. + * + *

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

    + * + * @return the value of the 'Operator' attribute. + * @see org.eclipse.gemoc.event.commons.model.property.BooleanOperator + * @see #setOperator(BooleanOperator) + * @see org.eclipse.gemoc.event.commons.model.property.PropertyPackage#getCompositeProperty_Operator() + * @model required="true" + * @generated + */ + BooleanOperator getOperator(); + + /** + * Sets the value of the '{@link org.eclipse.gemoc.event.commons.model.property.CompositeProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see org.eclipse.gemoc.event.commons.model.property.BooleanOperator + * @see #getOperator() + * @generated + */ + void setOperator(BooleanOperator value); + } // CompositeProperty diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/EnumAttributeProperty.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/EnumAttributeProperty.java new file mode 100644 index 000000000..e6514d7b1 --- /dev/null +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/EnumAttributeProperty.java @@ -0,0 +1,80 @@ +/** + */ +package org.eclipse.gemoc.event.commons.model.property; + +import org.eclipse.emf.ecore.EEnumLiteral; + +/** + * + * A representation of the model object 'Enum Attribute Property'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.gemoc.event.commons.model.property.EnumAttributeProperty#getValue Value}
    • + *
    • {@link org.eclipse.gemoc.event.commons.model.property.EnumAttributeProperty#getOperator Operator}
    • + *
    + * + * @see org.eclipse.gemoc.event.commons.model.property.PropertyPackage#getEnumAttributeProperty() + * @model abstract="true" + * @generated + */ +public interface EnumAttributeProperty extends StateProperty { + /** + * 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(EEnumLiteral) + * @see org.eclipse.gemoc.event.commons.model.property.PropertyPackage#getEnumAttributeProperty_Value() + * @model + * @generated + */ + E getValue(); + + /** + * Sets the value of the '{@link org.eclipse.gemoc.event.commons.model.property.EnumAttributeProperty#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(E value); + + /** + * Returns the value of the 'Operator' attribute. + * The literals are from the enumeration {@link org.eclipse.gemoc.event.commons.model.property.ComparisonOperator}. + * + *

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

    + * + * @return the value of the 'Operator' attribute. + * @see org.eclipse.gemoc.event.commons.model.property.ComparisonOperator + * @see #setOperator(ComparisonOperator) + * @see org.eclipse.gemoc.event.commons.model.property.PropertyPackage#getEnumAttributeProperty_Operator() + * @model + * @generated + */ + ComparisonOperator getOperator(); + + /** + * Sets the value of the '{@link org.eclipse.gemoc.event.commons.model.property.EnumAttributeProperty#getOperator Operator}' attribute. + * + * + * @param value the new value of the 'Operator' attribute. + * @see org.eclipse.gemoc.event.commons.model.property.ComparisonOperator + * @see #getOperator() + * @generated + */ + void setOperator(ComparisonOperator value); + +} // EnumAttributeProperty diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/PropertyPackage.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/PropertyPackage.java index 1790c64d2..3d17d1668 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/PropertyPackage.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/PropertyPackage.java @@ -364,6 +364,15 @@ public interface PropertyPackage extends EPackage { */ int COMPOSITE_PROPERTY__PROPERTIES = PROPERTY_FEATURE_COUNT + 0; + /** + * The feature id for the 'Operator' attribute. + * + * + * @generated + * @ordered + */ + int COMPOSITE_PROPERTY__OPERATOR = PROPERTY_FEATURE_COUNT + 1; + /** * The number of structural features of the 'Composite Property' class. * @@ -371,7 +380,7 @@ public interface PropertyPackage extends EPackage { * @generated * @ordered */ - int COMPOSITE_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 1; + int COMPOSITE_PROPERTY_FEATURE_COUNT = PROPERTY_FEATURE_COUNT + 2; /** * The number of operations of the 'Composite Property' class. @@ -1471,6 +1480,17 @@ public interface PropertyPackage extends EPackage { */ EReference getCompositeProperty_Properties(); + /** + * Returns the meta object for the attribute '{@link org.eclipse.gemoc.event.commons.model.property.CompositeProperty#getOperator Operator}'. + * + * + * @return the meta object for the attribute 'Operator'. + * @see org.eclipse.gemoc.event.commons.model.property.CompositeProperty#getOperator() + * @see #getCompositeProperty() + * @generated + */ + EAttribute getCompositeProperty_Operator(); + /** * Returns the meta object for class '{@link org.eclipse.gemoc.event.commons.model.property.EventPrecondition Event Precondition}'. * @@ -2166,6 +2186,14 @@ interface Literals { */ EReference COMPOSITE_PROPERTY__PROPERTIES = eINSTANCE.getCompositeProperty_Properties(); + /** + * The meta object literal for the 'Operator' attribute feature. + * + * + * @generated + */ + EAttribute COMPOSITE_PROPERTY__OPERATOR = eINSTANCE.getCompositeProperty_Operator(); + /** * The meta object literal for the '{@link org.eclipse.gemoc.event.commons.model.property.impl.EventPreconditionImpl Event Precondition}' class. * diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/CompositePropertyImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/CompositePropertyImpl.java index 1245e7c8f..a2016db8c 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/CompositePropertyImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/CompositePropertyImpl.java @@ -4,6 +4,7 @@ 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; @@ -11,9 +12,11 @@ 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.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.gemoc.event.commons.model.property.BooleanOperator; import org.eclipse.gemoc.event.commons.model.property.CompositeProperty; import org.eclipse.gemoc.event.commons.model.property.Property; import org.eclipse.gemoc.event.commons.model.property.PropertyPackage; @@ -27,6 +30,7 @@ *

    *
      *
    • {@link org.eclipse.gemoc.event.commons.model.property.impl.CompositePropertyImpl#getProperties Properties}
    • + *
    • {@link org.eclipse.gemoc.event.commons.model.property.impl.CompositePropertyImpl#getOperator Operator}
    • *
    * * @generated @@ -42,6 +46,25 @@ public class CompositePropertyImpl

    extends PropertyImpl impl */ protected EList

    properties; + /** + * The default value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected static final BooleanOperator OPERATOR_EDEFAULT = BooleanOperator.AND; + /** + * The cached value of the '{@link #getOperator() Operator}' attribute. + * + * + * @see #getOperator() + * @generated + * @ordered + */ + protected BooleanOperator operator = OPERATOR_EDEFAULT; + /** * * @@ -73,6 +96,27 @@ public EList

    getProperties() { return properties; } + /** + * + * + * @generated + */ + public BooleanOperator getOperator() { + return operator; + } + + /** + * + * + * @generated + */ + public void setOperator(BooleanOperator newOperator) { + BooleanOperator oldOperator = operator; + operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PropertyPackage.COMPOSITE_PROPERTY__OPERATOR, oldOperator, operator)); + } + /** * * @@ -97,6 +141,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: return getProperties(); + case PropertyPackage.COMPOSITE_PROPERTY__OPERATOR: + return getOperator(); } return super.eGet(featureID, resolve, coreType); } @@ -114,6 +160,9 @@ public void eSet(int featureID, Object newValue) { getProperties().clear(); getProperties().addAll((Collection)newValue); return; + case PropertyPackage.COMPOSITE_PROPERTY__OPERATOR: + setOperator((BooleanOperator)newValue); + return; } super.eSet(featureID, newValue); } @@ -129,6 +178,9 @@ public void eUnset(int featureID) { case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: getProperties().clear(); return; + case PropertyPackage.COMPOSITE_PROPERTY__OPERATOR: + setOperator(OPERATOR_EDEFAULT); + return; } super.eUnset(featureID); } @@ -143,8 +195,26 @@ public boolean eIsSet(int featureID) { switch (featureID) { case PropertyPackage.COMPOSITE_PROPERTY__PROPERTIES: return properties != null && !properties.isEmpty(); + case PropertyPackage.COMPOSITE_PROPERTY__OPERATOR: + return operator != OPERATOR_EDEFAULT; } return super.eIsSet(featureID); } + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (operator: "); + result.append(operator); + result.append(')'); + return result.toString(); + } + } //CompositePropertyImpl diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyPackageImpl.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyPackageImpl.java index fad0d9c72..89ec3e683 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyPackageImpl.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/impl/PropertyPackageImpl.java @@ -471,6 +471,15 @@ public EReference getCompositeProperty_Properties() { return (EReference)compositePropertyEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + public EAttribute getCompositeProperty_Operator() { + return (EAttribute)compositePropertyEClass.getEStructuralFeatures().get(1); + } + /** * * @@ -965,6 +974,7 @@ public void createPackageContents() { compositePropertyEClass = createEClass(COMPOSITE_PROPERTY); createEReference(compositePropertyEClass, COMPOSITE_PROPERTY__PROPERTIES); + createEAttribute(compositePropertyEClass, COMPOSITE_PROPERTY__OPERATOR); eventPreconditionEClass = createEClass(EVENT_PRECONDITION); createEReference(eventPreconditionEClass, EVENT_PRECONDITION__EVENT); @@ -1213,6 +1223,7 @@ public void initializePackageContents() { initEClass(compositePropertyEClass, CompositeProperty.class, "CompositeProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(compositePropertyEClass_P); initEReference(getCompositeProperty_Properties(), g1, null, "properties", null, 0, -1, CompositeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getCompositeProperty_Operator(), this.getBooleanOperator(), "operator", null, 1, 1, CompositeProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(eventPreconditionEClass, EventPrecondition.class, "EventPrecondition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(eventPreconditionEClass_E); diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertyAdapterFactory.java b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertyAdapterFactory.java index 2721d27cc..4a080497a 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertyAdapterFactory.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.event.commons.model/src/org/eclipse/gemoc/event/commons/model/property/util/PropertyAdapterFactory.java @@ -6,7 +6,6 @@ import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; - import org.eclipse.emf.ecore.EObject; import org.eclipse.gemoc.event.commons.model.property.*; diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/META-INF/MANIFEST.MF b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/META-INF/MANIFEST.MF index 365638ac9..629b59ced 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/META-INF/MANIFEST.MF +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/META-INF/MANIFEST.MF @@ -14,7 +14,8 @@ Require-Bundle: org.eclipse.gemoc.xdsmlframework.api, org.eclipse.gemoc.trace.gemoc.api;bundle-version="1.0.0", fr.inria.diverse.k3.al.annotationprocessor.plugin, org.eclipse.gemoc.trace.commons.model;bundle-version="0.1.0", - org.eclipse.gemoc.event.commons.model + org.eclipse.gemoc.event.commons.model, + org.eclipse.gemoc.event.commons.interpreter Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Export-Package: org.eclipse.gemoc.executionframework.engine, diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java index b8eee4781..9caf84ffc 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/core/AbstractSequentialExecutionEngine.java @@ -22,7 +22,9 @@ import org.eclipse.emf.ecore.EcoreFactory; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.gemoc.event.commons.model.IEventManager; +import org.eclipse.gemoc.event.commons.interpreter.EventInterpreter; +import org.eclipse.gemoc.event.commons.interpreter.IEventInterpreter; +import org.eclipse.gemoc.event.commons.interpreter.property.PropertyMonitor; import org.eclipse.gemoc.executionframework.engine.Activator; import org.eclipse.gemoc.trace.commons.model.generictrace.GenericSequentialStep; import org.eclipse.gemoc.trace.commons.model.generictrace.GenerictraceFactory; @@ -47,7 +49,7 @@ public abstract class AbstractSequentialExecutionEngine extends AbstractExecutio private MSEModel _actionModel; private IMultiDimensionalTraceAddon traceAddon; - private IEventManager eventManagerAddon; + private IEventInterpreter eventInterpreter; protected abstract void executeEntryPoint(); @@ -74,17 +76,15 @@ public final void performInitialize(IExecutionContext executionContext) { if (!traceManagers.isEmpty()) { this.traceAddon = traceManagers.iterator().next(); } - Set eventManagers = this.getAddonsTypedBy(IEventManager.class); - if (!eventManagers.isEmpty()) { - eventManagerAddon = eventManagers.iterator().next(); - URI scenarioURI = executionContext.getRunConfiguration().getScenarioURI(); - if (scenarioURI != null) { - eventManagerAddon.loadScenario(scenarioURI, executionContext.getResourceModel().getResourceSet()); - } - URI arbiterURI = executionContext.getRunConfiguration().getArbiterURI(); - if (arbiterURI != null) { - eventManagerAddon.loadArbiter(arbiterURI, executionContext.getResourceModel().getResourceSet()); - } + eventInterpreter = new EventInterpreter(); + getExecutionContext().getExecutionPlatform().addEngineAddon(eventInterpreter); + URI scenarioURI = executionContext.getRunConfiguration().getScenarioURI(); + if (scenarioURI != null) { + eventInterpreter.loadScenario(scenarioURI, executionContext.getResourceModel().getResourceSet()); + } + URI arbiterURI = executionContext.getRunConfiguration().getArbiterURI(); + if (arbiterURI != null) { + eventInterpreter.loadArbiter(arbiterURI, executionContext.getResourceModel().getResourceSet()); } prepareEntryPoint(executionContext); prepareInitializeModel(executionContext); @@ -99,8 +99,8 @@ protected final void performStart() { } private void manageEvents() { - if (eventManagerAddon != null) { - eventManagerAddon.manageEvents(); + if (eventInterpreter != null) { + eventInterpreter.processEvents(); } } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java index fac6425b8..007f43df2 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventManagerRenderer.java @@ -19,8 +19,8 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.gemoc.event.commons.model.EventInstance; -import org.eclipse.gemoc.event.commons.model.IEventManager; +import org.eclipse.gemoc.event.commons.interpreter.EventInstance; +import org.eclipse.gemoc.event.commons.interpreter.IEventInterpreter; import org.eclipse.gemoc.trace.commons.model.trace.Step; import org.eclipse.gemoc.xdsmlframework.api.core.EngineStatus.RunStatus; import org.eclipse.gemoc.xdsmlframework.api.core.IExecutionEngine; @@ -41,9 +41,14 @@ import javafx.scene.layout.VBox; import javafx.util.StringConverter; +/** + * This class provides a GUI allowing to queue events to the event interpreter. + * @author dorian leroy + * + */ public class EventManagerRenderer extends Pane implements IEngineAddon { - private IEventManager eventManager; + private IEventInterpreter eventInterpreter; private Resource executedModel; @@ -84,7 +89,7 @@ public EventManagerRenderer() { }); sendButton.setOnAction(e -> { - pushedEvents.forEach(eventManager::sendEvent); + pushedEvents.forEach(eventInterpreter::queueEvent); eventTypeToEventTableView.values().forEach(t -> t.getSelectionModel().clearSelection()); // eventTypeToSelectedEvents.forEach((k,v) -> v.clear()); pushedEvents.clear(); @@ -126,7 +131,7 @@ public EClass fromString(String string) { eventTypeToSelectedEvents.remove(e); }); c.getAddedSubList().stream().forEach(e -> { - final EventTableView tableView = new EventTableView(e, executedModel, eventManager); + final EventTableView tableView = new EventTableView(e, executedModel, eventInterpreter); eventTypeToEventTableView.put(e, tableView); final List selectedEvents = new ArrayList<>(); eventTypeToSelectedEvents.put(e, selectedEvents); @@ -147,12 +152,16 @@ public EClass fromString(String string) { eventList.addListener(eventTypesChangeListener); } - public void setEventManager(IEventManager eventManager) { + /** + * Sets the interpreter linked to this event manager + * @param eventInterpreter the event interpreter + */ + public void setEventInterpreter(IEventInterpreter eventInterpreter) { Runnable runnable = () -> { - this.eventManager = eventManager; + this.eventInterpreter = eventInterpreter; eventList.clear(); - if (eventManager != null) { - eventList.addAll(this.eventManager.getEventClasses()); + if (eventInterpreter != null) { +// eventList.addAll(this.eventInterpreter.getEventClasses()); } }; if (!Platform.isFxApplicationThread()) { @@ -193,9 +202,9 @@ public void engineStarted(IExecutionEngine executionEngine) { @Override public void engineInitialized(IExecutionEngine executionEngine) { - Set eventManagers = executionEngine.getAddonsTypedBy(IEventManager.class); + Set eventManagers = executionEngine.getAddonsTypedBy(IEventInterpreter.class); if (!eventManagers.isEmpty()) { - setEventManager(eventManagers.iterator().next()); + setEventInterpreter(eventManagers.iterator().next()); } } diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventPane.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventPane.java index 62ef1e02b..9dec20209 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventPane.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventPane.java @@ -12,15 +12,15 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.gemoc.event.commons.interpreter.IEventInterpreter; -import org.eclipse.gemoc.event.commons.model.IEventManager; import javafx.scene.layout.BorderPane; public class EventPane extends BorderPane { private final EventTableView tableView; - public EventPane(EClass eventClass, final Resource executedModel, final IEventManager eventManager) { + public EventPane(EClass eventClass, final Resource executedModel, final IEventInterpreter eventManager) { tableView = new EventTableView(eventClass, executedModel, eventManager); setCenter(tableView); tableView.refreshEvents(); diff --git a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventTableView.java b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventTableView.java index 27fbb15c8..260bf0c77 100644 --- a/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventTableView.java +++ b/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.eventmanager/src/org/eclipse/gemoc/executionframework/eventmanager/views/EventTableView.java @@ -26,8 +26,8 @@ import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.gemoc.event.commons.model.EventInstance; -import org.eclipse.gemoc.event.commons.model.IEventManager; +import org.eclipse.gemoc.event.commons.interpreter.EventInstance; +import org.eclipse.gemoc.event.commons.interpreter.IEventInterpreter; import org.eclipse.gemoc.event.commons.model.scenario.Event; import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; import org.eclipse.xtext.naming.QualifiedName; @@ -61,7 +61,7 @@ public class EventTableView extends TableView { private final Function canDisplayEventFunction; - public EventTableView(final EClass eventClass, final Resource executedModel, final IEventManager eventManager) { + public EventTableView(final EClass eventClass, final Resource executedModel, final IEventInterpreter eventManager) { this.eventClass = eventClass; this.factory = eventClass.getEPackage().getEFactoryInstance(); this.executedModel = executedModel; diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/GenericTraceConstructor.java b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/GenericTraceConstructor.java index 38d83870f..02a6496a0 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/GenericTraceConstructor.java +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/GenericTraceConstructor.java @@ -80,7 +80,7 @@ private Set getAllExecutedModelResources() { allResources.removeIf(r -> r == null); return allResources; } - + private boolean addNewObjectToStateIfDynamic(EObject object, GenericState state) { final EClass c = object.eClass(); final List mutableProperties = c.getEAllStructuralFeatures().stream()