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 000000000..5452ecdc3 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ContainerReferenceProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyBooleanAttributeProperty.gif new file mode 100644 index 000000000..5a0697e63 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyBooleanAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyIntegerAttributeProperty.gif new file mode 100644 index 000000000..d02196365 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyIntegerAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyStringAttributeProperty.gif new file mode 100644 index 000000000..6dffd43dc Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_left_ManyStringAttributeProperty.gif differ 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 000000000..5452ecdc3 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ContainerReferenceProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyBooleanAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyBooleanAttributeProperty.gif new file mode 100644 index 000000000..5a0697e63 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyBooleanAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyIntegerAttributeProperty.gif new file mode 100644 index 000000000..d02196365 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyIntegerAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyStringAttributeProperty.gif new file mode 100644 index 000000000..6dffd43dc Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateBinaryProperty_right_ManyStringAttributeProperty.gif differ 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 000000000..3070b3d0c Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ContainerReferenceProperty.gif differ 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 000000000..91a611a1d Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyBooleanAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyIntegerAttributeProperty.gif new file mode 100644 index 000000000..d72e36b9e Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyIntegerAttributeProperty.gif differ 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 000000000..548b80529 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateContainerReferenceProperty_property_ManyStringAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ContainerReferenceProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ContainerReferenceProperty.gif new file mode 100644 index 000000000..3070b3d0c Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ContainerReferenceProperty.gif differ 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 000000000..91a611a1d Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyBooleanAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyIntegerAttributeProperty.gif new file mode 100644 index 000000000..d72e36b9e Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyIntegerAttributeProperty.gif differ 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 000000000..548b80529 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateManyReferenceProperty_property_ManyStringAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReport_stages_StageReport.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReport_stages_StageReport.gif new file mode 100644 index 000000000..b42028e70 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateReport_stages_StageReport.gif differ 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 000000000..6966d766e Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ContainerReferenceProperty.gif differ 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 000000000..3b01cc94e Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyBooleanAttributeProperty.gif differ 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 000000000..bc083830b Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyIntegerAttributeProperty.gif differ 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 000000000..eab3c353c Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateSingleReferenceProperty_property_ManyStringAttributeProperty.gif differ 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 000000000..88d884410 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyBooleanAttributeProperty.gif differ 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/CreateStage_property_ManyIntegerAttributeProperty.gif new file mode 100644 index 000000000..9a2424e4e Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyIntegerAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyStringAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyStringAttributeProperty.gif new file mode 100644 index 000000000..86d7811dd Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/ctool16/CreateStage_property_ManyStringAttributeProperty.gif differ 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 000000000..e4b530eca Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ContainerReferenceProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Event.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Event.gif new file mode 100644 index 000000000..e4b530eca Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Event.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/IntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/IntegerAttributeProperty.gif new file mode 100644 index 000000000..30f0c48da Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/IntegerAttributeProperty.gif differ 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 000000000..33854e98c Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyBooleanAttributeProperty.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyIntegerAttributeProperty.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyIntegerAttributeProperty.gif new file mode 100644 index 000000000..a3908bcf7 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyIntegerAttributeProperty.gif differ 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 000000000..a26660ec2 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/ManyStringAttributeProperty.gif differ 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 000000000..33854e98c Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Report.gif differ diff --git a/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Scenario.gif b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Scenario.gif new file mode 100644 index 000000000..7bac4fd38 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/Scenario.gif differ 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 000000000..904159880 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.edit/icons/full/obj16/StageReport.gif differ 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 000000000..dd4fa0a2b Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/PropertyModelFile.gif differ 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 000000000..26ea9421d Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/obj16/ReportModelFile.gif differ 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 000000000..e52cb90c7 Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewProperty.gif differ 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 000000000..023a6d4bd Binary files /dev/null and b/framework/execution_framework/plugins/fr.inria.diverse.event.commons.model.editor/icons/full/wizban/NewReport.gif differ 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);