diff --git a/eclipse-workspace/.metadata/.log b/eclipse-workspace/.metadata/.log new file mode 100644 index 0000000..031ef51 --- /dev/null +++ b/eclipse-workspace/.metadata/.log @@ -0,0 +1,409 @@ + +!ENTRY org.eclipse.emf.cdo.explorer 4 0 2021-10-09 18:08:30.240 +!MESSAGE InterruptedException +!STACK 0 +java.lang.InterruptedException + at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1343) + at java.base/java.util.concurrent.Semaphore.acquire(Semaphore.java:318) + at org.eclipse.net4j.util.lifecycle.Lifecycle.lock(Lifecycle.java:312) + at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:118) + at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalDeactivate(ShareableLifecycle.java:52) + at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:170) + at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:235) + at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:225) + at org.eclipse.emf.cdo.internal.explorer.bundle.OM.disposeManagers(OM.java:83) + at org.eclipse.emf.cdo.internal.explorer.bundle.OM$Activator.doStop(OM.java:136) + at org.eclipse.net4j.util.om.OSGiActivator.stop(OSGiActivator.java:92) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:871) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) + at java.base/java.security.AccessController.doPrivileged(Native Method) + at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:863) + at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:1025) + at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:370) + at org.eclipse.osgi.container.Module.doStop(Module.java:660) + at org.eclipse.osgi.container.Module.stop(Module.java:521) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1886) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1761) + at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:275) + at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:202) + at org.eclipse.osgi.container.Module.doStop(Module.java:660) + at org.eclipse.osgi.container.Module.stop(Module.java:521) + at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:207) + at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:220) + at java.base/java.lang.Thread.run(Thread.java:829) +!SESSION 2021-10-09 18:08:31.914 ----------------------------------------------- +eclipse.buildId=4.17.0.I20200902-1800 +java.version=11.0.11 +java.vendor=Ubuntu +BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=fr_FR +Framework arguments: -product org.eclipse.epp.package.modeling.product +Command-line arguments: -data file:/home/lfainsin/miniproj_idm/eclipse-workspace/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.modeling.product -clean + +!ENTRY org.eclipse.emf.cdo.explorer 4 0 2021-10-09 18:13:58.005 +!MESSAGE InterruptedException +!STACK 0 +java.lang.InterruptedException + at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1343) + at java.base/java.util.concurrent.Semaphore.acquire(Semaphore.java:318) + at org.eclipse.net4j.util.lifecycle.Lifecycle.lock(Lifecycle.java:312) + at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:118) + at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalDeactivate(ShareableLifecycle.java:52) + at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:170) + at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:235) + at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:225) + at org.eclipse.emf.cdo.internal.explorer.bundle.OM.disposeManagers(OM.java:83) + at org.eclipse.emf.cdo.internal.explorer.bundle.OM$Activator.doStop(OM.java:136) + at org.eclipse.net4j.util.om.OSGiActivator.stop(OSGiActivator.java:92) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:871) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) + at java.base/java.security.AccessController.doPrivileged(Native Method) + at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:863) + at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:1025) + at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:370) + at org.eclipse.osgi.container.Module.doStop(Module.java:660) + at org.eclipse.osgi.container.Module.stop(Module.java:521) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1886) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1761) + at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:275) + at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:202) + at org.eclipse.osgi.container.Module.doStop(Module.java:660) + at org.eclipse.osgi.container.Module.stop(Module.java:521) + at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:207) + at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:220) + at java.base/java.lang.Thread.run(Thread.java:829) +!SESSION 2021-10-09 18:13:59.690 ----------------------------------------------- +eclipse.buildId=4.17.0.I20200902-1800 +java.version=11.0.11 +java.vendor=Ubuntu +BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=fr_FR +Framework arguments: -product org.eclipse.epp.package.modeling.product +Command-line arguments: -data file:/home/lfainsin/miniproj_idm/eclipse-workspace/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.modeling.product -clean + +!ENTRY org.eclipse.jface 4 2 2021-10-09 18:15:16.991 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". +!STACK 0 +java.lang.NullPointerException + at petrinet.provider.ArcItemProvider.getText(ArcItemProvider.java:157) + at org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider.getText(AdapterFactoryLabelProvider.java:424) + at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerLabelProvider.java:99) + at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:148) + at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144) + at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:959) + at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:126) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1037) + at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:427) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2111) + at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:853) + at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:831) + at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:604) + at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:779) + at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1690) + at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2557) + at org.eclipse.jface.viewers.StructuredViewer.setSelectionToWidget(StructuredViewer.java:1704) + at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:3029) + at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1660) + at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1084) + at petrinet.presentation.PetrinetEditor$5.run(PetrinetEditor.java:773) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4988) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4510) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:153) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.jface 4 2 2021-10-09 18:15:17.057 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". +!STACK 0 +java.lang.NullPointerException + at petrinet.provider.ArcItemProvider.getText(ArcItemProvider.java:157) + at org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator.getText(AdapterFactoryItemDelegator.java:84) + at petrinet.presentation.PetrinetEditor.setStatusLineManager(PetrinetEditor.java:1711) + at petrinet.presentation.PetrinetEditor.setSelection(PetrinetEditor.java:1690) + at petrinet.presentation.PetrinetEditor$6.selectionChanged(PetrinetEditor.java:886) + at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148) + at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2132) + at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1662) + at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1084) + at petrinet.presentation.PetrinetEditor$5.run(PetrinetEditor.java:773) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4988) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4510) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:153) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.jface 4 2 2021-10-09 18:15:36.831 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". +!STACK 0 +java.lang.NullPointerException + at petrinet.provider.ArcItemProvider.getText(ArcItemProvider.java:157) + at org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider.getText(AdapterFactoryLabelProvider.java:424) + at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerLabelProvider.java:99) + at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:148) + at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144) + at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:959) + at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:126) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1037) + at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:427) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2111) + at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:853) + at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:831) + at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:604) + at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:779) + at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1690) + at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2557) + at org.eclipse.jface.viewers.StructuredViewer.setSelectionToWidget(StructuredViewer.java:1704) + at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:3029) + at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1660) + at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1084) + at petrinet.presentation.PetrinetEditor$5.run(PetrinetEditor.java:773) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4988) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4510) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:153) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.jface 4 2 2021-10-09 18:15:36.999 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". +!STACK 0 +java.lang.NullPointerException + at petrinet.provider.ArcItemProvider.getText(ArcItemProvider.java:157) + at org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider.getText(AdapterFactoryLabelProvider.java:424) + at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerLabelProvider.java:99) + at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:148) + at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144) + at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:959) + at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:126) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1037) + at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:427) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2111) + at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:853) + at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:831) + at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:604) + at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:779) + at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1690) + at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2557) + at org.eclipse.jface.viewers.StructuredViewer.setSelectionToWidget(StructuredViewer.java:1704) + at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:3029) + at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1660) + at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1084) + at petrinet.presentation.PetrinetEditor$5.run(PetrinetEditor.java:773) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4988) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4510) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:153) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.jface 4 2 2021-10-09 18:15:37.013 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". +!STACK 0 +java.lang.NullPointerException + at petrinet.provider.ArcItemProvider.getText(ArcItemProvider.java:157) + at org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator.getText(AdapterFactoryItemDelegator.java:84) + at petrinet.presentation.PetrinetEditor.setStatusLineManager(PetrinetEditor.java:1711) + at petrinet.presentation.PetrinetEditor.setSelection(PetrinetEditor.java:1690) + at petrinet.presentation.PetrinetEditor$6.selectionChanged(PetrinetEditor.java:886) + at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148) + at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2132) + at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1662) + at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1084) + at petrinet.presentation.PetrinetEditor$5.run(PetrinetEditor.java:773) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4988) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4510) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:153) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.emf.cdo.explorer 4 0 2021-10-09 18:18:34.904 +!MESSAGE InterruptedException +!STACK 0 +java.lang.InterruptedException + at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1343) + at java.base/java.util.concurrent.Semaphore.acquire(Semaphore.java:318) + at org.eclipse.net4j.util.lifecycle.Lifecycle.lock(Lifecycle.java:312) + at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:118) + at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalDeactivate(ShareableLifecycle.java:52) + at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:170) + at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:235) + at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:225) + at org.eclipse.emf.cdo.internal.explorer.bundle.OM.disposeManagers(OM.java:83) + at org.eclipse.emf.cdo.internal.explorer.bundle.OM$Activator.doStop(OM.java:136) + at org.eclipse.net4j.util.om.OSGiActivator.stop(OSGiActivator.java:92) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:871) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) + at java.base/java.security.AccessController.doPrivileged(Native Method) + at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:863) + at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:1025) + at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:370) + at org.eclipse.osgi.container.Module.doStop(Module.java:660) + at org.eclipse.osgi.container.Module.stop(Module.java:521) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1886) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1761) + at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:275) + at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:202) + at org.eclipse.osgi.container.Module.doStop(Module.java:660) + at org.eclipse.osgi.container.Module.stop(Module.java:521) + at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:207) + at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:220) + at java.base/java.lang.Thread.run(Thread.java:829) +!SESSION 2021-10-09 18:18:36.624 ----------------------------------------------- +eclipse.buildId=4.17.0.I20200902-1800 +java.version=11.0.11 +java.vendor=Ubuntu +BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=fr_FR +Framework arguments: -product org.eclipse.epp.package.modeling.product +Command-line arguments: -data file:/home/lfainsin/miniproj_idm/eclipse-workspace/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.modeling.product -clean + +!ENTRY org.eclipse.emf.cdo.explorer 4 0 2021-10-09 18:37:11.545 +!MESSAGE InterruptedException +!STACK 0 +java.lang.InterruptedException + at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1343) + at java.base/java.util.concurrent.Semaphore.acquire(Semaphore.java:318) + at org.eclipse.net4j.util.lifecycle.Lifecycle.lock(Lifecycle.java:312) + at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:118) + at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalDeactivate(ShareableLifecycle.java:52) + at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:170) + at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:235) + at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:225) + at org.eclipse.emf.cdo.internal.explorer.bundle.OM.disposeManagers(OM.java:83) + at org.eclipse.emf.cdo.internal.explorer.bundle.OM$Activator.doStop(OM.java:136) + at org.eclipse.net4j.util.om.OSGiActivator.stop(OSGiActivator.java:92) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:871) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) + at java.base/java.security.AccessController.doPrivileged(Native Method) + at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:863) + at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:1025) + at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:370) + at org.eclipse.osgi.container.Module.doStop(Module.java:660) + at org.eclipse.osgi.container.Module.stop(Module.java:521) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1886) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1761) + at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:275) + at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:202) + at org.eclipse.osgi.container.Module.doStop(Module.java:660) + at org.eclipse.osgi.container.Module.stop(Module.java:521) + at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:207) + at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:220) + at java.base/java.lang.Thread.run(Thread.java:829) diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/34/903dbca91929001c16f5c57107a74969 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/34/903dbca91929001c16f5c57107a74969 new file mode 100644 index 0000000..7351e1c --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/34/903dbca91929001c16f5c57107a74969 @@ -0,0 +1,2 @@ + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/45/801c56b11729001c179f8f9c3468d9fc b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/45/801c56b11729001c179f8f9c3468d9fc new file mode 100644 index 0000000..997e2c5 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/45/801c56b11729001c179f8f9c3468d9fc @@ -0,0 +1,3 @@ + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4d/d0a85ef61a29001c1dd68691abc22857 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4d/d0a85ef61a29001c1dd68691abc22857 new file mode 100644 index 0000000..09fab0e --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4d/d0a85ef61a29001c1dd68691abc22857 @@ -0,0 +1,628 @@ +/** + */ +package petrinet.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 petrinet.PetrinetFactory; +import petrinet.PetrinetPackage; +import petrinet.provider.PetrinetEditPlugin; + + +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 PetrinetModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected PetrinetPackage petrinetPackage = PetrinetPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected PetrinetFactory petrinetFactory = petrinetPackage.getPetrinetFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected PetrinetModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected PetrinetModelWizardInitialObjectCreationPage 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(PetrinetEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(PetrinetEditorPlugin.INSTANCE.getImage("full/wizban/NewPetrinet"))); + } + + /** + * 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 : petrinetPackage.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)petrinetPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = petrinetFactory.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) { + PetrinetEditorPlugin.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(), PetrinetEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } + catch (Exception exception) { + PetrinetEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class PetrinetModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public PetrinetModelWizardNewFileCreationPage(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(PetrinetEditorPlugin.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 PetrinetModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public PetrinetModelWizardInitialObjectCreationPage(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(PetrinetEditorPlugin.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(PetrinetEditorPlugin.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 PetrinetEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } + catch(MissingResourceException mre) { + PetrinetEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(PetrinetEditorPlugin.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 PetrinetModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetModelWizard_label")); + newFileCreationPage.setDescription(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetModelWizard_description")); + newFileCreationPage.setFileName(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetEditorFilenameDefaultBase") + "." + 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 = PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetEditorFilenameDefaultBase"); + 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 PetrinetModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetModelWizard_label")); + initialObjectCreationPage.setDescription(PetrinetEditorPlugin.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/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/54/40937d231f29001c19ddf116589f8e2b b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/54/40937d231f29001c19ddf116589f8e2b new file mode 100644 index 0000000..7322b80 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/54/40937d231f29001c19ddf116589f8e2b @@ -0,0 +1,85 @@ +package simplepdl.manip; + +import java.io.IOException; +import java.util.Collections; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import petrinet.PetrinetPackage; +import simplepdl.Process; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; + +public class SimplePDLCreator { + + public static void main(String[] args) { + + // Charger le package SimplePDL afin de l'enregistrer dans le registre d'Eclipse. + SimplepdlPackage packageInstance = SimplepdlPackage.eINSTANCE; + + // Enregistrer l'extension ".xmi" comme devant être ouverte à + // l'aide d'un objet "XMIResourceFactoryImpl" + Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; + Map m = reg.getExtensionToFactoryMap(); + m.put("xmi", new XMIResourceFactoryImpl()); + + // Créer un objet resourceSetImpl qui contiendra une ressource EMF (le modèle) + ResourceSet resSet = new ResourceSetImpl(); + + // Définir la ressource (le modèle) + URI modelURI = URI.createURI("models/SimplePDLCreator_Created_Process.xmi"); + Resource resource = resSet.createResource(modelURI); + + // La fabrique pour fabriquer les éléments de SimplePDL + SimplepdlFactory myFactory = SimplepdlFactory.eINSTANCE; + + // Créer un élément Process + Process process = myFactory.createProcess(); + process.setName("Mon premier processus"); + + // Ajouter le Process dans le modèle + resource.getContents().add(process); + + // Ajouter deux WorkDefinitions + WorkDefinition wd1 = myFactory.createWorkDefinition(); + wd1.setName("Ma première WorkDefinition, quelle émotion"); + + WorkDefinition wd2 = myFactory.createWorkDefinition(); + wd2.setName("Ma deuxième WorkDefinition, toujours autant d'émotion"); + + process.getProcessElements().add(wd1); + process.getProcessElements().add(wd2); + + // Ajouter une WorkSequence entre les deux WorkDefinitions + WorkSequence seq = myFactory.createWorkSequence(); + seq.setPredecessor(wd1); + seq.setSuccessor(wd2); + seq.setLinkType(WorkSequenceType.FINISH_TO_FINISH); + + process.getProcessElements().add(seq); + + // Ajouter une deuxième WorkSequence entre les deux WorkDefinitions + WorkSequence seq2 = myFactory.createWorkSequence(); + seq2.setPredecessor(wd1); + seq2.setSuccessor(wd2); + seq2.setLinkType(WorkSequenceType.START_TO_START); + + process.getProcessElements().add(seq2); + + + // Sauver la ressource + try { + resource.save(Collections.EMPTY_MAP); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/71/d0d509551629001c179f8f9c3468d9fc b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/71/d0d509551629001c179f8f9c3468d9fc new file mode 100644 index 0000000..f2856ba --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/71/d0d509551629001c179f8f9c3468d9fc @@ -0,0 +1,180 @@ +/** + */ +package simplepdl.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import simplepdl.SimplepdlPackage; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; + +/** + * This is the item provider adapter for a {@link simplepdl.WorkSequence} object. + * + * + * @generated + */ +public class WorkSequenceItemProvider extends ProcessElementItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public WorkSequenceItemProvider(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); + + addLinkTypePropertyDescriptor(object); + addPredecessorPropertyDescriptor(object); + addSuccessorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Link Type feature. + * + * + * @generated + */ + protected void addLinkTypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkSequence_linkType_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_linkType_feature", "_UI_WorkSequence_type"), + SimplepdlPackage.Literals.WORK_SEQUENCE__LINK_TYPE, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Predecessor feature. + * + * + * @generated + */ + protected void addPredecessorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkSequence_predecessor_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_predecessor_feature", "_UI_WorkSequence_type"), + SimplepdlPackage.Literals.WORK_SEQUENCE__PREDECESSOR, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Successor feature. + * + * + * @generated + */ + protected void addSuccessorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkSequence_successor_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_successor_feature", "_UI_WorkSequence_type"), + SimplepdlPackage.Literals.WORK_SEQUENCE__SUCCESSOR, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns WorkSequence.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/WorkSequence")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + WorkSequenceType labelValue = ((WorkSequence)object).getLinkType(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? + getString("_UI_WorkSequence_type") : + getString("_UI_WorkSequence_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(WorkSequence.class)) { + case SimplepdlPackage.WORK_SEQUENCE__LINK_TYPE: + 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/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/87/b02de2391c29001c12648bc555b41f99 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/87/b02de2391c29001c12648bc555b41f99 new file mode 100644 index 0000000..ba099b3 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/87/b02de2391c29001c12648bc555b41f99 @@ -0,0 +1,207 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.Arc; +import petrinet.PetrinetPackage; + +/** + * This is the item provider adapter for a {@link petrinet.Arc} object. + * + * + * @generated + */ +public class ArcItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ArcItemProvider(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); + + addWeightPropertyDescriptor(object); + addOutgoingPropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Weight feature. + * + * + * @generated + */ + protected void addWeightPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_weight_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_weight_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__WEIGHT, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Outgoing feature. + * + * + * @generated + */ + protected void addOutgoingPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_outgoing_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_outgoing_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__OUTGOING, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_target_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Arc.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Arc")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + boolean outgoing = ((Arc)object).isOutgoing(); + int weight = ((Arc)object).getWeight(); + String target = ((Arc)object).getTarget().getName(); + return outgoing ? + " --" + weight + "--> " + target : + "<--" + weight + "-- " + target; + } + + + /** + * 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(Arc.class)) { + case PetrinetPackage.ARC__WEIGHT: + case PetrinetPackage.ARC__OUTGOING: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return PetrinetEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9b/c08b866d1c29001c12648bc555b41f99 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9b/c08b866d1c29001c12648bc555b41f99 new file mode 100644 index 0000000..ba099b3 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9b/c08b866d1c29001c12648bc555b41f99 @@ -0,0 +1,207 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.Arc; +import petrinet.PetrinetPackage; + +/** + * This is the item provider adapter for a {@link petrinet.Arc} object. + * + * + * @generated + */ +public class ArcItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ArcItemProvider(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); + + addWeightPropertyDescriptor(object); + addOutgoingPropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Weight feature. + * + * + * @generated + */ + protected void addWeightPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_weight_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_weight_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__WEIGHT, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Outgoing feature. + * + * + * @generated + */ + protected void addOutgoingPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_outgoing_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_outgoing_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__OUTGOING, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_target_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Arc.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Arc")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + boolean outgoing = ((Arc)object).isOutgoing(); + int weight = ((Arc)object).getWeight(); + String target = ((Arc)object).getTarget().getName(); + return outgoing ? + " --" + weight + "--> " + target : + "<--" + weight + "-- " + target; + } + + + /** + * 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(Arc.class)) { + case PetrinetPackage.ARC__WEIGHT: + case PetrinetPackage.ARC__OUTGOING: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return PetrinetEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9c/105c2e781c29001c12648bc555b41f99 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9c/105c2e781c29001c12648bc555b41f99 new file mode 100644 index 0000000..7351e1c --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9c/105c2e781c29001c12648bc555b41f99 @@ -0,0 +1,2 @@ + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9f/505efc771629001c179f8f9c3468d9fc b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9f/505efc771629001c179f8f9c3468d9fc new file mode 100644 index 0000000..680995f --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9f/505efc771629001c179f8f9c3468d9fc @@ -0,0 +1,185 @@ +/** + */ +package simplepdl.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import simplepdl.SimplepdlPackage; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; + +/** + * This is the item provider adapter for a {@link simplepdl.WorkSequence} object. + * + * + * @generated + */ +public class WorkSequenceItemProvider extends ProcessElementItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public WorkSequenceItemProvider(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); + + addLinkTypePropertyDescriptor(object); + addPredecessorPropertyDescriptor(object); + addSuccessorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Link Type feature. + * + * + * @generated + */ + protected void addLinkTypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkSequence_linkType_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_linkType_feature", "_UI_WorkSequence_type"), + SimplepdlPackage.Literals.WORK_SEQUENCE__LINK_TYPE, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Predecessor feature. + * + * + * @generated + */ + protected void addPredecessorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkSequence_predecessor_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_predecessor_feature", "_UI_WorkSequence_type"), + SimplepdlPackage.Literals.WORK_SEQUENCE__PREDECESSOR, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Successor feature. + * + * + * @generated + */ + protected void addSuccessorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkSequence_successor_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_successor_feature", "_UI_WorkSequence_type"), + SimplepdlPackage.Literals.WORK_SEQUENCE__SUCCESSOR, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns WorkSequence.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/WorkSequence")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + WorkSequence ws = (WorkSequence) object; + WorkSequenceType labelValue = ws.getLinkType(); + String label = "--" + (labelValue == null ? "?" : labelValue.toString()) + "-->"; + String previous = ws.getPredecessor() == null ? "?" : ws.getPredecessor().getName(); + String next = ws.getSuccessor() == null ? "?" : ws.getSuccessor().getName(); + return label == null || label.length() == 0 ? + getString("_UI_WorkSequence_type") : + getString("_UI_WorkSequence_type") + " " + previous + " " + label + " " + next; + } + + + /** + * 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(WorkSequence.class)) { + case SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR: + case SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR: + case SimplepdlPackage.WORK_SEQUENCE__LINK_TYPE: + 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/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a9/509375271d29001c19ddf116589f8e2b b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a9/509375271d29001c19ddf116589f8e2b new file mode 100644 index 0000000..a3619d9 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a9/509375271d29001c19ddf116589f8e2b @@ -0,0 +1,86 @@ +package simplepdl.manip; + +import java.io.IOException; +import java.util.Collections; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import petrinet.PetrinetPackage; +import simplepdl.Process; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; + +public class SimplePDLCreator { + + public static void main(String[] args) { + + // Charger le package SimplePDL afin de l'enregistrer dans le registre d'Eclipse. + SimplepdlPackage packageInstance = SimplepdlPackage.eINSTANCE; + PetrinetPackage packageInstance = PetrinetPackage.eINSTANCE; + + // Enregistrer l'extension ".xmi" comme devant être ouverte à + // l'aide d'un objet "XMIResourceFactoryImpl" + Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; + Map m = reg.getExtensionToFactoryMap(); + m.put("xmi", new XMIResourceFactoryImpl()); + + // Créer un objet resourceSetImpl qui contiendra une ressource EMF (le modèle) + ResourceSet resSet = new ResourceSetImpl(); + + // Définir la ressource (le modèle) + URI modelURI = URI.createURI("models/SimplePDLCreator_Created_Process.xmi"); + Resource resource = resSet.createResource(modelURI); + + // La fabrique pour fabriquer les éléments de SimplePDL + SimplepdlFactory myFactory = SimplepdlFactory.eINSTANCE; + + // Créer un élément Process + Process process = myFactory.createProcess(); + process.setName("Mon premier processus"); + + // Ajouter le Process dans le modèle + resource.getContents().add(process); + + // Ajouter deux WorkDefinitions + WorkDefinition wd1 = myFactory.createWorkDefinition(); + wd1.setName("Ma première WorkDefinition, quelle émotion"); + + WorkDefinition wd2 = myFactory.createWorkDefinition(); + wd2.setName("Ma deuxième WorkDefinition, toujours autant d'émotion"); + + process.getProcessElements().add(wd1); + process.getProcessElements().add(wd2); + + // Ajouter une WorkSequence entre les deux WorkDefinitions + WorkSequence seq = myFactory.createWorkSequence(); + seq.setPredecessor(wd1); + seq.setSuccessor(wd2); + seq.setLinkType(WorkSequenceType.FINISH_TO_FINISH); + + process.getProcessElements().add(seq); + + // Ajouter une deuxième WorkSequence entre les deux WorkDefinitions + WorkSequence seq2 = myFactory.createWorkSequence(); + seq2.setPredecessor(wd1); + seq2.setSuccessor(wd2); + seq2.setLinkType(WorkSequenceType.START_TO_START); + + process.getProcessElements().add(seq2); + + + // Sauver la ressource + try { + resource.save(Collections.EMPTY_MAP); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ac/c0cc61dd1c29001c19ddf116589f8e2b b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ac/c0cc61dd1c29001c19ddf116589f8e2b new file mode 100644 index 0000000..f70e5e8 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ac/c0cc61dd1c29001c19ddf116589f8e2b @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ae/508e8b201d29001c19ddf116589f8e2b b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ae/508e8b201d29001c19ddf116589f8e2b new file mode 100644 index 0000000..6b570f8 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ae/508e8b201d29001c19ddf116589f8e2b @@ -0,0 +1,85 @@ +package simplepdl.manip; + +import java.io.IOException; +import java.util.Collections; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; + +import simplepdl.Process; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; + +public class SimplePDLCreator { + + public static void main(String[] args) { + + // Charger le package SimplePDL afin de l'enregistrer dans le registre d'Eclipse. + SimplepdlPackage packageInstance = SimplepdlPackage.eINSTANCE; + + // Enregistrer l'extension ".xmi" comme devant être ouverte à + // l'aide d'un objet "XMIResourceFactoryImpl" + Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; + Map m = reg.getExtensionToFactoryMap(); + m.put("xmi", new XMIResourceFactoryImpl()); + + // Créer un objet resourceSetImpl qui contiendra une ressource EMF (le modèle) + ResourceSet resSet = new ResourceSetImpl(); + + // Définir la ressource (le modèle) + URI modelURI = URI.createURI("models/SimplePDLCreator_Created_Process.xmi"); + Resource resource = resSet.createResource(modelURI); + + // La fabrique pour fabriquer les éléments de SimplePDL + SimplepdlFactory myFactory = SimplepdlFactory.eINSTANCE; + + // Créer un élément Process + Process process = myFactory.createProcess(); + process.setName("Mon premier processus"); + + // Ajouter le Process dans le modèle + resource.getContents().add(process); + + // Ajouter deux WorkDefinitions + WorkDefinition wd1 = myFactory.createWorkDefinition(); + wd1.setName("Ma première WorkDefinition, quelle émotion"); + + WorkDefinition wd2 = myFactory.createWorkDefinition(); + wd2.setName("Ma deuxième WorkDefinition, toujours autant d'émotion"); + + process.getProcessElements().add(wd1); + process.getProcessElements().add(wd2); + + // Ajouter une WorkSequence entre les deux WorkDefinitions + WorkSequence seq = myFactory.createWorkSequence(); + seq.setPredecessor(wd1); + seq.setSuccessor(wd2); + seq.setLinkType(WorkSequenceType.FINISH_TO_FINISH); + + process.getProcessElements().add(seq); + + // Ajouter une deuxième WorkSequence entre les deux WorkDefinitions + WorkSequence seq2 = myFactory.createWorkSequence(); + seq2.setPredecessor(wd1); + seq2.setSuccessor(wd2); + seq2.setLinkType(WorkSequenceType.START_TO_START); + + process.getProcessElements().add(seq2); + + + // Sauver la ressource + try { + resource.save(Collections.EMPTY_MAP); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/be/00bccd1a1729001c179f8f9c3468d9fc b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/be/00bccd1a1729001c179f8f9c3468d9fc new file mode 100644 index 0000000..4a3ade7 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/be/00bccd1a1729001c179f8f9c3468d9fc @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.simplepdl;singleton:=true +Automatic-Module-Name: fr.n7.simplepdl +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: simplepdl, + simplepdl.impl, + simplepdl.util +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bf/80d11eaf1429001c189bd9f274e24b43 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bf/80d11eaf1429001c189bd9f274e24b43 new file mode 100644 index 0000000..dcf0d50 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bf/80d11eaf1429001c189bd9f274e24b43 @@ -0,0 +1,2 @@ + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c4/806b1ef61a29001c1dd68691abc22857 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c4/806b1ef61a29001c1dd68691abc22857 new file mode 100644 index 0000000..c3565c0 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c4/806b1ef61a29001c1dd68691abc22857 @@ -0,0 +1,207 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.Arc; +import petrinet.PetrinetPackage; + +/** + * This is the item provider adapter for a {@link petrinet.Arc} object. + * + * + * @generated + */ +public class ArcItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ArcItemProvider(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); + + addWeightPropertyDescriptor(object); + addOutgoingPropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Weight feature. + * + * + * @generated + */ + protected void addWeightPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_weight_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_weight_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__WEIGHT, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Outgoing feature. + * + * + * @generated + */ + protected void addOutgoingPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_outgoing_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_outgoing_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__OUTGOING, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_target_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Arc.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Arc")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + boolean sortant = ((Arc)object).isOutgoing(); + int poids = ((Arc)object).getWeight(); + String cible = ((Arc)object).getTarget().getName(); + return sortant ? + "--" + poids + "--> " + cible : + "<--" + poids + "-- " + cible; + } + + + /** + * 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(Arc.class)) { + case PetrinetPackage.ARC__WEIGHT: + case PetrinetPackage.ARC__OUTGOING: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return PetrinetEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d0/50d0d24e1a29001c16f5c57107a74969 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d0/50d0d24e1a29001c16f5c57107a74969 new file mode 100644 index 0000000..8d8f3d7 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d0/50d0d24e1a29001c16f5c57107a74969 @@ -0,0 +1,366 @@ + + + + petrinet.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bold + + + + + + + + + + + + + + + + bold + + + + + + + + + + + + + + + + + + + + bold + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + italic + + + + + + + + bold + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + bold + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + bold + + + + + + + + bold + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d2/20aca69c1a29001c1dd68691abc22857 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d2/20aca69c1a29001c1dd68691abc22857 new file mode 100644 index 0000000..e7769c9 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d2/20aca69c1a29001c1dd68691abc22857 @@ -0,0 +1,2 @@ + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d3/e04ca1681b29001c1beec623ffc858c5 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d3/e04ca1681b29001c1beec623ffc858c5 new file mode 100644 index 0000000..18f9e9d --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d3/e04ca1681b29001c1beec623ffc858c5 @@ -0,0 +1,132 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.PetrinetPackage; +import petrinet.Place; + +/** + * This is the item provider adapter for a {@link petrinet.Place} object. + * + * + * @generated + */ +public class PlaceItemProvider extends NodeItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public PlaceItemProvider(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); + + addTokensPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Tokens feature. + * + * + * @generated + */ + protected void addTokensPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Place_tokens_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Place_tokens_feature", "_UI_Place_type"), + PetrinetPackage.Literals.PLACE__TOKENS, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns Place.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Place")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Place)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_Place_type") : + getString("_UI_Place_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(Place.class)) { + case PetrinetPackage.PLACE__TOKENS: + 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/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/df/40ed18f61a29001c1dd68691abc22857 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/df/40ed18f61a29001c1dd68691abc22857 new file mode 100644 index 0000000..a8051d6 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/df/40ed18f61a29001c1dd68691abc22857 @@ -0,0 +1,133 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.PetrinetPackage; +import petrinet.Place; + +/** + * This is the item provider adapter for a {@link petrinet.Place} object. + * + * + * @generated + */ +public class PlaceItemProvider extends NodeItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public PlaceItemProvider(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); + + addTokensPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Tokens feature. + * + * + * @generated + */ + protected void addTokensPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Place_tokens_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Place_tokens_feature", "_UI_Place_type"), + PetrinetPackage.Literals.PLACE__TOKENS, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns Place.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Place")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Place)object).getName(); + int jetons = ((Place)object).getTokens(); + return label == null || label.length() == 0 ? + getString("_UI_Place_type") : + getString("_UI_Place_type") + " " + label + " (" + jetons + ")"; + } + + + /** + * 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(Place.class)) { + case PetrinetPackage.PLACE__TOKENS: + 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/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c047e3ae1729001c179f8f9c3468d9fc b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c047e3ae1729001c179f8f9c3468d9fc new file mode 100644 index 0000000..81e1e04 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c047e3ae1729001c179f8f9c3468d9fc @@ -0,0 +1,3 @@ + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ee/d07df52c1929001c1f7aec7144dbdd92 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ee/d07df52c1929001c1f7aec7144dbdd92 new file mode 100644 index 0000000..c0e0b3a --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ee/d07df52c1929001c1f7aec7144dbdd92 @@ -0,0 +1,133 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.PetrinetPackage; +import petrinet.Place; + +/** + * This is the item provider adapter for a {@link petrinet.Place} object. + * + * + * @generated + */ +public class PlaceItemProvider extends NodeItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public PlaceItemProvider(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); + + addTokensPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Tokens feature. + * + * + * @generated + */ + protected void addTokensPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Place_tokens_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Place_tokens_feature", "_UI_Place_type"), + PetrinetPackage.Literals.PLACE__TOKENS, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns Place.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Place")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Place)object).getName(); + int jetons = ((Place)object).getJetons(); + return label == null || label.length() == 0 ? + getString("_UI_Place_type") : + getString("_UI_Place_type") + " " + label + " (" + jetons + ")"; + } + + + /** + * 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(Place.class)) { + case PetrinetPackage.PLACE__TOKENS: + 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/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d0dfba411929001c1f7aec7144dbdd92 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d0dfba411929001c1f7aec7144dbdd92 new file mode 100644 index 0000000..e098602 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d0dfba411929001c1f7aec7144dbdd92 @@ -0,0 +1,207 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.Arc; +import petrinet.PetrinetPackage; + +/** + * This is the item provider adapter for a {@link petrinet.Arc} object. + * + * + * @generated + */ +public class ArcItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ArcItemProvider(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); + + addWeightPropertyDescriptor(object); + addOutgoingPropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Weight feature. + * + * + * @generated + */ + protected void addWeightPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_weight_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_weight_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__WEIGHT, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Outgoing feature. + * + * + * @generated + */ + protected void addOutgoingPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_outgoing_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_outgoing_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__OUTGOING, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_target_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Arc.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Arc")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + boolean sortant = ((Arc)object).isSortant(); + int poids = ((Arc)object).getPoids(); + String cible = ((Arc)object).getCible().getName(); + return sortant ? + "--" + poids + "--> " + cible : + "<--" + poids + "-- " + cible; + } + + + /** + * 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(Arc.class)) { + case PetrinetPackage.ARC__WEIGHT: + case PetrinetPackage.ARC__OUTGOING: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return PetrinetEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fb/108496b11b29001c1beec623ffc858c5 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fb/108496b11b29001c1beec623ffc858c5 new file mode 100644 index 0000000..c1fa0ce --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fb/108496b11b29001c1beec623ffc858c5 @@ -0,0 +1,203 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.Arc; +import petrinet.PetrinetPackage; + +/** + * This is the item provider adapter for a {@link petrinet.Arc} object. + * + * + * @generated + */ +public class ArcItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ArcItemProvider(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); + + addWeightPropertyDescriptor(object); + addOutgoingPropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Weight feature. + * + * + * @generated + */ + protected void addWeightPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_weight_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_weight_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__WEIGHT, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Outgoing feature. + * + * + * @generated + */ + protected void addOutgoingPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_outgoing_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_outgoing_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__OUTGOING, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_target_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Arc.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Arc")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + Arc arc = (Arc)object; + return getString("_UI_Arc_type") + " " + arc.getWeight(); + } + + + /** + * 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(Arc.class)) { + case PetrinetPackage.ARC__WEIGHT: + case PetrinetPackage.ARC__OUTGOING: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return PetrinetEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fc/600f7d201d29001c19ddf116589f8e2b b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fc/600f7d201d29001c19ddf116589f8e2b new file mode 100644 index 0000000..fd791c5 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fc/600f7d201d29001c19ddf116589f8e2b @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.simplepdl;singleton:=true +Automatic-Module-Name: fr.n7.simplepdl +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: simplepdl, + simplepdl.impl, + simplepdl.util +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport +Bundle-ActivationPolicy: lazy +Import-Package: org.eclipse.emf.ecore.xmi.impl diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fc/801be0c41b29001c1beec623ffc858c5 b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fc/801be0c41b29001c1beec623ffc858c5 new file mode 100644 index 0000000..de837d9 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fc/801be0c41b29001c1beec623ffc858c5 @@ -0,0 +1,207 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.Arc; +import petrinet.PetrinetPackage; + +/** + * This is the item provider adapter for a {@link petrinet.Arc} object. + * + * + * @generated + */ +public class ArcItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ArcItemProvider(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); + + addWeightPropertyDescriptor(object); + addOutgoingPropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Weight feature. + * + * + * @generated + */ + protected void addWeightPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_weight_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_weight_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__WEIGHT, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Outgoing feature. + * + * + * @generated + */ + protected void addOutgoingPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_outgoing_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_outgoing_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__OUTGOING, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_target_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Arc.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Arc")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + boolean outgoing = ((Arc)object).isOutgoing(); + int weight = ((Arc)object).getWeight(); + String target = ((Arc)object).getTarget().getName(); + return outgoing ? + "--" + weight + "--> " + target : + "<--" + weight + "-- " + target; + } + + + /** + * 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(Arc.class)) { + case PetrinetPackage.ARC__WEIGHT: + case PetrinetPackage.ARC__OUTGOING: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return PetrinetEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.edit/.indexes/e4/47/f/history.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.edit/.indexes/e4/47/f/history.index new file mode 100644 index 0000000..76be069 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.edit/.indexes/e4/47/f/history.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.edit/.markers b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.edit/.markers new file mode 100644 index 0000000..88201f1 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.edit/.markers differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.edit/org.eclipse.jdt.core/state.dat b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.edit/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..75f0f70 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.edit/org.eclipse.jdt.core/state.dat differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.editor/.indexes/e4/47/1a/history.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.editor/.indexes/e4/47/1a/history.index new file mode 100644 index 0000000..e66e746 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.editor/.indexes/e4/47/1a/history.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.editor/.markers b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.editor/.markers new file mode 100644 index 0000000..2e719ba Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.editor/.markers differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.editor/org.eclipse.jdt.core/state.dat b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.editor/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..05b0f31 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.editor/org.eclipse.jdt.core/state.dat differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.exemples/.indexes/history.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.exemples/.indexes/history.index new file mode 100644 index 0000000..2f095aa Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.exemples/.indexes/history.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.feature/.indexes/properties.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.feature/.indexes/properties.index new file mode 100644 index 0000000..9c72f60 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.feature/.indexes/properties.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.tests/.markers b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.tests/.markers new file mode 100644 index 0000000..5075d39 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.tests/.markers differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.tests/org.eclipse.jdt.core/state.dat b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.tests/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..f53b9a3 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet.tests/org.eclipse.jdt.core/state.dat differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/.indexes/history.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/.indexes/history.index index df2a001..073a7e7 100644 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/.indexes/history.index and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/.indexes/history.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/.markers b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/.markers index 5775a25..830978d 100644 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/.markers and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/.markers differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/org.eclipse.jdt.core/state.dat b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..f4390c0 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.petrinet/org.eclipse.jdt.core/state.dat differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.edit/.indexes/e4/fa/f/history.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.edit/.indexes/e4/fa/f/history.index new file mode 100644 index 0000000..76b158b Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.edit/.indexes/e4/fa/f/history.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.edit/.markers b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.edit/.markers new file mode 100644 index 0000000..7b05799 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.edit/.markers differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.edit/org.eclipse.jdt.core/state.dat b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.edit/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..b1e4c63 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.edit/org.eclipse.jdt.core/state.dat differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.editor/.markers b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.editor/.markers new file mode 100644 index 0000000..a36799e Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.editor/.markers differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.editor/org.eclipse.jdt.core/state.dat b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.editor/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..963b205 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.editor/org.eclipse.jdt.core/state.dat differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.exemples/.indexes/history.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.exemples/.indexes/history.index new file mode 100644 index 0000000..81208e8 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.exemples/.indexes/history.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.feature/.indexes/properties.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.feature/.indexes/properties.index new file mode 100644 index 0000000..d1e3aa2 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.feature/.indexes/properties.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.tests/.markers b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.tests/.markers new file mode 100644 index 0000000..e7d9010 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.tests/.markers differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.tests/org.eclipse.jdt.core/state.dat b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.tests/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..77e3c44 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl.tests/org.eclipse.jdt.core/state.dat differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/e4/fa/1/history.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/e4/fa/1/history.index new file mode 100644 index 0000000..dbd11fd Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/e4/fa/1/history.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/f9/history.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/f9/history.index new file mode 100644 index 0000000..b623312 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/f9/history.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/history.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/history.index index cd9cf9c..8787d11 100644 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/history.index and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.indexes/history.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.markers b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.markers index 3897a15..1263eba 100644 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.markers and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/.markers differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/org.eclipse.jdt.core/state.dat b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..481851b Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/fr.n7.simplepdl/org.eclipse.jdt.core/state.dat differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index index 9f8e95d..13a0fb2 100644 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/18.tree b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/18.tree new file mode 100644 index 0000000..5295254 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/18.tree differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/6.tree b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/6.tree deleted file mode 100644 index ba94c04..0000000 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.root/6.tree and /dev/null differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources index d179739..cb4be74 100644 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources and b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs index 6e6c73f..a2e2ec3 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs @@ -1,2 +1,3 @@ eclipse.preferences.version=1 org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=\n\n +preferredTargets=default\:default| diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.emf.converter.prefs b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.emf.converter.prefs new file mode 100644 index 0000000..ed9976c --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.emf.converter.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.emf.importer.ui.contribution.ModelImporterManager=org.eclipse.emf.importer.ecore diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..165b383 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.junit.prefs b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.junit.prefs new file mode 100644 index 0000000..31df02c --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.junit.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.junit.content_assist_favorite_static_members_migrated=true diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 0000000..2d57ff1 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_VM_XML=\n\n \n \n \n\n diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs index 9ceb69c..9d50634 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -1,3 +1,4 @@ +content_assist_number_of_computers=14 content_assist_proposals_background=255,255,255 content_assist_proposals_foreground=0,0,0 eclipse.preferences.version=1 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000..d2ed603 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +knownEEFragments= diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs index 51e9a18..c49b049 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -1,5 +1,5 @@ PROBLEMS_FILTERS_MIGRATE=true eclipse.preferences.version=1 -platformState=1631777710634 +platformState=1631777710644 quickStart=false tipsAndTricks=true diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.views.log.prefs b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.views.log.prefs new file mode 100644 index 0000000..0377f2f --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.views.log.prefs @@ -0,0 +1,10 @@ +activate=true +column2=614 +column3=269 +column4=552 +eclipse.preferences.version=1 +groupBy=0 +maxLogTailSize=1 +orderType=2 +orderValue=-1 +show_filter_text=true diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.core/.launches/New_configuration.launch b/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.core/.launches/New_configuration.launch new file mode 100644 index 0000000..45ea84e --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.core/.launches/New_configuration.launch @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.core/.launches/SimplePDLCreator.launch b/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.core/.launches/SimplePDLCreator.launch new file mode 100644 index 0000000..f60610d --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.core/.launches/SimplePDLCreator.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml new file mode 100644 index 0000000..b371122 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml @@ -0,0 +1,11 @@ + +
+
+ + + + + + +
+
diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml new file mode 100644 index 0000000..7ae3500 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/eclipse-workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi index 0621161..439ea6f 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -1,6 +1,6 @@ - + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration @@ -12,7 +12,7 @@ topLevel shellMaximized - + persp.actionSet:org.eclipse.acceleo.ide.ui.editors.template.actionSet @@ -86,6 +86,7 @@ + noFocus View categoryTag:General @@ -104,7 +105,7 @@ - + @@ -120,7 +121,6 @@ General - active View categoryTag:Ecore Tools @@ -138,6 +138,111 @@ + + + persp.actionSet:org.eclipse.acceleo.ide.ui.editors.template.actionSet + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + persp.actionSet:org.eclipse.search.searchActionSet + persp.actionSet:org.eclipse.text.quicksearch.actionSet + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.newWizSC:org.eclipse.pde.ui.NewProjectWizard + persp.newWizSC:org.eclipse.pde.ui.NewFeatureProjectWizard + persp.viewSC:org.eclipse.pde.runtime.LogView + persp.newWizSC:org.eclipse.xtend.ide.wizards.NewXtendClassWizard + persp.newWizSC:org.eclipse.xtend.ide.wizards.NewXtendInterfaceWizard + persp.newWizSC:org.eclipse.xtend.ide.wizards.NewXtendEnumWizard + persp.newWizSC:org.eclipse.xtend.ide.wizards.NewXtendAnnotationWizard + persp.actionSet:org.eclipse.debug.ui.breakpointActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaElementCreationActionSet + persp.actionSet:org.eclipse.debug.ui.launchActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaActionSet + persp.showIn:org.eclipse.jdt.ui.PackageExplorer + persp.showIn:org.eclipse.ui.navigator.ProjectExplorer + persp.showIn:org.eclipse.team.ui.GenericHistoryView + persp.perspSC:org.eclipse.ui.resourcePerspective + persp.perspSC:org.eclipse.jdt.ui.JavaPerspective + persp.perspSC:org.eclipse.debug.ui.DebugPerspective + persp.viewSC:org.eclipse.ui.console.ConsoleView + persp.viewSC:org.eclipse.pde.ui.PluginsView + persp.viewSC:org.eclipse.ui.views.ProblemView + persp.viewSC:org.eclipse.ui.views.TaskList + persp.viewSC:org.eclipse.ui.views.ContentOutline + persp.newWizSC:org.eclipse.pde.ui.NewProductConfigurationWizard + persp.newWizSC:org.eclipse.pde.ui.NewProfileWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewPackageCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewClassCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard + persp.newWizSC:org.eclipse.ui.wizards.new.file + persp.newWizSC:org.eclipse.ui.wizards.new.folder + persp.viewSC:org.eclipse.pde.ui.ImageBrowserView + persp.viewSC:org.eclipse.pde.ui.DependenciesView + persp.viewSC:org.eclipse.pde.runtime.RegistryBrowser + persp.viewSC:org.eclipse.jdt.ui.PackageExplorer + persp.viewSC:org.eclipse.pde.ui.TargetPlatformState + persp.newWizSC:org.eclipse.pde.ds.ui.wizard + + + org.eclipse.e4.primaryNavigationStack + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Java + + + View + categoryTag:Plug-in Development + + + + + + + + View + categoryTag:General + + + View + categoryTag:General + + + + + org.eclipse.e4.secondaryDataStack + General + + View + categoryTag:General + + + View + categoryTag:Plug-in Development + + + View + categoryTag:General + + + View + categoryTag:General + + + + + @@ -179,9 +284,30 @@ categoryTag:Help - + org.eclipse.e4.primaryDataStack EditorStack + active + + + Editor + removeOnHide + petrinet.presentation.PetrinetEditorID + + + + Editor + removeOnHide + org.eclipse.jdt.ui.CompilationUnitEditor + + + + Editor + removeOnHide + org.eclipse.jdt.ui.CompilationUnitEditor + active + activeOnClose + @@ -205,7 +331,7 @@ ViewMenu menuContribution:menu - + @@ -217,19 +343,19 @@ ViewMenu menuContribution:menu - + - + View categoryTag:General ViewMenu menuContribution:menu - + @@ -267,13 +393,11 @@ View categoryTag:Ecore Tools - active - activeOnClose ViewMenu menuContribution:menu - + @@ -287,6 +411,42 @@ + + + + View + categoryTag:Java + + + + + + View + categoryTag:Plug-in Development + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Plug-in Development + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + toolbarSeparator @@ -294,7 +454,7 @@ Draggable - + toolbarSeparator @@ -307,13 +467,16 @@ toolbarSeparator + + Draggable + Draggable Draggable - + Draggable @@ -322,7 +485,7 @@ Draggable - + toolbarSeparator @@ -2299,7 +2462,7 @@ - + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.emf.codegen.ecore.ui/dialog_settings.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.emf.codegen.ecore.ui/dialog_settings.xml new file mode 100644 index 0000000..f92ab2f --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.emf.codegen.ecore.ui/dialog_settings.xml @@ -0,0 +1,5 @@ + +
+ + +
diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml index 132a8b6..25ba3c5 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml @@ -3,9 +3,9 @@
- - - + + +
@@ -17,7 +17,7 @@
- +
@@ -28,4 +28,36 @@
+
+ + + + + +
+
+ + + + + + + + + +
+
+ + + + + +
+
+ + + + + +
diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1027991553.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1027991553.index new file mode 100644 index 0000000..453f8cb Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1027991553.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1190385766.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1190385766.index new file mode 100644 index 0000000..53fe9cf Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1190385766.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/124733140.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/124733140.index new file mode 100644 index 0000000..ace1f78 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/124733140.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1259215892.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1259215892.index new file mode 100644 index 0000000..563ec21 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1259215892.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1332398772.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1332398772.index new file mode 100644 index 0000000..cc9fe27 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1332398772.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1366149182.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1366149182.index new file mode 100644 index 0000000..ed8f5c8 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1366149182.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1610757853.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1610757853.index new file mode 100644 index 0000000..afbf665 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1610757853.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1612303704.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1612303704.index new file mode 100644 index 0000000..74a27af Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1612303704.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1744987098.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1744987098.index new file mode 100644 index 0000000..aea8515 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1744987098.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1969063402.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1969063402.index new file mode 100644 index 0000000..0e5b1cb Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/1969063402.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2315287759.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2315287759.index new file mode 100644 index 0000000..83e201e Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2315287759.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2320756977.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2320756977.index new file mode 100644 index 0000000..771d0a5 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2320756977.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2469834123.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2469834123.index new file mode 100644 index 0000000..155e37c Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2469834123.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2479976885.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2479976885.index new file mode 100644 index 0000000..f87d953 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2479976885.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/264048023.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/264048023.index new file mode 100644 index 0000000..88b8418 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/264048023.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2684007147.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2684007147.index new file mode 100644 index 0000000..529e464 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/2684007147.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3144173601.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3144173601.index new file mode 100644 index 0000000..59574b8 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3144173601.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3144547538.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3144547538.index new file mode 100644 index 0000000..9209ffb Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3144547538.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3228602193.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3228602193.index new file mode 100644 index 0000000..0292f0f Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3228602193.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3370953800.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3370953800.index new file mode 100644 index 0000000..c3cfac4 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3370953800.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3386340968.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3386340968.index new file mode 100644 index 0000000..bc7a052 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3386340968.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3499872082.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3499872082.index new file mode 100644 index 0000000..c53e4fb Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3499872082.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3591232502.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3591232502.index new file mode 100644 index 0000000..101bbd0 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3591232502.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3674129442.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3674129442.index new file mode 100644 index 0000000..1086202 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3674129442.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3756796416.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3756796416.index new file mode 100644 index 0000000..71892fb Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3756796416.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3761123150.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3761123150.index new file mode 100644 index 0000000..d1f2aea Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/3761123150.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/4270576026.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/4270576026.index new file mode 100644 index 0000000..0ed38f6 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/4270576026.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/489623180.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/489623180.index new file mode 100644 index 0000000..bd62a6e Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/489623180.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/594756272.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/594756272.index new file mode 100644 index 0000000..d4e8951 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/594756272.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/618880026.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/618880026.index new file mode 100644 index 0000000..3923139 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/618880026.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/638382064.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/638382064.index new file mode 100644 index 0000000..d6d4291 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/638382064.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/646308851.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/646308851.index new file mode 100644 index 0000000..8781c31 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/646308851.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/649822626.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/649822626.index new file mode 100644 index 0000000..cc286f9 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/649822626.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/687162898.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/687162898.index new file mode 100644 index 0000000..adbb7cb Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/687162898.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/701648383.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/701648383.index new file mode 100644 index 0000000..7b3f4e6 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/701648383.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/764202902.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/764202902.index new file mode 100644 index 0000000..86b03eb Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/764202902.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/830761727.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/830761727.index new file mode 100644 index 0000000..c0f7c48 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/830761727.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/836787774.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/836787774.index new file mode 100644 index 0000000..a37ffdc Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/836787774.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/976850906.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/976850906.index new file mode 100644 index 0000000..3a0d09d Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/976850906.index differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache index 593f470..4755052 100644 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps new file mode 100644 index 0000000..ad92649 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt new file mode 100644 index 0000000..cfc6fb9 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt @@ -0,0 +1 @@ +INDEX VERSION 1.131 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt new file mode 100644 index 0000000..8586397 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt @@ -0,0 +1 @@ +java \ No newline at end of file diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache index 593f470..c27128a 100644 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt new file mode 100644 index 0000000..730d8ba --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt @@ -0,0 +1,40 @@ +INDEX VERSION 1.131+/home/lfainsin/miniproj_idm/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core +2684007147.index +1332398772.index +3386340968.index +618880026.index +1190385766.index +3761123150.index +1366149182.index +3144547538.index +836787774.index +2320756977.index +3370953800.index +1610757853.index +3228602193.index +594756272.index +976850906.index +3674129442.index +649822626.index +646308851.index +1969063402.index +2315287759.index +830761727.index +489623180.index +4270576026.index +1612303704.index +701648383.index +3144173601.index +3591232502.index +1259215892.index +1744987098.index +1027991553.index +638382064.index +2469834123.index +687162898.index +2479976885.index +764202902.index +124733140.index +3756796416.index +3499872082.index +264048023.index diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat index 2ff63f2..17bf995 100644 Binary files a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat and b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml new file mode 100644 index 0000000..9f5cbdd --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml @@ -0,0 +1,4 @@ + + + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml new file mode 100644 index 0000000..ba1e3a8 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml @@ -0,0 +1,4 @@ + + + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml index 304eb7b..bd56454 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml @@ -2,4 +2,11 @@
+
+
+
+
+
+ +
diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/40/refactorings.history b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/40/refactorings.history index 985abb1..cb18330 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/40/refactorings.history +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/40/refactorings.history @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/40/refactorings.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/40/refactorings.index index 8159122..139c294 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/40/refactorings.index +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/40/refactorings.index @@ -4,3 +4,5 @@ 1633786946043 Delete resource 'fr.n7.simplepdl/Developpement.xmi' 1633786981058 Delete resource 'fr.n7.simplepdl/test.xmi' 1633791020843 Delete resource 'fr.n7.petrinet/network1-ok.xmi' +1633792598368 Delete resource 'fr.n7.simplepdl.plugin' +1633795481588 Delete resource 'fr.n7.petrinet.exemples/My.petrinet' diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.petrinet/2021/10/40/refactorings.history b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.petrinet/2021/10/40/refactorings.history index 42569f1..91abf4e 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.petrinet/2021/10/40/refactorings.history +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.petrinet/2021/10/40/refactorings.history @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.petrinet/2021/10/40/refactorings.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.petrinet/2021/10/40/refactorings.index index 2260af9..6d55170 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.petrinet/2021/10/40/refactorings.index +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.petrinet/2021/10/40/refactorings.index @@ -5,3 +5,4 @@ 1633791241560 Rename resource 'simplepdl.ocl' 1633791493734 Rename resource 'network1-ok.xmi' 1633791501864 Rename resource 'network1-ko.xmi' +1633794223683 Delete element diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl.exemples/2021/10/40/refactorings.history b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl.exemples/2021/10/40/refactorings.history new file mode 100644 index 0000000..bad205c --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl.exemples/2021/10/40/refactorings.history @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl.exemples/2021/10/40/refactorings.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl.exemples/2021/10/40/refactorings.index new file mode 100644 index 0000000..192b78f --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl.exemples/2021/10/40/refactorings.index @@ -0,0 +1 @@ +1633793949009 Move 'developpement.simplepdl' to 'fr.n7.simplepdl.exemples' diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl/2021/10/40/refactorings.history b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl/2021/10/40/refactorings.history index ccbd039..eaf238f 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl/2021/10/40/refactorings.history +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl/2021/10/40/refactorings.history @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl/2021/10/40/refactorings.index b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl/2021/10/40/refactorings.index index e17efea..2e1b18c 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl/2021/10/40/refactorings.index +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/fr.n7.simplepdl/2021/10/40/refactorings.index @@ -9,3 +9,5 @@ 1633791341802 Rename resource 'pdl1.xmi' 1633791346452 Rename resource 'ko-pdl.xmi' 1633791379776 Rename resource 'process-developpement.xmi' +1633794113369 Copy compilation unit +1633794227791 Delete element diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties index b6ec9ad..74522de 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties @@ -1,2 +1,2 @@ #Cached timestamps -#Sat Oct 09 16:59:24 CEST 2021 +#Sat Oct 09 18:37:11 CEST 2021 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.contributions.1 b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.contributions.1 new file mode 100644 index 0000000..f289ee1 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.contributions.1 differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.contributors.1 b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.contributors.1 new file mode 100644 index 0000000..1de5851 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.contributors.1 differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.extraData.1 b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.extraData.1 new file mode 100644 index 0000000..73d9f59 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.extraData.1 differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.mainData.1 b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.mainData.1 new file mode 100644 index 0000000..0346969 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.mainData.1 differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.manager/.fileTable.7 b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.manager/.fileTable.7 new file mode 100644 index 0000000..c7a07ca --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.manager/.fileTable.7 @@ -0,0 +1,10 @@ +#safe table +#Sat Oct 09 18:37:11 CEST 2021 +.orphans=0 +.mainData=0 +.contributors=0 +.namespaces=0 +.extraData=0 +.contributions=0 +.table=0 +.crc04abac59.v1 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.manager/.fileTable.8 b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.manager/.fileTable.8 new file mode 100644 index 0000000..c9f071a --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.manager/.fileTable.8 @@ -0,0 +1,10 @@ +#safe table +#Sat Oct 09 18:37:11 CEST 2021 +.orphans=1 +.mainData=1 +.contributors=1 +.namespaces=1 +.extraData=1 +.contributions=1 +.table=1 +.crccbd99662.v1 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.manager/.tmp14890597377832605793.instance b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.manager/.tmp14890597377832605793.instance deleted file mode 100644 index e69de29..0000000 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.namespaces.1 b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.namespaces.1 new file mode 100644 index 0000000..9c07c16 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.namespaces.1 differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.orphans.1 b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.orphans.1 new file mode 100644 index 0000000..fbd8f94 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.orphans.1 differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.table.1 b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.table.1 new file mode 100644 index 0000000..9496c9b Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.extensions/.table.1 differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-10.profile b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-10.profile new file mode 100644 index 0000000..7a30226 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-10.profile @@ -0,0 +1,8 @@ +#Sat Oct 09 18:17:59 CEST 2021 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.osgi.framework.executionenvironment=OSGi/Minimum-1.0, OSGi/Minimum-1.1, OSGi/Minimum-1.2, JavaSE/compact1-1.8, JavaSE/compact2-1.8, JavaSE/compact3-1.8, JRE-1.1, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8, JavaSE-9, JavaSE-10 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=10 +org.eclipse.jdt.core.compiler.source=10 +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.compliance=10 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-11.profile b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-11.profile new file mode 100644 index 0000000..8f52775 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-11.profile @@ -0,0 +1,10 @@ +#Sat Oct 09 18:17:59 CEST 2021 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.osgi.framework.executionenvironment=OSGi/Minimum-1.0, OSGi/Minimum-1.1, OSGi/Minimum-1.2, JavaSE/compact1-1.8, JavaSE/compact2-1.8, JavaSE/compact3-1.8, JRE-1.1, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8, JavaSE-9, JavaSE-10, JavaSE-11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.compliance=11 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-12.profile b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-12.profile new file mode 100644 index 0000000..6efff5b --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-12.profile @@ -0,0 +1,10 @@ +#Sat Oct 09 18:17:59 CEST 2021 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.osgi.framework.executionenvironment=OSGi/Minimum-1.0, OSGi/Minimum-1.1, OSGi/Minimum-1.2, JavaSE/compact1-1.8, JavaSE/compact2-1.8, JavaSE/compact3-1.8, JRE-1.1, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8, JavaSE-9, JavaSE-10, JavaSE-11, JavaSE-12 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=12 +org.eclipse.jdt.core.compiler.source=12 +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.compliance=12 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-13.profile b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-13.profile new file mode 100644 index 0000000..7694403 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-13.profile @@ -0,0 +1,10 @@ +#Sat Oct 09 18:17:59 CEST 2021 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.osgi.framework.executionenvironment=OSGi/Minimum-1.0, OSGi/Minimum-1.1, OSGi/Minimum-1.2, JavaSE/compact1-1.8, JavaSE/compact2-1.8, JavaSE/compact3-1.8, JRE-1.1, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8, JavaSE-9, JavaSE-10, JavaSE-11, JavaSE-12, JavaSE-13 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=13 +org.eclipse.jdt.core.compiler.source=13 +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.compliance=13 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-14.profile b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-14.profile new file mode 100644 index 0000000..a213ce2 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/.profiles/JavaSE-14.profile @@ -0,0 +1,10 @@ +#Sat Oct 09 18:17:59 CEST 2021 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.osgi.framework.executionenvironment=OSGi/Minimum-1.0, OSGi/Minimum-1.1, OSGi/Minimum-1.2, JavaSE/compact1-1.8, JavaSE/compact2-1.8, JavaSE/compact3-1.8, JRE-1.1, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8, JavaSE-9, JavaSE-10, JavaSE-11, JavaSE-12, JavaSE-13, JavaSE-14 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=14 +org.eclipse.jdt.core.compiler.source=14 +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.compliance=14 diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/SavedExternalPluginList.txt b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/SavedExternalPluginList.txt index cc0e024..c4fd5dd 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/SavedExternalPluginList.txt +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/SavedExternalPluginList.txt @@ -1,4 +1,4 @@ -# List of external plug-in models previously loaded. Timestamp: 1633791600487 +# List of external plug-in models previously loaded. Timestamp: 1633796329498 file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/com.google.guava_27.1.0.v20190517-1946.jar file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/com.google.inject_3.0.0.v201605172100.jar file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/com.ibm.icu_67.1.0.v20200706-1749.jar @@ -6,6 +6,14 @@ file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/com.jcraft.jsch_0.1.55. file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/com.sun.el_2.2.0.v201303151357.jar file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/com.sun.jna_4.5.1.v20190425-1842.jar file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/com.sun.jna.platform_4.5.1.v20190425-1842.jar +file:/home/lfainsin/.eclipse/org.eclipse.platform_4.17.0_630142970_linux_gtk_x86_64/plugins/fr.n7.petrinet_1.0.0.202110091817.jar +file:/home/lfainsin/.eclipse/org.eclipse.platform_4.17.0_630142970_linux_gtk_x86_64/plugins/fr.n7.petrinet.edit_1.0.0.202110091817.jar +file:/home/lfainsin/.eclipse/org.eclipse.platform_4.17.0_630142970_linux_gtk_x86_64/plugins/fr.n7.petrinet.editor_1.0.0.202110091817.jar +file:/home/lfainsin/.eclipse/org.eclipse.platform_4.17.0_630142970_linux_gtk_x86_64/plugins/fr.n7.petrinet.tests_1.0.0.202110091817.jar +file:/home/lfainsin/.eclipse/org.eclipse.platform_4.17.0_630142970_linux_gtk_x86_64/plugins/fr.n7.simplepdl_1.0.0.202110091748.jar +file:/home/lfainsin/.eclipse/org.eclipse.platform_4.17.0_630142970_linux_gtk_x86_64/plugins/fr.n7.simplepdl.edit_1.0.0.202110091748.jar +file:/home/lfainsin/.eclipse/org.eclipse.platform_4.17.0_630142970_linux_gtk_x86_64/plugins/fr.n7.simplepdl.editor_1.0.0.202110091748.jar +file:/home/lfainsin/.eclipse/org.eclipse.platform_4.17.0_630142970_linux_gtk_x86_64/plugins/fr.n7.simplepdl.tests_1.0.0.202110091748.jar file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/io.github.classgraph_4.8.35.v20190528-1517.jar file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/javax.annotation_1.3.5.v20200504-1837.jar file:/mnt/n7fs/ens/tp_cregut/eclipse-gls-2020-09/plugins/javax.el_2.2.0.v201303151357.jar diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/artifacts.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/artifacts.xml new file mode 100644 index 0000000..4627777 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/artifacts.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/content.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/content.xml new file mode 100644 index 0000000..f5e0bbf --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/content.xml @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fr.n7.petrinet.editor + + + + + + + + + + + Bundle-SymbolicName: fr.n7.petrinet.editor;singleton:=true Bundle-Version: 1.0.0.202110091817 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fr.n7.petrinet.tests + + + + + + + + + + + Bundle-SymbolicName: fr.n7.petrinet.tests;singleton:=true Bundle-Version: 1.0.0.202110091817 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fr.n7.petrinet + + + + + + + + + + + Bundle-SymbolicName: fr.n7.petrinet;singleton:=true Bundle-Version: 1.0.0.202110091817 + + + + + + + + + + + + + + + + + + + + + + + (org.eclipse.update.install.features=true) + + + + + + + [Enter License Description here.] + + + + [Enter Copyright Description here.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fr.n7.petrinet.edit + + + + + + + + + + + Bundle-SymbolicName: fr.n7.petrinet.edit;singleton:=true Bundle-Version: 1.0.0.202110091817 + + + + + + + + + + + + + + + + + (org.eclipse.update.install.features=true) + + + + + + + + + true + + + + + + [Enter License Description here.] + + + + [Enter Copyright Description here.] + + + + diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/features/fr.n7.petrinet.feature_1.0.0.202110091817.jar b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/features/fr.n7.petrinet.feature_1.0.0.202110091817.jar new file mode 100644 index 0000000..7bdb949 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/features/fr.n7.petrinet.feature_1.0.0.202110091817.jar differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet.edit_1.0.0.202110091817.jar b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet.edit_1.0.0.202110091817.jar new file mode 100644 index 0000000..5660138 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet.edit_1.0.0.202110091817.jar differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet.editor_1.0.0.202110091817.jar b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet.editor_1.0.0.202110091817.jar new file mode 100644 index 0000000..23d94d5 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet.editor_1.0.0.202110091817.jar differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet.tests_1.0.0.202110091817.jar b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet.tests_1.0.0.202110091817.jar new file mode 100644 index 0000000..ce4f0d9 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet.tests_1.0.0.202110091817.jar differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet_1.0.0.202110091817.jar b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet_1.0.0.202110091817.jar new file mode 100644 index 0000000..5d0e7bc Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/tempp2metadata/plugins/fr.n7.petrinet_1.0.0.202110091817.jar differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.ui/dialog_settings.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.ui/dialog_settings.xml new file mode 100644 index 0000000..a8f705b --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.ui/dialog_settings.xml @@ -0,0 +1,35 @@ + +
+ + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + +
+
+
+
diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml index 3aea8ba..c038c30 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml @@ -8,4 +8,10 @@
+
+ + + + +
diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.views.log/dialog_settings.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.views.log/dialog_settings.xml new file mode 100644 index 0000000..8b98665 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.views.log/dialog_settings.xml @@ -0,0 +1,21 @@ + +
+
+ + + + + + + +
+
+ + + + + + + +
+
diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml index 3f5cf8d..46efc85 100644 --- a/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml @@ -2,14 +2,19 @@
+ + + +
+ @@ -22,14 +27,9 @@
- + - - - - - - +
diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.xtext.builder/builder.state b/eclipse-workspace/.metadata/.plugins/org.eclipse.xtext.builder/builder.state new file mode 100644 index 0000000..8e25fe2 Binary files /dev/null and b/eclipse-workspace/.metadata/.plugins/org.eclipse.xtext.builder/builder.state differ diff --git a/eclipse-workspace/.metadata/.plugins/org.eclipse.xtext.ui.ecore/dialog_settings.xml b/eclipse-workspace/.metadata/.plugins/org.eclipse.xtext.ui.ecore/dialog_settings.xml new file mode 100644 index 0000000..5ca0b77 --- /dev/null +++ b/eclipse-workspace/.metadata/.plugins/org.eclipse.xtext.ui.ecore/dialog_settings.xml @@ -0,0 +1,3 @@ + +
+
diff --git a/eclipse-workspace/.metadata/version.ini b/eclipse-workspace/.metadata/version.ini index 04bed28..fb31e84 100644 --- a/eclipse-workspace/.metadata/version.ini +++ b/eclipse-workspace/.metadata/version.ini @@ -1,3 +1,3 @@ -#Sat Oct 09 16:59:50 CEST 2021 +#Sat Oct 09 18:18:45 CEST 2021 org.eclipse.core.runtime=2 org.eclipse.platform=4.17.0.v20200902-1800 diff --git a/eclipse-workspace/fr.n7.petrinet.edit/.classpath b/eclipse-workspace/fr.n7.petrinet.edit/.classpath new file mode 100644 index 0000000..c3ba59e --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet.edit/.project b/eclipse-workspace/fr.n7.petrinet.edit/.project new file mode 100644 index 0000000..1b5afe6 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/.project @@ -0,0 +1,28 @@ + + + fr.n7.petrinet.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/eclipse-workspace/fr.n7.petrinet.edit/META-INF/MANIFEST.MF b/eclipse-workspace/fr.n7.petrinet.edit/META-INF/MANIFEST.MF new file mode 100644 index 0000000..b26fd94 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.petrinet.edit;singleton:=true +Automatic-Module-Name: fr.n7.petrinet.edit +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: petrinet.provider.PetrinetEditPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: petrinet.provider +Require-Bundle: org.eclipse.core.runtime, + fr.n7.petrinet;visibility:=reexport, + org.eclipse.emf.edit;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/eclipse-workspace/fr.n7.petrinet.edit/build.properties b/eclipse-workspace/fr.n7.petrinet.edit/build.properties new file mode 100644 index 0000000..6e3e902 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.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/eclipse-workspace/fr.n7.petrinet.edit/icons/full/ctool16/CreateNetwork_nodes_Place.gif b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/ctool16/CreateNetwork_nodes_Place.gif new file mode 100644 index 0000000..03366e3 Binary files /dev/null and b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/ctool16/CreateNetwork_nodes_Place.gif differ diff --git a/eclipse-workspace/fr.n7.petrinet.edit/icons/full/ctool16/CreateNetwork_nodes_Transition.gif b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/ctool16/CreateNetwork_nodes_Transition.gif new file mode 100644 index 0000000..0d4f530 Binary files /dev/null and b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/ctool16/CreateNetwork_nodes_Transition.gif differ diff --git a/eclipse-workspace/fr.n7.petrinet.edit/icons/full/ctool16/CreateTransition_arcs_Arc.gif b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/ctool16/CreateTransition_arcs_Arc.gif new file mode 100644 index 0000000..b3c6924 Binary files /dev/null and b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/ctool16/CreateTransition_arcs_Arc.gif differ diff --git a/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Arc.gif b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Arc.gif new file mode 100644 index 0000000..90d10f9 Binary files /dev/null and b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Arc.gif differ diff --git a/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Network.gif b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Network.gif new file mode 100644 index 0000000..5a9bc75 Binary files /dev/null and b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Network.gif differ diff --git a/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Place.gif b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Place.gif new file mode 100644 index 0000000..e4bc22d Binary files /dev/null and b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Place.gif differ diff --git a/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Transition.gif b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Transition.gif new file mode 100644 index 0000000..7bac4fd Binary files /dev/null and b/eclipse-workspace/fr.n7.petrinet.edit/icons/full/obj16/Transition.gif differ diff --git a/eclipse-workspace/fr.n7.petrinet.edit/plugin.properties b/eclipse-workspace/fr.n7.petrinet.edit/plugin.properties new file mode 100644 index 0000000..6070f6c --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/plugin.properties @@ -0,0 +1,33 @@ +# + +pluginName = Petrinet 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_Network_type = Network +_UI_Node_type = Node +_UI_Place_type = Place +_UI_Arc_type = Arc +_UI_Transition_type = Transition +_UI_Unknown_type = Object + +_UI_Unknown_datatype= Value + +_UI_Network_name_feature = Name +_UI_Network_nodes_feature = Nodes +_UI_Node_name_feature = Name +_UI_Place_tokens_feature = Tokens +_UI_Arc_weight_feature = Weight +_UI_Arc_outgoing_feature = Outgoing +_UI_Arc_target_feature = Target +_UI_Transition_arcs_feature = Arcs +_UI_Unknown_feature = Unspecified + diff --git a/eclipse-workspace/fr.n7.petrinet.edit/plugin.xml b/eclipse-workspace/fr.n7.petrinet.edit/plugin.xml new file mode 100644 index 0000000..bf46da9 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/plugin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/ArcItemProvider.java b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/ArcItemProvider.java new file mode 100644 index 0000000..cec649c --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/ArcItemProvider.java @@ -0,0 +1,207 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.Arc; +import petrinet.PetrinetPackage; + +/** + * This is the item provider adapter for a {@link petrinet.Arc} object. + * + * + * @generated + */ +public class ArcItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ArcItemProvider(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); + + addWeightPropertyDescriptor(object); + addOutgoingPropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Weight feature. + * + * + * @generated + */ + protected void addWeightPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_weight_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_weight_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__WEIGHT, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Outgoing feature. + * + * + * @generated + */ + protected void addOutgoingPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_outgoing_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_outgoing_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__OUTGOING, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Arc_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Arc_target_feature", "_UI_Arc_type"), + PetrinetPackage.Literals.ARC__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Arc.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Arc")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + boolean outgoing = ((Arc)object).isOutgoing(); + int weight = ((Arc)object).getWeight(); + String target = ((Arc)object).getTarget() != null ? ((Arc)object).getTarget().getName() : ""; + return outgoing ? + " --" + weight + "--> " + target : + "<--" + weight + "-- " + target; + } + + + /** + * 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(Arc.class)) { + case PetrinetPackage.ARC__WEIGHT: + case PetrinetPackage.ARC__OUTGOING: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return PetrinetEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/NetworkItemProvider.java b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/NetworkItemProvider.java new file mode 100644 index 0000000..2894dbc --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/NetworkItemProvider.java @@ -0,0 +1,204 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.ecore.EStructuralFeature; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.Network; +import petrinet.PetrinetFactory; +import petrinet.PetrinetPackage; + +/** + * This is the item provider adapter for a {@link petrinet.Network} object. + * + * + * @generated + */ +public class NetworkItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public NetworkItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Network_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Network_name_feature", "_UI_Network_type"), + PetrinetPackage.Literals.NETWORK__NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(PetrinetPackage.Literals.NETWORK__NODES); + } + 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 Network.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Network")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Network)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_Network_type") : + getString("_UI_Network_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(Network.class)) { + case PetrinetPackage.NETWORK__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case PetrinetPackage.NETWORK__NODES: + 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 + (PetrinetPackage.Literals.NETWORK__NODES, + PetrinetFactory.eINSTANCE.createPlace())); + + newChildDescriptors.add + (createChildParameter + (PetrinetPackage.Literals.NETWORK__NODES, + PetrinetFactory.eINSTANCE.createTransition())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return PetrinetEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/NodeItemProvider.java b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/NodeItemProvider.java new file mode 100644 index 0000000..b8f95ba --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/NodeItemProvider.java @@ -0,0 +1,147 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.Node; +import petrinet.PetrinetPackage; + +/** + * This is the item provider adapter for a {@link petrinet.Node} object. + * + * + * @generated + */ +public class NodeItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public NodeItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Node_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Node_name_feature", "_UI_Node_type"), + PetrinetPackage.Literals.NODE__NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Node)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_Node_type") : + getString("_UI_Node_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(Node.class)) { + case PetrinetPackage.NODE__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return PetrinetEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/PetrinetEditPlugin.java b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/PetrinetEditPlugin.java new file mode 100644 index 0000000..e093afa --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/PetrinetEditPlugin.java @@ -0,0 +1,89 @@ +/** + */ +package petrinet.provider; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Petrinet edit plugin. + * + * + * @generated + */ +public final class PetrinetEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final PetrinetEditPlugin INSTANCE = new PetrinetEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public PetrinetEditPlugin() { + super + (new ResourceLocator [] { + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/PetrinetItemProviderAdapterFactory.java b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/PetrinetItemProviderAdapterFactory.java new file mode 100644 index 0000000..349dbe1 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/PetrinetItemProviderAdapterFactory.java @@ -0,0 +1,271 @@ +/** + */ +package petrinet.provider; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +import petrinet.util.PetrinetAdapterFactory; + +/** + * 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 PetrinetItemProviderAdapterFactory extends PetrinetAdapterFactory 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 PetrinetItemProviderAdapterFactory() { + 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 petrinet.Network} instances. + * + * + * @generated + */ + protected NetworkItemProvider networkItemProvider; + + /** + * This creates an adapter for a {@link petrinet.Network}. + * + * + * @generated + */ + @Override + public Adapter createNetworkAdapter() { + if (networkItemProvider == null) { + networkItemProvider = new NetworkItemProvider(this); + } + + return networkItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link petrinet.Place} instances. + * + * + * @generated + */ + protected PlaceItemProvider placeItemProvider; + + /** + * This creates an adapter for a {@link petrinet.Place}. + * + * + * @generated + */ + @Override + public Adapter createPlaceAdapter() { + if (placeItemProvider == null) { + placeItemProvider = new PlaceItemProvider(this); + } + + return placeItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link petrinet.Arc} instances. + * + * + * @generated + */ + protected ArcItemProvider arcItemProvider; + + /** + * This creates an adapter for a {@link petrinet.Arc}. + * + * + * @generated + */ + @Override + public Adapter createArcAdapter() { + if (arcItemProvider == null) { + arcItemProvider = new ArcItemProvider(this); + } + + return arcItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link petrinet.Transition} instances. + * + * + * @generated + */ + protected TransitionItemProvider transitionItemProvider; + + /** + * This creates an adapter for a {@link petrinet.Transition}. + * + * + * @generated + */ + @Override + public Adapter createTransitionAdapter() { + if (transitionItemProvider == null) { + transitionItemProvider = new TransitionItemProvider(this); + } + + return transitionItemProvider; + } + + /** + * 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 (networkItemProvider != null) networkItemProvider.dispose(); + if (placeItemProvider != null) placeItemProvider.dispose(); + if (arcItemProvider != null) arcItemProvider.dispose(); + if (transitionItemProvider != null) transitionItemProvider.dispose(); + } + +} diff --git a/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/PlaceItemProvider.java b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/PlaceItemProvider.java new file mode 100644 index 0000000..9afb6b0 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/PlaceItemProvider.java @@ -0,0 +1,133 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.PetrinetPackage; +import petrinet.Place; + +/** + * This is the item provider adapter for a {@link petrinet.Place} object. + * + * + * @generated + */ +public class PlaceItemProvider extends NodeItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public PlaceItemProvider(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); + + addTokensPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Tokens feature. + * + * + * @generated + */ + protected void addTokensPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Place_tokens_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Place_tokens_feature", "_UI_Place_type"), + PetrinetPackage.Literals.PLACE__TOKENS, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns Place.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Place")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Place)object).getName(); + int tokens = ((Place)object).getTokens(); + return label == null || label.length() == 0 ? + getString("_UI_Place_type") : + getString("_UI_Place_type") + " " + label + " (" + tokens + ")"; + } + + + /** + * 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(Place.class)) { + case PetrinetPackage.PLACE__TOKENS: + 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/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/TransitionItemProvider.java b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/TransitionItemProvider.java new file mode 100644 index 0000000..e3d92ab --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.edit/src/petrinet/provider/TransitionItemProvider.java @@ -0,0 +1,145 @@ +/** + */ +package petrinet.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EStructuralFeature; + +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import petrinet.PetrinetFactory; +import petrinet.PetrinetPackage; +import petrinet.Transition; + +/** + * This is the item provider adapter for a {@link petrinet.Transition} object. + * + * + * @generated + */ +public class TransitionItemProvider extends NodeItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public TransitionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + 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(PetrinetPackage.Literals.TRANSITION__ARCS); + } + 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 Transition.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Transition")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Transition)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_Transition_type") : + getString("_UI_Transition_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(Transition.class)) { + case PetrinetPackage.TRANSITION__ARCS: + 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 + (PetrinetPackage.Literals.TRANSITION__ARCS, + PetrinetFactory.eINSTANCE.createArc())); + } + +} diff --git a/eclipse-workspace/fr.n7.petrinet.editor/.classpath b/eclipse-workspace/fr.n7.petrinet.editor/.classpath new file mode 100644 index 0000000..c3ba59e --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.editor/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet.editor/.project b/eclipse-workspace/fr.n7.petrinet.editor/.project new file mode 100644 index 0000000..e7fc4ca --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.editor/.project @@ -0,0 +1,28 @@ + + + fr.n7.petrinet.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/eclipse-workspace/fr.n7.petrinet.editor/META-INF/MANIFEST.MF b/eclipse-workspace/fr.n7.petrinet.editor/META-INF/MANIFEST.MF new file mode 100644 index 0000000..699b7e3 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.editor/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.petrinet.editor;singleton:=true +Automatic-Module-Name: fr.n7.petrinet.editor +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: petrinet.presentation.PetrinetEditorPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: petrinet.presentation +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources;visibility:=reexport, + fr.n7.petrinet.edit;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.eclipse.emf.edit.ui;visibility:=reexport, + org.eclipse.ui.ide;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/eclipse-workspace/fr.n7.petrinet.editor/build.properties b/eclipse-workspace/fr.n7.petrinet.editor/build.properties new file mode 100644 index 0000000..5fb0771 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.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/eclipse-workspace/fr.n7.petrinet.editor/icons/full/obj16/PetrinetModelFile.gif b/eclipse-workspace/fr.n7.petrinet.editor/icons/full/obj16/PetrinetModelFile.gif new file mode 100644 index 0000000..689b728 Binary files /dev/null and b/eclipse-workspace/fr.n7.petrinet.editor/icons/full/obj16/PetrinetModelFile.gif differ diff --git a/eclipse-workspace/fr.n7.petrinet.editor/icons/full/wizban/NewPetrinet.gif b/eclipse-workspace/fr.n7.petrinet.editor/icons/full/wizban/NewPetrinet.gif new file mode 100644 index 0000000..e976e07 Binary files /dev/null and b/eclipse-workspace/fr.n7.petrinet.editor/icons/full/wizban/NewPetrinet.gif differ diff --git a/eclipse-workspace/fr.n7.petrinet.editor/plugin.properties b/eclipse-workspace/fr.n7.petrinet.editor/plugin.properties new file mode 100644 index 0000000..ae2efaa --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.editor/plugin.properties @@ -0,0 +1,53 @@ +# + +pluginName = Petrinet Editor +providerName = www.example.org + +_UI_PetrinetEditor_menu = &Petrinet 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_PetrinetModelWizard_label = Petrinet Model +_UI_PetrinetModelWizard_description = Create a new Petrinet model + +_UI_PetrinetEditor_label = Petrinet Model Editor + +_UI_PetrinetEditorFilenameDefaultBase = My +_UI_PetrinetEditorFilenameExtensions = petrinet + +_UI_Wizard_label = New + +_WARN_FilenameExtension = The file name must end in ''.{0}'' +_WARN_FilenameExtensions = The file name must have one of the following extensions: {0} + +_UI_ModelObject = &Model Object +_UI_XMLEncoding = &XML Encoding +_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1 +_UI_Wizard_initial_object_description = Select a model object to create + +_UI_FileConflict_label = File Conflict +_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? + diff --git a/eclipse-workspace/fr.n7.petrinet.editor/plugin.xml b/eclipse-workspace/fr.n7.petrinet.editor/plugin.xml new file mode 100644 index 0000000..c35f948 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.editor/plugin.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + %_UI_PetrinetModelWizard_description + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetActionBarContributor.java b/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetActionBarContributor.java new file mode 100644 index 0000000..90027e3 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetActionBarContributor.java @@ -0,0 +1,424 @@ +/** + */ +package petrinet.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 Petrinet model editor. + * + * + * @generated + */ +public class PetrinetActionBarContributor + 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(PetrinetEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + PetrinetEditorPlugin.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(PetrinetEditorPlugin.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 PetrinetActionBarContributor() { + 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) { + super.contributeToToolBar(toolBarManager); + toolBarManager.add(new Separator("petrinet-settings")); + toolBarManager.add(new Separator("petrinet-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(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetEditor_menu"), "petrinetMenuID"); + 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(PetrinetEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(PetrinetEditorPlugin.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(PetrinetEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(PetrinetEditorPlugin.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/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetEditor.java b/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetEditor.java new file mode 100644 index 0000000..c209d42 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetEditor.java @@ -0,0 +1,1823 @@ +/** + */ +package petrinet.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.graphics.Rectangle; + +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 petrinet.provider.PetrinetItemProviderAdapterFactory; + +import org.eclipse.ui.actions.WorkspaceModifyOperation; + + +/** + * This is an example of a Petrinet model editor. + * + * + * @generated + */ +public class PetrinetEditor + 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(PetrinetEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(PetrinetEditor.this); + handleActivate(); + } + } + else if (p == PetrinetEditor.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() { + protected boolean dispatching; + + @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); + } + dispatchUpdateProblemIndication(); + break; + } + } + } + else { + super.notifyChanged(notification); + } + } + + protected void dispatchUpdateProblemIndication() { + if (updateProblemIndication && !dispatching) { + dispatching = true; + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + public void run() { + dispatching = false; + updateProblemIndication(); + } + }); + } + } + + @Override + protected void setTarget(Resource target) { + basicSetTarget(target); + } + + @Override + protected void unsetTarget(Resource target) { + basicUnsetTarget(target); + resourceToDiagnosticMap.remove(target); + dispatchUpdateProblemIndication(); + } + }; + + /** + * 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(PetrinetEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == PetrinetEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + PetrinetEditorPlugin.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(PetrinetEditor.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())) { + ResourceSet resourceSet = editingDomain.getResourceSet(); + if (isDirty()) { + changedResources.addAll(resourceSet.getResources()); + } + editingDomain.getCommandStack().flush(); + + updateProblemIndication = false; + for (Resource resource : changedResources) { + if (resource.isLoaded()) { + resource.unload(); + try { + resource.load(resourceSet.getLoadOptions()); + } + 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.n7.petrinet.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) { + PetrinetEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + try { + markerHelper.updateMarkers(diagnostic); + } + catch (CoreException exception) { + PetrinetEditorPlugin.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 PetrinetEditor() { + 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 PetrinetItemProviderAdapterFactory()); + 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() == null || 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.n7.petrinet.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.n7.petrinet.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(), PetrinetEditor.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.setUseHashlookup(true); + + 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(), PetrinetEditor.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(), PetrinetEditor.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(), PetrinetEditor.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(), PetrinetEditor.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(), PetrinetEditor.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() { + if (!getContainer().isDisposed()) { + 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) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); + } + } + } + + /** + * 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) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, clientArea.height + clientArea.y); + } + } + } + + /** + * 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 + */ + @Override + public T getAdapter(Class key) { + if (key.equals(IContentOutlinePage.class)) { + return showOutlineView() ? key.cast(getContentOutlinePage()) : null; + } + else if (key.equals(IPropertySheetPage.class)) { + return key.cast(getPropertySheetPage()); + } + else if (key.equals(IGotoMarker.class)) { + return key.cast(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.setUseHashlookup(true); + 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, ExtendedPropertySheetPage.Decoration.NONE, null, 0, false) { + @Override + public void setSelectionToViewer(List selection) { + PetrinetEditor.this.setSelectionToViewer(selection); + PetrinetEditor.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; + List resources = editingDomain.getResourceSet().getResources(); + for (int i = 0; i < resources.size(); ++i) { + Resource resource = resources.get(i); + 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. + // + PetrinetEditorPlugin.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 PetrinetEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return PetrinetEditorPlugin.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/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetEditorPlugin.java b/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetEditorPlugin.java new file mode 100644 index 0000000..c36f292 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetEditorPlugin.java @@ -0,0 +1,91 @@ +/** + */ +package petrinet.presentation; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.ui.EclipseUIPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Petrinet editor plugin. + * + * + * @generated + */ +public final class PetrinetEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final PetrinetEditorPlugin INSTANCE = new PetrinetEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public PetrinetEditorPlugin() { + super + (new ResourceLocator [] { + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipseUIPlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetModelWizard.java b/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetModelWizard.java new file mode 100644 index 0000000..b49577d --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.editor/src/petrinet/presentation/PetrinetModelWizard.java @@ -0,0 +1,627 @@ +/** + */ +package petrinet.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 petrinet.PetrinetFactory; +import petrinet.PetrinetPackage; +import petrinet.provider.PetrinetEditPlugin; + + +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 PetrinetModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected PetrinetPackage petrinetPackage = PetrinetPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected PetrinetFactory petrinetFactory = petrinetPackage.getPetrinetFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected PetrinetModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected PetrinetModelWizardInitialObjectCreationPage 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(PetrinetEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(PetrinetEditorPlugin.INSTANCE.getImage("full/wizban/NewPetrinet"))); + } + + /** + * 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 : petrinetPackage.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)petrinetPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = petrinetFactory.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) { + PetrinetEditorPlugin.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(), PetrinetEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } + catch (Exception exception) { + PetrinetEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class PetrinetModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public PetrinetModelWizardNewFileCreationPage(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(PetrinetEditorPlugin.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 PetrinetModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public PetrinetModelWizardInitialObjectCreationPage(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(PetrinetEditorPlugin.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(PetrinetEditorPlugin.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 PetrinetEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } + catch(MissingResourceException mre) { + PetrinetEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(PetrinetEditorPlugin.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 PetrinetModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetModelWizard_label")); + newFileCreationPage.setDescription(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetModelWizard_description")); + newFileCreationPage.setFileName(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetEditorFilenameDefaultBase") + "." + 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 = PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetEditorFilenameDefaultBase"); + 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 PetrinetModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(PetrinetEditorPlugin.INSTANCE.getString("_UI_PetrinetModelWizard_label")); + initialObjectCreationPage.setDescription(PetrinetEditorPlugin.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/eclipse-workspace/fr.n7.petrinet.exemples/.project b/eclipse-workspace/fr.n7.petrinet.exemples/.project new file mode 100644 index 0000000..d96803d --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.exemples/.project @@ -0,0 +1,11 @@ + + + fr.n7.petrinet.exemples + + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet.exemples/My.petrinet b/eclipse-workspace/fr.n7.petrinet.exemples/My.petrinet new file mode 100644 index 0000000..413591c --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.exemples/My.petrinet @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet.feature/.project b/eclipse-workspace/fr.n7.petrinet.feature/.project new file mode 100644 index 0000000..8c0b951 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.feature/.project @@ -0,0 +1,17 @@ + + + fr.n7.petrinet.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/eclipse-workspace/fr.n7.petrinet.feature/build.properties b/eclipse-workspace/fr.n7.petrinet.feature/build.properties new file mode 100644 index 0000000..64f93a9 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.feature/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml diff --git a/eclipse-workspace/fr.n7.petrinet.feature/feature.xml b/eclipse-workspace/fr.n7.petrinet.feature/feature.xml new file mode 100644 index 0000000..f84faad --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.feature/feature.xml @@ -0,0 +1,47 @@ + + + + + [Enter Feature Description here.] + + + + [Enter Copyright Description here.] + + + + [Enter License Description here.] + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet.tests/.classpath b/eclipse-workspace/fr.n7.petrinet.tests/.classpath new file mode 100644 index 0000000..c3ba59e --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet.tests/.project b/eclipse-workspace/fr.n7.petrinet.tests/.project new file mode 100644 index 0000000..a8cd606 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/.project @@ -0,0 +1,28 @@ + + + fr.n7.petrinet.tests + + + + + + 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/eclipse-workspace/fr.n7.petrinet.tests/META-INF/MANIFEST.MF b/eclipse-workspace/fr.n7.petrinet.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000..a00fb6b --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.petrinet.tests;singleton:=true +Automatic-Module-Name: fr.n7.petrinet.tests +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: petrinet.tests +Require-Bundle: org.eclipse.core.runtime, + fr.n7.petrinet;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/eclipse-workspace/fr.n7.petrinet.tests/build.properties b/eclipse-workspace/fr.n7.petrinet.tests/build.properties new file mode 100644 index 0000000..08af068 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/build.properties @@ -0,0 +1,8 @@ +# + +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/eclipse-workspace/fr.n7.petrinet.tests/plugin.properties b/eclipse-workspace/fr.n7.petrinet.tests/plugin.properties new file mode 100644 index 0000000..d8d0263 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/plugin.properties @@ -0,0 +1,4 @@ +# + +pluginName = Petrinet Tests +providerName = www.example.org diff --git a/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/ArcTest.java b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/ArcTest.java new file mode 100644 index 0000000..35e7c5a --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/ArcTest.java @@ -0,0 +1,89 @@ +/** + */ +package petrinet.tests; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +import petrinet.Arc; +import petrinet.PetrinetFactory; + +/** + * + * A test case for the model object 'Arc'. + * + * @generated + */ +public class ArcTest extends TestCase { + + /** + * The fixture for this Arc test case. + * + * + * @generated + */ + protected Arc fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(ArcTest.class); + } + + /** + * Constructs a new Arc test case with the given name. + * + * + * @generated + */ + public ArcTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Arc test case. + * + * + * @generated + */ + protected void setFixture(Arc fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Arc test case. + * + * + * @generated + */ + protected Arc getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(PetrinetFactory.eINSTANCE.createArc()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //ArcTest diff --git a/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/NetworkTest.java b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/NetworkTest.java new file mode 100644 index 0000000..1db5cfb --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/NetworkTest.java @@ -0,0 +1,89 @@ +/** + */ +package petrinet.tests; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +import petrinet.Network; +import petrinet.PetrinetFactory; + +/** + * + * A test case for the model object 'Network'. + * + * @generated + */ +public class NetworkTest extends TestCase { + + /** + * The fixture for this Network test case. + * + * + * @generated + */ + protected Network fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(NetworkTest.class); + } + + /** + * Constructs a new Network test case with the given name. + * + * + * @generated + */ + public NetworkTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Network test case. + * + * + * @generated + */ + protected void setFixture(Network fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Network test case. + * + * + * @generated + */ + protected Network getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(PetrinetFactory.eINSTANCE.createNetwork()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //NetworkTest diff --git a/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/NodeTest.java b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/NodeTest.java new file mode 100644 index 0000000..0f8f143 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/NodeTest.java @@ -0,0 +1,55 @@ +/** + */ +package petrinet.tests; + +import junit.framework.TestCase; + +import petrinet.Node; + +/** + * + * A test case for the model object 'Node'. + * + * @generated + */ +public abstract class NodeTest extends TestCase { + + /** + * The fixture for this Node test case. + * + * + * @generated + */ + protected Node fixture = null; + + /** + * Constructs a new Node test case with the given name. + * + * + * @generated + */ + public NodeTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Node test case. + * + * + * @generated + */ + protected void setFixture(Node fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Node test case. + * + * + * @generated + */ + protected Node getFixture() { + return fixture; + } + +} //NodeTest diff --git a/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PetrinetAllTests.java b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PetrinetAllTests.java new file mode 100644 index 0000000..68778b7 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PetrinetAllTests.java @@ -0,0 +1,46 @@ +/** + */ +package petrinet.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'Petrinet' model. + * + * @generated + */ +public class PetrinetAllTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new PetrinetAllTests("Petrinet Tests"); + return suite; + } + + /** + * + * + * @generated + */ + public PetrinetAllTests(String name) { + super(name); + } + +} //PetrinetAllTests diff --git a/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PetrinetExample.java b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PetrinetExample.java new file mode 100644 index 0000000..a0417c6 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PetrinetExample.java @@ -0,0 +1,121 @@ +/** + */ +package petrinet.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.util.Diagnostician; + +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; + +import petrinet.Network; +import petrinet.PetrinetFactory; +import petrinet.PetrinetPackage; + +/** + * + * A sample utility for the 'petrinet' package. + * + * @generated + */ +public class PetrinetExample { + /** + * + * Load all the argument file paths or URIs as instances of the model. + * + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put + (Resource.Factory.Registry.DEFAULT_EXTENSION, + new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put + (PetrinetPackage.eNS_URI, + PetrinetPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.petrinet")); + Network root = PetrinetFactory.eINSTANCE.createNetwork(); + resource.getContents().add(root); + resource.save(System.out, null); + } + catch (IOException exception) { + exception.printStackTrace(); + } + } + else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() ? URI.createFileURI(file.getAbsolutePath()): URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } + catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * + * Prints diagnostics with indentation. + * + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} //PetrinetExample diff --git a/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PetrinetTests.java b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PetrinetTests.java new file mode 100644 index 0000000..0fb58fd --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PetrinetTests.java @@ -0,0 +1,46 @@ +/** + */ +package petrinet.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'petrinet' package. + * + * @generated + */ +public class PetrinetTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new PetrinetTests("petrinet Tests"); + return suite; + } + + /** + * + * + * @generated + */ + public PetrinetTests(String name) { + super(name); + } + +} //PetrinetTests diff --git a/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PlaceTest.java b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PlaceTest.java new file mode 100644 index 0000000..19ff730 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/PlaceTest.java @@ -0,0 +1,70 @@ +/** + */ +package petrinet.tests; + +import junit.textui.TestRunner; + +import petrinet.PetrinetFactory; +import petrinet.Place; + +/** + * + * A test case for the model object 'Place'. + * + * @generated + */ +public class PlaceTest extends NodeTest { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(PlaceTest.class); + } + + /** + * Constructs a new Place test case with the given name. + * + * + * @generated + */ + public PlaceTest(String name) { + super(name); + } + + /** + * Returns the fixture for this Place test case. + * + * + * @generated + */ + @Override + protected Place getFixture() { + return (Place)fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(PetrinetFactory.eINSTANCE.createPlace()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //PlaceTest diff --git a/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/TransitionTest.java b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/TransitionTest.java new file mode 100644 index 0000000..eb87365 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet.tests/src/petrinet/tests/TransitionTest.java @@ -0,0 +1,70 @@ +/** + */ +package petrinet.tests; + +import junit.textui.TestRunner; + +import petrinet.PetrinetFactory; +import petrinet.Transition; + +/** + * + * A test case for the model object 'Transition'. + * + * @generated + */ +public class TransitionTest extends NodeTest { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(TransitionTest.class); + } + + /** + * Constructs a new Transition test case with the given name. + * + * + * @generated + */ + public TransitionTest(String name) { + super(name); + } + + /** + * Returns the fixture for this Transition test case. + * + * + * @generated + */ + @Override + protected Transition getFixture() { + return (Transition)fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(PetrinetFactory.eINSTANCE.createTransition()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //TransitionTest diff --git a/eclipse-workspace/fr.n7.petrinet/.classpath b/eclipse-workspace/fr.n7.petrinet/.classpath new file mode 100644 index 0000000..c3ba59e --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet/.project b/eclipse-workspace/fr.n7.petrinet/.project index 4c7a421..8230b7d 100644 --- a/eclipse-workspace/fr.n7.petrinet/.project +++ b/eclipse-workspace/fr.n7.petrinet/.project @@ -5,6 +5,11 @@ + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.ocl.pivot.ui.oclbuilder @@ -26,8 +31,20 @@ + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + org.eclipse.ocl.pivot.ui.oclnature + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature diff --git a/eclipse-workspace/fr.n7.petrinet/META-INF/MANIFEST.MF b/eclipse-workspace/fr.n7.petrinet/META-INF/MANIFEST.MF new file mode 100644 index 0000000..d701b53 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.petrinet;singleton:=true +Automatic-Module-Name: fr.n7.petrinet +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: petrinet, + petrinet.impl, + petrinet.util +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/eclipse-workspace/fr.n7.petrinet/build.properties b/eclipse-workspace/fr.n7.petrinet/build.properties new file mode 100644 index 0000000..4465407 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/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/eclipse-workspace/fr.n7.petrinet/petrinet.aird b/eclipse-workspace/fr.n7.petrinet/petrinet.aird index 8d8f3d7..f05cd3d 100644 --- a/eclipse-workspace/fr.n7.petrinet/petrinet.aird +++ b/eclipse-workspace/fr.n7.petrinet/petrinet.aird @@ -4,7 +4,7 @@ petrinet.ecore - + @@ -311,6 +311,7 @@ labelSize + bold labelSize diff --git a/eclipse-workspace/fr.n7.petrinet/petrinet.genmodel b/eclipse-workspace/fr.n7.petrinet/petrinet.genmodel new file mode 100644 index 0000000..09d1513 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/petrinet.genmodel @@ -0,0 +1,28 @@ + + + petrinet.ecore + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet/plugin.properties b/eclipse-workspace/fr.n7.petrinet/plugin.properties new file mode 100644 index 0000000..302299f --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/plugin.properties @@ -0,0 +1,4 @@ +# + +pluginName = Petrinet Model +providerName = www.example.org diff --git a/eclipse-workspace/fr.n7.petrinet/plugin.xml b/eclipse-workspace/fr.n7.petrinet/plugin.xml new file mode 100644 index 0000000..289ba90 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/plugin.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/Arc.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Arc.java new file mode 100644 index 0000000..1f18c85 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Arc.java @@ -0,0 +1,92 @@ +/** + */ +package petrinet; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Arc'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link petrinet.Arc#getWeight Weight}
  • + *
  • {@link petrinet.Arc#isOutgoing Outgoing}
  • + *
  • {@link petrinet.Arc#getTarget Target}
  • + *
+ * + * @see petrinet.PetrinetPackage#getArc() + * @model + * @generated + */ +public interface Arc extends EObject { + /** + * Returns the value of the 'Weight' attribute. + * + * + * @return the value of the 'Weight' attribute. + * @see #setWeight(int) + * @see petrinet.PetrinetPackage#getArc_Weight() + * @model required="true" + * @generated + */ + int getWeight(); + + /** + * Sets the value of the '{@link petrinet.Arc#getWeight Weight}' attribute. + * + * + * @param value the new value of the 'Weight' attribute. + * @see #getWeight() + * @generated + */ + void setWeight(int value); + + /** + * Returns the value of the 'Outgoing' attribute. + * + * + * @return the value of the 'Outgoing' attribute. + * @see #setOutgoing(boolean) + * @see petrinet.PetrinetPackage#getArc_Outgoing() + * @model required="true" + * @generated + */ + boolean isOutgoing(); + + /** + * Sets the value of the '{@link petrinet.Arc#isOutgoing Outgoing}' attribute. + * + * + * @param value the new value of the 'Outgoing' attribute. + * @see #isOutgoing() + * @generated + */ + void setOutgoing(boolean value); + + /** + * Returns the value of the 'Target' reference. + * + * + * @return the value of the 'Target' reference. + * @see #setTarget(Place) + * @see petrinet.PetrinetPackage#getArc_Target() + * @model required="true" + * @generated + */ + Place getTarget(); + + /** + * Sets the value of the '{@link petrinet.Arc#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(Place value); + +} // Arc diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/Network.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Network.java new file mode 100644 index 0000000..f072256 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Network.java @@ -0,0 +1,61 @@ +/** + */ +package petrinet; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Network'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link petrinet.Network#getName Name}
  • + *
  • {@link petrinet.Network#getNodes Nodes}
  • + *
+ * + * @see petrinet.PetrinetPackage#getNetwork() + * @model + * @generated + */ +public interface Network extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see petrinet.PetrinetPackage#getNetwork_Name() + * @model required="true" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link petrinet.Network#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Nodes' containment reference list. + * The list contents are of type {@link petrinet.Node}. + * + * + * @return the value of the 'Nodes' containment reference list. + * @see petrinet.PetrinetPackage#getNetwork_Nodes() + * @model containment="true" + * @generated + */ + EList getNodes(); + +} // Network diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/Node.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Node.java new file mode 100644 index 0000000..71e2bd4 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Node.java @@ -0,0 +1,46 @@ +/** + */ +package petrinet; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Node'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link petrinet.Node#getName Name}
  • + *
+ * + * @see petrinet.PetrinetPackage#getNode() + * @model abstract="true" + * @generated + */ +public interface Node extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see petrinet.PetrinetPackage#getNode_Name() + * @model required="true" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link petrinet.Node#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Node diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/PetrinetFactory.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/PetrinetFactory.java new file mode 100644 index 0000000..ec53b65 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/PetrinetFactory.java @@ -0,0 +1,69 @@ +/** + */ +package petrinet; + +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 petrinet.PetrinetPackage + * @generated + */ +public interface PetrinetFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + PetrinetFactory eINSTANCE = petrinet.impl.PetrinetFactoryImpl.init(); + + /** + * Returns a new object of class 'Network'. + * + * + * @return a new object of class 'Network'. + * @generated + */ + Network createNetwork(); + + /** + * Returns a new object of class 'Place'. + * + * + * @return a new object of class 'Place'. + * @generated + */ + Place createPlace(); + + /** + * Returns a new object of class 'Arc'. + * + * + * @return a new object of class 'Arc'. + * @generated + */ + Arc createArc(); + + /** + * Returns a new object of class 'Transition'. + * + * + * @return a new object of class 'Transition'. + * @generated + */ + Transition createTransition(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + PetrinetPackage getPetrinetPackage(); + +} //PetrinetFactory diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/PetrinetPackage.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/PetrinetPackage.java new file mode 100644 index 0000000..6429173 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/PetrinetPackage.java @@ -0,0 +1,567 @@ +/** + */ +package petrinet; + +import org.eclipse.emf.ecore.EAttribute; +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 petrinet.PetrinetFactory + * @model kind="package" + * @generated + */ +public interface PetrinetPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "petrinet"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://petrinet"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "petrinet"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + PetrinetPackage eINSTANCE = petrinet.impl.PetrinetPackageImpl.init(); + + /** + * The meta object id for the '{@link petrinet.impl.NetworkImpl Network}' class. + * + * + * @see petrinet.impl.NetworkImpl + * @see petrinet.impl.PetrinetPackageImpl#getNetwork() + * @generated + */ + int NETWORK = 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int NETWORK__NAME = 0; + + /** + * The feature id for the 'Nodes' containment reference list. + * + * + * @generated + * @ordered + */ + int NETWORK__NODES = 1; + + /** + * The number of structural features of the 'Network' class. + * + * + * @generated + * @ordered + */ + int NETWORK_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Network' class. + * + * + * @generated + * @ordered + */ + int NETWORK_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link petrinet.impl.NodeImpl Node}' class. + * + * + * @see petrinet.impl.NodeImpl + * @see petrinet.impl.PetrinetPackageImpl#getNode() + * @generated + */ + int NODE = 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int NODE__NAME = 0; + + /** + * The number of structural features of the 'Node' class. + * + * + * @generated + * @ordered + */ + int NODE_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Node' class. + * + * + * @generated + * @ordered + */ + int NODE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link petrinet.impl.PlaceImpl Place}' class. + * + * + * @see petrinet.impl.PlaceImpl + * @see petrinet.impl.PetrinetPackageImpl#getPlace() + * @generated + */ + int PLACE = 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PLACE__NAME = NODE__NAME; + + /** + * The feature id for the 'Tokens' attribute. + * + * + * @generated + * @ordered + */ + int PLACE__TOKENS = NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Place' class. + * + * + * @generated + * @ordered + */ + int PLACE_FEATURE_COUNT = NODE_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Place' class. + * + * + * @generated + * @ordered + */ + int PLACE_OPERATION_COUNT = NODE_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link petrinet.impl.ArcImpl Arc}' class. + * + * + * @see petrinet.impl.ArcImpl + * @see petrinet.impl.PetrinetPackageImpl#getArc() + * @generated + */ + int ARC = 3; + + /** + * The feature id for the 'Weight' attribute. + * + * + * @generated + * @ordered + */ + int ARC__WEIGHT = 0; + + /** + * The feature id for the 'Outgoing' attribute. + * + * + * @generated + * @ordered + */ + int ARC__OUTGOING = 1; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int ARC__TARGET = 2; + + /** + * The number of structural features of the 'Arc' class. + * + * + * @generated + * @ordered + */ + int ARC_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Arc' class. + * + * + * @generated + * @ordered + */ + int ARC_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link petrinet.impl.TransitionImpl Transition}' class. + * + * + * @see petrinet.impl.TransitionImpl + * @see petrinet.impl.PetrinetPackageImpl#getTransition() + * @generated + */ + int TRANSITION = 4; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int TRANSITION__NAME = NODE__NAME; + + /** + * The feature id for the 'Arcs' containment reference list. + * + * + * @generated + * @ordered + */ + int TRANSITION__ARCS = NODE_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Transition' class. + * + * + * @generated + * @ordered + */ + int TRANSITION_FEATURE_COUNT = NODE_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Transition' class. + * + * + * @generated + * @ordered + */ + int TRANSITION_OPERATION_COUNT = NODE_OPERATION_COUNT + 0; + + + /** + * Returns the meta object for class '{@link petrinet.Network Network}'. + * + * + * @return the meta object for class 'Network'. + * @see petrinet.Network + * @generated + */ + EClass getNetwork(); + + /** + * Returns the meta object for the attribute '{@link petrinet.Network#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see petrinet.Network#getName() + * @see #getNetwork() + * @generated + */ + EAttribute getNetwork_Name(); + + /** + * Returns the meta object for the containment reference list '{@link petrinet.Network#getNodes Nodes}'. + * + * + * @return the meta object for the containment reference list 'Nodes'. + * @see petrinet.Network#getNodes() + * @see #getNetwork() + * @generated + */ + EReference getNetwork_Nodes(); + + /** + * Returns the meta object for class '{@link petrinet.Node Node}'. + * + * + * @return the meta object for class 'Node'. + * @see petrinet.Node + * @generated + */ + EClass getNode(); + + /** + * Returns the meta object for the attribute '{@link petrinet.Node#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see petrinet.Node#getName() + * @see #getNode() + * @generated + */ + EAttribute getNode_Name(); + + /** + * Returns the meta object for class '{@link petrinet.Place Place}'. + * + * + * @return the meta object for class 'Place'. + * @see petrinet.Place + * @generated + */ + EClass getPlace(); + + /** + * Returns the meta object for the attribute '{@link petrinet.Place#getTokens Tokens}'. + * + * + * @return the meta object for the attribute 'Tokens'. + * @see petrinet.Place#getTokens() + * @see #getPlace() + * @generated + */ + EAttribute getPlace_Tokens(); + + /** + * Returns the meta object for class '{@link petrinet.Arc Arc}'. + * + * + * @return the meta object for class 'Arc'. + * @see petrinet.Arc + * @generated + */ + EClass getArc(); + + /** + * Returns the meta object for the attribute '{@link petrinet.Arc#getWeight Weight}'. + * + * + * @return the meta object for the attribute 'Weight'. + * @see petrinet.Arc#getWeight() + * @see #getArc() + * @generated + */ + EAttribute getArc_Weight(); + + /** + * Returns the meta object for the attribute '{@link petrinet.Arc#isOutgoing Outgoing}'. + * + * + * @return the meta object for the attribute 'Outgoing'. + * @see petrinet.Arc#isOutgoing() + * @see #getArc() + * @generated + */ + EAttribute getArc_Outgoing(); + + /** + * Returns the meta object for the reference '{@link petrinet.Arc#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see petrinet.Arc#getTarget() + * @see #getArc() + * @generated + */ + EReference getArc_Target(); + + /** + * Returns the meta object for class '{@link petrinet.Transition Transition}'. + * + * + * @return the meta object for class 'Transition'. + * @see petrinet.Transition + * @generated + */ + EClass getTransition(); + + /** + * Returns the meta object for the containment reference list '{@link petrinet.Transition#getArcs Arcs}'. + * + * + * @return the meta object for the containment reference list 'Arcs'. + * @see petrinet.Transition#getArcs() + * @see #getTransition() + * @generated + */ + EReference getTransition_Arcs(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + PetrinetFactory getPetrinetFactory(); + + /** + * + * 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 petrinet.impl.NetworkImpl Network}' class. + * + * + * @see petrinet.impl.NetworkImpl + * @see petrinet.impl.PetrinetPackageImpl#getNetwork() + * @generated + */ + EClass NETWORK = eINSTANCE.getNetwork(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute NETWORK__NAME = eINSTANCE.getNetwork_Name(); + + /** + * The meta object literal for the 'Nodes' containment reference list feature. + * + * + * @generated + */ + EReference NETWORK__NODES = eINSTANCE.getNetwork_Nodes(); + + /** + * The meta object literal for the '{@link petrinet.impl.NodeImpl Node}' class. + * + * + * @see petrinet.impl.NodeImpl + * @see petrinet.impl.PetrinetPackageImpl#getNode() + * @generated + */ + EClass NODE = eINSTANCE.getNode(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute NODE__NAME = eINSTANCE.getNode_Name(); + + /** + * The meta object literal for the '{@link petrinet.impl.PlaceImpl Place}' class. + * + * + * @see petrinet.impl.PlaceImpl + * @see petrinet.impl.PetrinetPackageImpl#getPlace() + * @generated + */ + EClass PLACE = eINSTANCE.getPlace(); + + /** + * The meta object literal for the 'Tokens' attribute feature. + * + * + * @generated + */ + EAttribute PLACE__TOKENS = eINSTANCE.getPlace_Tokens(); + + /** + * The meta object literal for the '{@link petrinet.impl.ArcImpl Arc}' class. + * + * + * @see petrinet.impl.ArcImpl + * @see petrinet.impl.PetrinetPackageImpl#getArc() + * @generated + */ + EClass ARC = eINSTANCE.getArc(); + + /** + * The meta object literal for the 'Weight' attribute feature. + * + * + * @generated + */ + EAttribute ARC__WEIGHT = eINSTANCE.getArc_Weight(); + + /** + * The meta object literal for the 'Outgoing' attribute feature. + * + * + * @generated + */ + EAttribute ARC__OUTGOING = eINSTANCE.getArc_Outgoing(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference ARC__TARGET = eINSTANCE.getArc_Target(); + + /** + * The meta object literal for the '{@link petrinet.impl.TransitionImpl Transition}' class. + * + * + * @see petrinet.impl.TransitionImpl + * @see petrinet.impl.PetrinetPackageImpl#getTransition() + * @generated + */ + EClass TRANSITION = eINSTANCE.getTransition(); + + /** + * The meta object literal for the 'Arcs' containment reference list feature. + * + * + * @generated + */ + EReference TRANSITION__ARCS = eINSTANCE.getTransition_Arcs(); + + } + +} //PetrinetPackage diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/Place.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Place.java new file mode 100644 index 0000000..1b45b65 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Place.java @@ -0,0 +1,45 @@ +/** + */ +package petrinet; + + +/** + * + * A representation of the model object 'Place'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link petrinet.Place#getTokens Tokens}
  • + *
+ * + * @see petrinet.PetrinetPackage#getPlace() + * @model + * @generated + */ +public interface Place extends Node { + /** + * Returns the value of the 'Tokens' attribute. + * + * + * @return the value of the 'Tokens' attribute. + * @see #setTokens(int) + * @see petrinet.PetrinetPackage#getPlace_Tokens() + * @model required="true" + * @generated + */ + int getTokens(); + + /** + * Sets the value of the '{@link petrinet.Place#getTokens Tokens}' attribute. + * + * + * @param value the new value of the 'Tokens' attribute. + * @see #getTokens() + * @generated + */ + void setTokens(int value); + +} // Place diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/Transition.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Transition.java new file mode 100644 index 0000000..e81ec0b --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/Transition.java @@ -0,0 +1,36 @@ +/** + */ +package petrinet; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Transition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link petrinet.Transition#getArcs Arcs}
  • + *
+ * + * @see petrinet.PetrinetPackage#getTransition() + * @model + * @generated + */ +public interface Transition extends Node { + /** + * Returns the value of the 'Arcs' containment reference list. + * The list contents are of type {@link petrinet.Arc}. + * + * + * @return the value of the 'Arcs' containment reference list. + * @see petrinet.PetrinetPackage#getTransition_Arcs() + * @model containment="true" + * @generated + */ + EList getArcs(); + +} // Transition diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/ArcImpl.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/ArcImpl.java new file mode 100644 index 0000000..64c5065 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/ArcImpl.java @@ -0,0 +1,279 @@ +/** + */ +package petrinet.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import petrinet.Arc; +import petrinet.PetrinetPackage; +import petrinet.Place; + +/** + * + * An implementation of the model object 'Arc'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link petrinet.impl.ArcImpl#getWeight Weight}
  • + *
  • {@link petrinet.impl.ArcImpl#isOutgoing Outgoing}
  • + *
  • {@link petrinet.impl.ArcImpl#getTarget Target}
  • + *
+ * + * @generated + */ +public class ArcImpl extends MinimalEObjectImpl.Container implements Arc { + /** + * The default value of the '{@link #getWeight() Weight}' attribute. + * + * + * @see #getWeight() + * @generated + * @ordered + */ + protected static final int WEIGHT_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getWeight() Weight}' attribute. + * + * + * @see #getWeight() + * @generated + * @ordered + */ + protected int weight = WEIGHT_EDEFAULT; + + /** + * The default value of the '{@link #isOutgoing() Outgoing}' attribute. + * + * + * @see #isOutgoing() + * @generated + * @ordered + */ + protected static final boolean OUTGOING_EDEFAULT = false; + + /** + * The cached value of the '{@link #isOutgoing() Outgoing}' attribute. + * + * + * @see #isOutgoing() + * @generated + * @ordered + */ + protected boolean outgoing = OUTGOING_EDEFAULT; + + /** + * The cached value of the '{@link #getTarget() Target}' reference. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected Place target; + + /** + * + * + * @generated + */ + protected ArcImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PetrinetPackage.Literals.ARC; + } + + /** + * + * + * @generated + */ + public int getWeight() { + return weight; + } + + /** + * + * + * @generated + */ + public void setWeight(int newWeight) { + int oldWeight = weight; + weight = newWeight; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PetrinetPackage.ARC__WEIGHT, oldWeight, weight)); + } + + /** + * + * + * @generated + */ + public boolean isOutgoing() { + return outgoing; + } + + /** + * + * + * @generated + */ + public void setOutgoing(boolean newOutgoing) { + boolean oldOutgoing = outgoing; + outgoing = newOutgoing; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PetrinetPackage.ARC__OUTGOING, oldOutgoing, outgoing)); + } + + /** + * + * + * @generated + */ + public Place getTarget() { + if (target != null && target.eIsProxy()) { + InternalEObject oldTarget = (InternalEObject)target; + target = (Place)eResolveProxy(oldTarget); + if (target != oldTarget) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, PetrinetPackage.ARC__TARGET, oldTarget, target)); + } + } + return target; + } + + /** + * + * + * @generated + */ + public Place basicGetTarget() { + return target; + } + + /** + * + * + * @generated + */ + public void setTarget(Place newTarget) { + Place oldTarget = target; + target = newTarget; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PetrinetPackage.ARC__TARGET, oldTarget, target)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PetrinetPackage.ARC__WEIGHT: + return getWeight(); + case PetrinetPackage.ARC__OUTGOING: + return isOutgoing(); + case PetrinetPackage.ARC__TARGET: + if (resolve) return getTarget(); + return basicGetTarget(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PetrinetPackage.ARC__WEIGHT: + setWeight((Integer)newValue); + return; + case PetrinetPackage.ARC__OUTGOING: + setOutgoing((Boolean)newValue); + return; + case PetrinetPackage.ARC__TARGET: + setTarget((Place)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PetrinetPackage.ARC__WEIGHT: + setWeight(WEIGHT_EDEFAULT); + return; + case PetrinetPackage.ARC__OUTGOING: + setOutgoing(OUTGOING_EDEFAULT); + return; + case PetrinetPackage.ARC__TARGET: + setTarget((Place)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PetrinetPackage.ARC__WEIGHT: + return weight != WEIGHT_EDEFAULT; + case PetrinetPackage.ARC__OUTGOING: + return outgoing != OUTGOING_EDEFAULT; + case PetrinetPackage.ARC__TARGET: + return target != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (weight: "); + result.append(weight); + result.append(", outgoing: "); + result.append(outgoing); + result.append(')'); + return result.toString(); + } + +} //ArcImpl diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/NetworkImpl.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/NetworkImpl.java new file mode 100644 index 0000000..26a5b45 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/NetworkImpl.java @@ -0,0 +1,222 @@ +/** + */ +package petrinet.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import petrinet.Network; +import petrinet.Node; +import petrinet.PetrinetPackage; + +/** + * + * An implementation of the model object 'Network'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link petrinet.impl.NetworkImpl#getName Name}
  • + *
  • {@link petrinet.impl.NetworkImpl#getNodes Nodes}
  • + *
+ * + * @generated + */ +public class NetworkImpl extends MinimalEObjectImpl.Container implements Network { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getNodes() Nodes}' containment reference list. + * + * + * @see #getNodes() + * @generated + * @ordered + */ + protected EList nodes; + + /** + * + * + * @generated + */ + protected NetworkImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PetrinetPackage.Literals.NETWORK; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PetrinetPackage.NETWORK__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public EList getNodes() { + if (nodes == null) { + nodes = new EObjectContainmentEList(Node.class, this, PetrinetPackage.NETWORK__NODES); + } + return nodes; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PetrinetPackage.NETWORK__NODES: + return ((InternalEList)getNodes()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PetrinetPackage.NETWORK__NAME: + return getName(); + case PetrinetPackage.NETWORK__NODES: + return getNodes(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PetrinetPackage.NETWORK__NAME: + setName((String)newValue); + return; + case PetrinetPackage.NETWORK__NODES: + getNodes().clear(); + getNodes().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PetrinetPackage.NETWORK__NAME: + setName(NAME_EDEFAULT); + return; + case PetrinetPackage.NETWORK__NODES: + getNodes().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PetrinetPackage.NETWORK__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case PetrinetPackage.NETWORK__NODES: + return nodes != null && !nodes.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //NetworkImpl diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/NodeImpl.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/NodeImpl.java new file mode 100644 index 0000000..863c95c --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/NodeImpl.java @@ -0,0 +1,163 @@ +/** + */ +package petrinet.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import petrinet.Node; +import petrinet.PetrinetPackage; + +/** + * + * An implementation of the model object 'Node'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link petrinet.impl.NodeImpl#getName Name}
  • + *
+ * + * @generated + */ +public abstract class NodeImpl extends MinimalEObjectImpl.Container implements Node { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected NodeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PetrinetPackage.Literals.NODE; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PetrinetPackage.NODE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PetrinetPackage.NODE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PetrinetPackage.NODE__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PetrinetPackage.NODE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PetrinetPackage.NODE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //NodeImpl diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/PetrinetFactoryImpl.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/PetrinetFactoryImpl.java new file mode 100644 index 0000000..d769926 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/PetrinetFactoryImpl.java @@ -0,0 +1,128 @@ +/** + */ +package petrinet.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import petrinet.*; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class PetrinetFactoryImpl extends EFactoryImpl implements PetrinetFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static PetrinetFactory init() { + try { + PetrinetFactory thePetrinetFactory = (PetrinetFactory)EPackage.Registry.INSTANCE.getEFactory(PetrinetPackage.eNS_URI); + if (thePetrinetFactory != null) { + return thePetrinetFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new PetrinetFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public PetrinetFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case PetrinetPackage.NETWORK: return createNetwork(); + case PetrinetPackage.PLACE: return createPlace(); + case PetrinetPackage.ARC: return createArc(); + case PetrinetPackage.TRANSITION: return createTransition(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public Network createNetwork() { + NetworkImpl network = new NetworkImpl(); + return network; + } + + /** + * + * + * @generated + */ + public Place createPlace() { + PlaceImpl place = new PlaceImpl(); + return place; + } + + /** + * + * + * @generated + */ + public Arc createArc() { + ArcImpl arc = new ArcImpl(); + return arc; + } + + /** + * + * + * @generated + */ + public Transition createTransition() { + TransitionImpl transition = new TransitionImpl(); + return transition; + } + + /** + * + * + * @generated + */ + public PetrinetPackage getPetrinetPackage() { + return (PetrinetPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static PetrinetPackage getPackage() { + return PetrinetPackage.eINSTANCE; + } + +} //PetrinetFactoryImpl diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/PetrinetPackageImpl.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/PetrinetPackageImpl.java new file mode 100644 index 0000000..86e42b2 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/PetrinetPackageImpl.java @@ -0,0 +1,341 @@ +/** + */ +package petrinet.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import petrinet.Arc; +import petrinet.Network; +import petrinet.Node; +import petrinet.PetrinetFactory; +import petrinet.PetrinetPackage; +import petrinet.Place; +import petrinet.Transition; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class PetrinetPackageImpl extends EPackageImpl implements PetrinetPackage { + /** + * + * + * @generated + */ + private EClass networkEClass = null; + + /** + * + * + * @generated + */ + private EClass nodeEClass = null; + + /** + * + * + * @generated + */ + private EClass placeEClass = null; + + /** + * + * + * @generated + */ + private EClass arcEClass = null; + + /** + * + * + * @generated + */ + private EClass transitionEClass = 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 petrinet.PetrinetPackage#eNS_URI + * @see #init() + * @generated + */ + private PetrinetPackageImpl() { + super(eNS_URI, PetrinetFactory.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 PetrinetPackage#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 PetrinetPackage init() { + if (isInited) return (PetrinetPackage)EPackage.Registry.INSTANCE.getEPackage(PetrinetPackage.eNS_URI); + + // Obtain or create and register package + Object registeredPetrinetPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + PetrinetPackageImpl thePetrinetPackage = registeredPetrinetPackage instanceof PetrinetPackageImpl ? (PetrinetPackageImpl)registeredPetrinetPackage : new PetrinetPackageImpl(); + + isInited = true; + + // Create package meta-data objects + thePetrinetPackage.createPackageContents(); + + // Initialize created meta-data + thePetrinetPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + thePetrinetPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(PetrinetPackage.eNS_URI, thePetrinetPackage); + return thePetrinetPackage; + } + + /** + * + * + * @generated + */ + public EClass getNetwork() { + return networkEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getNetwork_Name() { + return (EAttribute)networkEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getNetwork_Nodes() { + return (EReference)networkEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getNode() { + return nodeEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getNode_Name() { + return (EAttribute)nodeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getPlace() { + return placeEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getPlace_Tokens() { + return (EAttribute)placeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getArc() { + return arcEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getArc_Weight() { + return (EAttribute)arcEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getArc_Outgoing() { + return (EAttribute)arcEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getArc_Target() { + return (EReference)arcEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getTransition() { + return transitionEClass; + } + + /** + * + * + * @generated + */ + public EReference getTransition_Arcs() { + return (EReference)transitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public PetrinetFactory getPetrinetFactory() { + return (PetrinetFactory)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 + networkEClass = createEClass(NETWORK); + createEAttribute(networkEClass, NETWORK__NAME); + createEReference(networkEClass, NETWORK__NODES); + + nodeEClass = createEClass(NODE); + createEAttribute(nodeEClass, NODE__NAME); + + placeEClass = createEClass(PLACE); + createEAttribute(placeEClass, PLACE__TOKENS); + + arcEClass = createEClass(ARC); + createEAttribute(arcEClass, ARC__WEIGHT); + createEAttribute(arcEClass, ARC__OUTGOING); + createEReference(arcEClass, ARC__TARGET); + + transitionEClass = createEClass(TRANSITION); + createEReference(transitionEClass, TRANSITION__ARCS); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + placeEClass.getESuperTypes().add(this.getNode()); + transitionEClass.getESuperTypes().add(this.getNode()); + + // Initialize classes, features, and operations; add parameters + initEClass(networkEClass, Network.class, "Network", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getNetwork_Name(), ecorePackage.getEString(), "name", null, 1, 1, Network.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getNetwork_Nodes(), this.getNode(), null, "nodes", null, 0, -1, Network.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(nodeEClass, Node.class, "Node", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getNode_Name(), ecorePackage.getEString(), "name", null, 1, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(placeEClass, Place.class, "Place", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPlace_Tokens(), ecorePackage.getEInt(), "tokens", null, 1, 1, Place.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(arcEClass, Arc.class, "Arc", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getArc_Weight(), ecorePackage.getEInt(), "weight", null, 1, 1, Arc.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getArc_Outgoing(), ecorePackage.getEBoolean(), "outgoing", null, 1, 1, Arc.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getArc_Target(), this.getPlace(), null, "target", null, 1, 1, Arc.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(transitionEClass, Transition.class, "Transition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getTransition_Arcs(), this.getArc(), null, "arcs", null, 0, -1, Transition.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); + } + +} //PetrinetPackageImpl diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/PlaceImpl.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/PlaceImpl.java new file mode 100644 index 0000000..68d8d86 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/PlaceImpl.java @@ -0,0 +1,162 @@ +/** + */ +package petrinet.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import petrinet.PetrinetPackage; +import petrinet.Place; + +/** + * + * An implementation of the model object 'Place'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link petrinet.impl.PlaceImpl#getTokens Tokens}
  • + *
+ * + * @generated + */ +public class PlaceImpl extends NodeImpl implements Place { + /** + * The default value of the '{@link #getTokens() Tokens}' attribute. + * + * + * @see #getTokens() + * @generated + * @ordered + */ + protected static final int TOKENS_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getTokens() Tokens}' attribute. + * + * + * @see #getTokens() + * @generated + * @ordered + */ + protected int tokens = TOKENS_EDEFAULT; + + /** + * + * + * @generated + */ + protected PlaceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PetrinetPackage.Literals.PLACE; + } + + /** + * + * + * @generated + */ + public int getTokens() { + return tokens; + } + + /** + * + * + * @generated + */ + public void setTokens(int newTokens) { + int oldTokens = tokens; + tokens = newTokens; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PetrinetPackage.PLACE__TOKENS, oldTokens, tokens)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PetrinetPackage.PLACE__TOKENS: + return getTokens(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PetrinetPackage.PLACE__TOKENS: + setTokens((Integer)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PetrinetPackage.PLACE__TOKENS: + setTokens(TOKENS_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PetrinetPackage.PLACE__TOKENS: + return tokens != TOKENS_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (tokens: "); + result.append(tokens); + result.append(')'); + return result.toString(); + } + +} //PlaceImpl diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/TransitionImpl.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/TransitionImpl.java new file mode 100644 index 0000000..a763681 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/impl/TransitionImpl.java @@ -0,0 +1,150 @@ +/** + */ +package petrinet.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import petrinet.Arc; +import petrinet.PetrinetPackage; +import petrinet.Transition; + +/** + * + * An implementation of the model object 'Transition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link petrinet.impl.TransitionImpl#getArcs Arcs}
  • + *
+ * + * @generated + */ +public class TransitionImpl extends NodeImpl implements Transition { + /** + * The cached value of the '{@link #getArcs() Arcs}' containment reference list. + * + * + * @see #getArcs() + * @generated + * @ordered + */ + protected EList arcs; + + /** + * + * + * @generated + */ + protected TransitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return PetrinetPackage.Literals.TRANSITION; + } + + /** + * + * + * @generated + */ + public EList getArcs() { + if (arcs == null) { + arcs = new EObjectContainmentEList(Arc.class, this, PetrinetPackage.TRANSITION__ARCS); + } + return arcs; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case PetrinetPackage.TRANSITION__ARCS: + return ((InternalEList)getArcs()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PetrinetPackage.TRANSITION__ARCS: + return getArcs(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PetrinetPackage.TRANSITION__ARCS: + getArcs().clear(); + getArcs().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PetrinetPackage.TRANSITION__ARCS: + getArcs().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PetrinetPackage.TRANSITION__ARCS: + return arcs != null && !arcs.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //TransitionImpl diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/util/PetrinetAdapterFactory.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/util/PetrinetAdapterFactory.java new file mode 100644 index 0000000..726ae31 --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/util/PetrinetAdapterFactory.java @@ -0,0 +1,192 @@ +/** + */ +package petrinet.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import petrinet.*; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see petrinet.PetrinetPackage + * @generated + */ +public class PetrinetAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static PetrinetPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public PetrinetAdapterFactory() { + if (modelPackage == null) { + modelPackage = PetrinetPackage.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 PetrinetSwitch modelSwitch = + new PetrinetSwitch() { + @Override + public Adapter caseNetwork(Network object) { + return createNetworkAdapter(); + } + @Override + public Adapter caseNode(Node object) { + return createNodeAdapter(); + } + @Override + public Adapter casePlace(Place object) { + return createPlaceAdapter(); + } + @Override + public Adapter caseArc(Arc object) { + return createArcAdapter(); + } + @Override + public Adapter caseTransition(Transition object) { + return createTransitionAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link petrinet.Network Network}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see petrinet.Network + * @generated + */ + public Adapter createNetworkAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link petrinet.Node Node}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see petrinet.Node + * @generated + */ + public Adapter createNodeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link petrinet.Place Place}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see petrinet.Place + * @generated + */ + public Adapter createPlaceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link petrinet.Arc Arc}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see petrinet.Arc + * @generated + */ + public Adapter createArcAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link petrinet.Transition Transition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see petrinet.Transition + * @generated + */ + public Adapter createTransitionAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //PetrinetAdapterFactory diff --git a/eclipse-workspace/fr.n7.petrinet/src/petrinet/util/PetrinetSwitch.java b/eclipse-workspace/fr.n7.petrinet/src/petrinet/util/PetrinetSwitch.java new file mode 100644 index 0000000..b5bcd9e --- /dev/null +++ b/eclipse-workspace/fr.n7.petrinet/src/petrinet/util/PetrinetSwitch.java @@ -0,0 +1,196 @@ +/** + */ +package petrinet.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import petrinet.*; + +/** + * + * 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 petrinet.PetrinetPackage + * @generated + */ +public class PetrinetSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static PetrinetPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public PetrinetSwitch() { + if (modelPackage == null) { + modelPackage = PetrinetPackage.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 PetrinetPackage.NETWORK: { + Network network = (Network)theEObject; + T result = caseNetwork(network); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PetrinetPackage.NODE: { + Node node = (Node)theEObject; + T result = caseNode(node); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PetrinetPackage.PLACE: { + Place place = (Place)theEObject; + T result = casePlace(place); + if (result == null) result = caseNode(place); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PetrinetPackage.ARC: { + Arc arc = (Arc)theEObject; + T result = caseArc(arc); + if (result == null) result = defaultCase(theEObject); + return result; + } + case PetrinetPackage.TRANSITION: { + Transition transition = (Transition)theEObject; + T result = caseTransition(transition); + if (result == null) result = caseNode(transition); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Network'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Network'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNetwork(Network object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Node'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Node'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNode(Node object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Place'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Place'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePlace(Place object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Arc'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Arc'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseArc(Arc object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Transition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Transition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTransition(Transition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //PetrinetSwitch diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/.classpath b/eclipse-workspace/fr.n7.simplepdl.edit/.classpath new file mode 100644 index 0000000..c3ba59e --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/.project b/eclipse-workspace/fr.n7.simplepdl.edit/.project new file mode 100644 index 0000000..c66c97c --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/.project @@ -0,0 +1,28 @@ + + + fr.n7.simplepdl.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/eclipse-workspace/fr.n7.simplepdl.edit/META-INF/MANIFEST.MF b/eclipse-workspace/fr.n7.simplepdl.edit/META-INF/MANIFEST.MF new file mode 100644 index 0000000..9b8269e --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.simplepdl.edit;singleton:=true +Automatic-Module-Name: fr.n7.simplepdl.edit +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: simplepdl.provider.SimplepdlEditPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: simplepdl.provider +Require-Bundle: org.eclipse.core.runtime, + fr.n7.simplepdl;visibility:=reexport, + org.eclipse.emf.edit;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/build.properties b/eclipse-workspace/fr.n7.simplepdl.edit/build.properties new file mode 100644 index 0000000..6e3e902 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.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/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_Guidance.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_Guidance.gif new file mode 100644 index 0000000..cbb9f42 Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_Guidance.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_Resource.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_Resource.gif new file mode 100644 index 0000000..c0dddc3 Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_Resource.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_WorkDefinition.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_WorkDefinition.gif new file mode 100644 index 0000000..fce4def Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_WorkDefinition.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_WorkSequence.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_WorkSequence.gif new file mode 100644 index 0000000..304981b Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateProcess_processElements_WorkSequence.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateWorkDefinition_requests_Request.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateWorkDefinition_requests_Request.gif new file mode 100644 index 0000000..9398dda Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/ctool16/CreateWorkDefinition_requests_Request.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Guidance.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Guidance.gif new file mode 100644 index 0000000..c414fe9 Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Guidance.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Process.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Process.gif new file mode 100644 index 0000000..c3370c7 Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Process.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Request.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Request.gif new file mode 100644 index 0000000..c00aedf Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Request.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Resource.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Resource.gif new file mode 100644 index 0000000..338fb8d Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/Resource.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/WorkDefinition.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/WorkDefinition.gif new file mode 100644 index 0000000..2124f3e Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/WorkDefinition.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/WorkSequence.gif b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/WorkSequence.gif new file mode 100644 index 0000000..106881e Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.edit/icons/full/obj16/WorkSequence.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/plugin.properties b/eclipse-workspace/fr.n7.simplepdl.edit/plugin.properties new file mode 100644 index 0000000..5ef4528 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/plugin.properties @@ -0,0 +1,46 @@ +# + +pluginName = Simplepdl 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_ProcessElement_type = Process Element +_UI_WorkDefinition_type = Work Definition +_UI_WorkSequence_type = Work Sequence +_UI_Process_type = Process +_UI_Guidance_type = Guidance +_UI_Resource_type = Resource +_UI_Request_type = Request +_UI_Unknown_type = Object + +_UI_Unknown_datatype= Value + +_UI_WorkDefinition_linksToPredecessors_feature = Links To Predecessors +_UI_WorkDefinition_linksToSuccessors_feature = Links To Successors +_UI_WorkDefinition_name_feature = Name +_UI_WorkDefinition_requests_feature = Requests +_UI_WorkSequence_linkType_feature = Link Type +_UI_WorkSequence_predecessor_feature = Predecessor +_UI_WorkSequence_successor_feature = Successor +_UI_Process_name_feature = Name +_UI_Process_processElements_feature = Process Elements +_UI_Guidance_text_feature = Text +_UI_Guidance_elements_feature = Elements +_UI_Resource_quantity_feature = Quantity +_UI_Resource_name_feature = Name +_UI_Request_quantity_feature = Quantity +_UI_Request_target_feature = Target +_UI_Unknown_feature = Unspecified + +_UI_WorkSequenceType_startToStart_literal = startToStart +_UI_WorkSequenceType_finishToStart_literal = finishToStart +_UI_WorkSequenceType_startToFinish_literal = startToFinish +_UI_WorkSequenceType_finishToFinish_literal = finishToFinish diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/plugin.xml b/eclipse-workspace/fr.n7.simplepdl.edit/plugin.xml new file mode 100644 index 0000000..50d06de --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/plugin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/GuidanceItemProvider.java b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/GuidanceItemProvider.java new file mode 100644 index 0000000..a02e5b4 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/GuidanceItemProvider.java @@ -0,0 +1,155 @@ +/** + */ +package simplepdl.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import simplepdl.Guidance; +import simplepdl.SimplepdlPackage; + +/** + * This is the item provider adapter for a {@link simplepdl.Guidance} object. + * + * + * @generated + */ +public class GuidanceItemProvider extends ProcessElementItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public GuidanceItemProvider(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); + + addTextPropertyDescriptor(object); + addElementsPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Text feature. + * + * + * @generated + */ + protected void addTextPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Guidance_text_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Guidance_text_feature", "_UI_Guidance_type"), + SimplepdlPackage.Literals.GUIDANCE__TEXT, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Elements feature. + * + * + * @generated + */ + protected void addElementsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Guidance_elements_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Guidance_elements_feature", "_UI_Guidance_type"), + SimplepdlPackage.Literals.GUIDANCE__ELEMENTS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Guidance.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Guidance")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Guidance)object).getText(); + return label == null || label.length() == 0 ? + getString("_UI_Guidance_type") : + getString("_UI_Guidance_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(Guidance.class)) { + case SimplepdlPackage.GUIDANCE__TEXT: + 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/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/ProcessElementItemProvider.java b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/ProcessElementItemProvider.java new file mode 100644 index 0000000..ce39790 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/ProcessElementItemProvider.java @@ -0,0 +1,109 @@ +/** + */ +package simplepdl.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link simplepdl.ProcessElement} object. + * + * + * @generated + */ +public class ProcessElementItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ProcessElementItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_ProcessElement_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 SimplepdlEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/ProcessItemProvider.java b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/ProcessItemProvider.java new file mode 100644 index 0000000..ef6f798 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/ProcessItemProvider.java @@ -0,0 +1,213 @@ +/** + */ +package simplepdl.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.ecore.EStructuralFeature; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; + +/** + * This is the item provider adapter for a {@link simplepdl.Process} object. + * + * + * @generated + */ +public class ProcessItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ProcessItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Process_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Process_name_feature", "_UI_Process_type"), + SimplepdlPackage.Literals.PROCESS__NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(SimplepdlPackage.Literals.PROCESS__PROCESS_ELEMENTS); + } + 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 Process.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Process")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((simplepdl.Process)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_Process_type") : + getString("_UI_Process_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(simplepdl.Process.class)) { + case SimplepdlPackage.PROCESS__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case SimplepdlPackage.PROCESS__PROCESS_ELEMENTS: + 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 + (SimplepdlPackage.Literals.PROCESS__PROCESS_ELEMENTS, + SimplepdlFactory.eINSTANCE.createWorkDefinition())); + + newChildDescriptors.add + (createChildParameter + (SimplepdlPackage.Literals.PROCESS__PROCESS_ELEMENTS, + SimplepdlFactory.eINSTANCE.createWorkSequence())); + + newChildDescriptors.add + (createChildParameter + (SimplepdlPackage.Literals.PROCESS__PROCESS_ELEMENTS, + SimplepdlFactory.eINSTANCE.createGuidance())); + + newChildDescriptors.add + (createChildParameter + (SimplepdlPackage.Literals.PROCESS__PROCESS_ELEMENTS, + SimplepdlFactory.eINSTANCE.createResource())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return SimplepdlEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/RequestItemProvider.java b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/RequestItemProvider.java new file mode 100644 index 0000000..a7b92c4 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/RequestItemProvider.java @@ -0,0 +1,179 @@ +/** + */ +package simplepdl.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import simplepdl.Request; +import simplepdl.SimplepdlPackage; + +/** + * This is the item provider adapter for a {@link simplepdl.Request} object. + * + * + * @generated + */ +public class RequestItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public RequestItemProvider(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); + + addQuantityPropertyDescriptor(object); + addTargetPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Quantity feature. + * + * + * @generated + */ + protected void addQuantityPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Request_quantity_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Request_quantity_feature", "_UI_Request_type"), + SimplepdlPackage.Literals.REQUEST__QUANTITY, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Target feature. + * + * + * @generated + */ + protected void addTargetPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Request_target_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Request_target_feature", "_UI_Request_type"), + SimplepdlPackage.Literals.REQUEST__TARGET, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns Request.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Request")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + Request request = (Request)object; + return getString("_UI_Request_type") + " --" + request.getQuantity() + "--> " + request.getTarget().getName(); + } + + + /** + * 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(Request.class)) { + case SimplepdlPackage.REQUEST__QUANTITY: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return SimplepdlEditPlugin.INSTANCE; + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/ResourceItemProvider.java b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/ResourceItemProvider.java new file mode 100644 index 0000000..1381366 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/ResourceItemProvider.java @@ -0,0 +1,157 @@ +/** + */ +package simplepdl.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import simplepdl.Resource; +import simplepdl.SimplepdlPackage; + +/** + * This is the item provider adapter for a {@link simplepdl.Resource} object. + * + * + * @generated + */ +public class ResourceItemProvider extends ProcessElementItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ResourceItemProvider(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); + + addQuantityPropertyDescriptor(object); + addNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Quantity feature. + * + * + * @generated + */ + protected void addQuantityPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Resource_quantity_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Resource_quantity_feature", "_UI_Resource_type"), + SimplepdlPackage.Literals.RESOURCE__QUANTITY, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Resource_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Resource_name_feature", "_UI_Resource_type"), + SimplepdlPackage.Literals.RESOURCE__NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns Resource.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Resource")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Resource)object).getName(); + int qty = ((Resource)object).getQuantity(); + return label == null || label.length() == 0 ? + getString("_UI_Resource_type") : + getString("_UI_Resource_type") + " " + label + " (" + qty + ")"; + } + + + /** + * 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(Resource.class)) { + case SimplepdlPackage.RESOURCE__QUANTITY: + case SimplepdlPackage.RESOURCE__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/SimplepdlEditPlugin.java b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/SimplepdlEditPlugin.java new file mode 100644 index 0000000..8534f6d --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/SimplepdlEditPlugin.java @@ -0,0 +1,89 @@ +/** + */ +package simplepdl.provider; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Simplepdl edit plugin. + * + * + * @generated + */ +public final class SimplepdlEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final SimplepdlEditPlugin INSTANCE = new SimplepdlEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public SimplepdlEditPlugin() { + super + (new ResourceLocator [] { + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/SimplepdlItemProviderAdapterFactory.java b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/SimplepdlItemProviderAdapterFactory.java new file mode 100644 index 0000000..8eb5124 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/SimplepdlItemProviderAdapterFactory.java @@ -0,0 +1,319 @@ +/** + */ +package simplepdl.provider; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +import simplepdl.util.SimplepdlAdapterFactory; + +/** + * 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 SimplepdlItemProviderAdapterFactory extends SimplepdlAdapterFactory 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 SimplepdlItemProviderAdapterFactory() { + 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 simplepdl.WorkDefinition} instances. + * + * + * @generated + */ + protected WorkDefinitionItemProvider workDefinitionItemProvider; + + /** + * This creates an adapter for a {@link simplepdl.WorkDefinition}. + * + * + * @generated + */ + @Override + public Adapter createWorkDefinitionAdapter() { + if (workDefinitionItemProvider == null) { + workDefinitionItemProvider = new WorkDefinitionItemProvider(this); + } + + return workDefinitionItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link simplepdl.WorkSequence} instances. + * + * + * @generated + */ + protected WorkSequenceItemProvider workSequenceItemProvider; + + /** + * This creates an adapter for a {@link simplepdl.WorkSequence}. + * + * + * @generated + */ + @Override + public Adapter createWorkSequenceAdapter() { + if (workSequenceItemProvider == null) { + workSequenceItemProvider = new WorkSequenceItemProvider(this); + } + + return workSequenceItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link simplepdl.Process} instances. + * + * + * @generated + */ + protected ProcessItemProvider processItemProvider; + + /** + * This creates an adapter for a {@link simplepdl.Process}. + * + * + * @generated + */ + @Override + public Adapter createProcessAdapter() { + if (processItemProvider == null) { + processItemProvider = new ProcessItemProvider(this); + } + + return processItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link simplepdl.Guidance} instances. + * + * + * @generated + */ + protected GuidanceItemProvider guidanceItemProvider; + + /** + * This creates an adapter for a {@link simplepdl.Guidance}. + * + * + * @generated + */ + @Override + public Adapter createGuidanceAdapter() { + if (guidanceItemProvider == null) { + guidanceItemProvider = new GuidanceItemProvider(this); + } + + return guidanceItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link simplepdl.Resource} instances. + * + * + * @generated + */ + protected ResourceItemProvider resourceItemProvider; + + /** + * This creates an adapter for a {@link simplepdl.Resource}. + * + * + * @generated + */ + @Override + public Adapter createResourceAdapter() { + if (resourceItemProvider == null) { + resourceItemProvider = new ResourceItemProvider(this); + } + + return resourceItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link simplepdl.Request} instances. + * + * + * @generated + */ + protected RequestItemProvider requestItemProvider; + + /** + * This creates an adapter for a {@link simplepdl.Request}. + * + * + * @generated + */ + @Override + public Adapter createRequestAdapter() { + if (requestItemProvider == null) { + requestItemProvider = new RequestItemProvider(this); + } + + return requestItemProvider; + } + + /** + * 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 (workDefinitionItemProvider != null) workDefinitionItemProvider.dispose(); + if (workSequenceItemProvider != null) workSequenceItemProvider.dispose(); + if (processItemProvider != null) processItemProvider.dispose(); + if (guidanceItemProvider != null) guidanceItemProvider.dispose(); + if (resourceItemProvider != null) resourceItemProvider.dispose(); + if (requestItemProvider != null) requestItemProvider.dispose(); + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/WorkDefinitionItemProvider.java b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/WorkDefinitionItemProvider.java new file mode 100644 index 0000000..23b10e5 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/WorkDefinitionItemProvider.java @@ -0,0 +1,219 @@ +/** + */ +package simplepdl.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EStructuralFeature; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; +import simplepdl.WorkDefinition; + +/** + * This is the item provider adapter for a {@link simplepdl.WorkDefinition} object. + * + * + * @generated + */ +public class WorkDefinitionItemProvider extends ProcessElementItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public WorkDefinitionItemProvider(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); + + addLinksToPredecessorsPropertyDescriptor(object); + addLinksToSuccessorsPropertyDescriptor(object); + addNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Links To Predecessors feature. + * + * + * @generated + */ + protected void addLinksToPredecessorsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkDefinition_linksToPredecessors_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkDefinition_linksToPredecessors_feature", "_UI_WorkDefinition_type"), + SimplepdlPackage.Literals.WORK_DEFINITION__LINKS_TO_PREDECESSORS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Links To Successors feature. + * + * + * @generated + */ + protected void addLinksToSuccessorsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkDefinition_linksToSuccessors_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkDefinition_linksToSuccessors_feature", "_UI_WorkDefinition_type"), + SimplepdlPackage.Literals.WORK_DEFINITION__LINKS_TO_SUCCESSORS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkDefinition_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkDefinition_name_feature", "_UI_WorkDefinition_type"), + SimplepdlPackage.Literals.WORK_DEFINITION__NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(SimplepdlPackage.Literals.WORK_DEFINITION__REQUESTS); + } + 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 WorkDefinition.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/WorkDefinition")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((WorkDefinition)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_WorkDefinition_type") : + getString("_UI_WorkDefinition_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(WorkDefinition.class)) { + case SimplepdlPackage.WORK_DEFINITION__NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case SimplepdlPackage.WORK_DEFINITION__REQUESTS: + 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 + (SimplepdlPackage.Literals.WORK_DEFINITION__REQUESTS, + SimplepdlFactory.eINSTANCE.createRequest())); + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/WorkSequenceItemProvider.java b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/WorkSequenceItemProvider.java new file mode 100644 index 0000000..e91689e --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.edit/src/simplepdl/provider/WorkSequenceItemProvider.java @@ -0,0 +1,185 @@ +/** + */ +package simplepdl.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import simplepdl.SimplepdlPackage; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; + +/** + * This is the item provider adapter for a {@link simplepdl.WorkSequence} object. + * + * + * @generated + */ +public class WorkSequenceItemProvider extends ProcessElementItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public WorkSequenceItemProvider(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); + + addLinkTypePropertyDescriptor(object); + addPredecessorPropertyDescriptor(object); + addSuccessorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Link Type feature. + * + * + * @generated + */ + protected void addLinkTypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkSequence_linkType_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_linkType_feature", "_UI_WorkSequence_type"), + SimplepdlPackage.Literals.WORK_SEQUENCE__LINK_TYPE, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Predecessor feature. + * + * + * @generated + */ + protected void addPredecessorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkSequence_predecessor_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_predecessor_feature", "_UI_WorkSequence_type"), + SimplepdlPackage.Literals.WORK_SEQUENCE__PREDECESSOR, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Successor feature. + * + * + * @generated + */ + protected void addSuccessorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_WorkSequence_successor_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WorkSequence_successor_feature", "_UI_WorkSequence_type"), + SimplepdlPackage.Literals.WORK_SEQUENCE__SUCCESSOR, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns WorkSequence.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/WorkSequence")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + WorkSequence ws = (WorkSequence) object; + WorkSequenceType labelValue = ws.getLinkType(); + String label = "--" + (labelValue == null ? "?" : labelValue.toString()) + "-->"; + String previous = ws.getPredecessor() == null ? "?" : ws.getPredecessor().getName(); + String next = ws.getSuccessor() == null ? "?" : ws.getSuccessor().getName(); + return label == null || label.length() == 0 ? + getString("_UI_WorkSequence_type") : + getString("_UI_WorkSequence_type") + " " + previous + " " + label + " " + next; + } + + + /** + * 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(WorkSequence.class)) { + case SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR: + case SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR: + case SimplepdlPackage.WORK_SEQUENCE__LINK_TYPE: + 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/eclipse-workspace/fr.n7.simplepdl.editor/.classpath b/eclipse-workspace/fr.n7.simplepdl.editor/.classpath new file mode 100644 index 0000000..c3ba59e --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.editor/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl.editor/.project b/eclipse-workspace/fr.n7.simplepdl.editor/.project new file mode 100644 index 0000000..8eb0b3c --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.editor/.project @@ -0,0 +1,28 @@ + + + fr.n7.simplepdl.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/eclipse-workspace/fr.n7.simplepdl.editor/META-INF/MANIFEST.MF b/eclipse-workspace/fr.n7.simplepdl.editor/META-INF/MANIFEST.MF new file mode 100644 index 0000000..9ccd12e --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.editor/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.simplepdl.editor;singleton:=true +Automatic-Module-Name: fr.n7.simplepdl.editor +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: simplepdl.presentation.SimplepdlEditorPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: simplepdl.presentation +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources;visibility:=reexport, + fr.n7.simplepdl.edit;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.eclipse.emf.edit.ui;visibility:=reexport, + org.eclipse.ui.ide;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/eclipse-workspace/fr.n7.simplepdl.editor/build.properties b/eclipse-workspace/fr.n7.simplepdl.editor/build.properties new file mode 100644 index 0000000..5fb0771 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.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/eclipse-workspace/fr.n7.simplepdl.editor/icons/full/obj16/SimplepdlModelFile.gif b/eclipse-workspace/fr.n7.simplepdl.editor/icons/full/obj16/SimplepdlModelFile.gif new file mode 100644 index 0000000..8b3ad80 Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.editor/icons/full/obj16/SimplepdlModelFile.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.editor/icons/full/wizban/NewSimplepdl.gif b/eclipse-workspace/fr.n7.simplepdl.editor/icons/full/wizban/NewSimplepdl.gif new file mode 100644 index 0000000..33f212f Binary files /dev/null and b/eclipse-workspace/fr.n7.simplepdl.editor/icons/full/wizban/NewSimplepdl.gif differ diff --git a/eclipse-workspace/fr.n7.simplepdl.editor/plugin.properties b/eclipse-workspace/fr.n7.simplepdl.editor/plugin.properties new file mode 100644 index 0000000..9afb5e7 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.editor/plugin.properties @@ -0,0 +1,53 @@ +# + +pluginName = Simplepdl Editor +providerName = www.example.org + +_UI_SimplepdlEditor_menu = &Simplepdl 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_SimplepdlModelWizard_label = Simplepdl Model +_UI_SimplepdlModelWizard_description = Create a new Simplepdl model + +_UI_SimplepdlEditor_label = Simplepdl Model Editor + +_UI_SimplepdlEditorFilenameDefaultBase = My +_UI_SimplepdlEditorFilenameExtensions = simplepdl + +_UI_Wizard_label = New + +_WARN_FilenameExtension = The file name must end in ''.{0}'' +_WARN_FilenameExtensions = The file name must have one of the following extensions: {0} + +_UI_ModelObject = &Model Object +_UI_XMLEncoding = &XML Encoding +_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1 +_UI_Wizard_initial_object_description = Select a model object to create + +_UI_FileConflict_label = File Conflict +_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? + diff --git a/eclipse-workspace/fr.n7.simplepdl.editor/plugin.xml b/eclipse-workspace/fr.n7.simplepdl.editor/plugin.xml new file mode 100644 index 0000000..aac0c34 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.editor/plugin.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + %_UI_SimplepdlModelWizard_description + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlActionBarContributor.java b/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlActionBarContributor.java new file mode 100644 index 0000000..c13b8fb --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlActionBarContributor.java @@ -0,0 +1,424 @@ +/** + */ +package simplepdl.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 Simplepdl model editor. + * + * + * @generated + */ +public class SimplepdlActionBarContributor + 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(SimplepdlEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + SimplepdlEditorPlugin.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(SimplepdlEditorPlugin.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 SimplepdlActionBarContributor() { + 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) { + super.contributeToToolBar(toolBarManager); + toolBarManager.add(new Separator("simplepdl-settings")); + toolBarManager.add(new Separator("simplepdl-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(SimplepdlEditorPlugin.INSTANCE.getString("_UI_SimplepdlEditor_menu"), "simplepdlMenuID"); + 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(SimplepdlEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(SimplepdlEditorPlugin.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(SimplepdlEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(SimplepdlEditorPlugin.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/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlEditor.java b/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlEditor.java new file mode 100644 index 0000000..a8acf9b --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlEditor.java @@ -0,0 +1,1823 @@ +/** + */ +package simplepdl.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.graphics.Rectangle; + +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 simplepdl.provider.SimplepdlItemProviderAdapterFactory; + +import org.eclipse.ui.actions.WorkspaceModifyOperation; + + +/** + * This is an example of a Simplepdl model editor. + * + * + * @generated + */ +public class SimplepdlEditor + 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(SimplepdlEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(SimplepdlEditor.this); + handleActivate(); + } + } + else if (p == SimplepdlEditor.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() { + protected boolean dispatching; + + @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); + } + dispatchUpdateProblemIndication(); + break; + } + } + } + else { + super.notifyChanged(notification); + } + } + + protected void dispatchUpdateProblemIndication() { + if (updateProblemIndication && !dispatching) { + dispatching = true; + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + public void run() { + dispatching = false; + updateProblemIndication(); + } + }); + } + } + + @Override + protected void setTarget(Resource target) { + basicSetTarget(target); + } + + @Override + protected void unsetTarget(Resource target) { + basicUnsetTarget(target); + resourceToDiagnosticMap.remove(target); + dispatchUpdateProblemIndication(); + } + }; + + /** + * 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(SimplepdlEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == SimplepdlEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + SimplepdlEditorPlugin.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(SimplepdlEditor.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())) { + ResourceSet resourceSet = editingDomain.getResourceSet(); + if (isDirty()) { + changedResources.addAll(resourceSet.getResources()); + } + editingDomain.getCommandStack().flush(); + + updateProblemIndication = false; + for (Resource resource : changedResources) { + if (resource.isLoaded()) { + resource.unload(); + try { + resource.load(resourceSet.getLoadOptions()); + } + 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.n7.simplepdl.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) { + SimplepdlEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + try { + markerHelper.updateMarkers(diagnostic); + } + catch (CoreException exception) { + SimplepdlEditorPlugin.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 SimplepdlEditor() { + 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 SimplepdlItemProviderAdapterFactory()); + 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() == null || 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.n7.simplepdl.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.n7.simplepdl.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(), SimplepdlEditor.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.setUseHashlookup(true); + + 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(), SimplepdlEditor.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(), SimplepdlEditor.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(), SimplepdlEditor.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(), SimplepdlEditor.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(), SimplepdlEditor.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() { + if (!getContainer().isDisposed()) { + 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) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); + } + } + } + + /** + * 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) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, clientArea.height + clientArea.y); + } + } + } + + /** + * 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 + */ + @Override + public T getAdapter(Class key) { + if (key.equals(IContentOutlinePage.class)) { + return showOutlineView() ? key.cast(getContentOutlinePage()) : null; + } + else if (key.equals(IPropertySheetPage.class)) { + return key.cast(getPropertySheetPage()); + } + else if (key.equals(IGotoMarker.class)) { + return key.cast(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.setUseHashlookup(true); + 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, ExtendedPropertySheetPage.Decoration.NONE, null, 0, false) { + @Override + public void setSelectionToViewer(List selection) { + SimplepdlEditor.this.setSelectionToViewer(selection); + SimplepdlEditor.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; + List resources = editingDomain.getResourceSet().getResources(); + for (int i = 0; i < resources.size(); ++i) { + Resource resource = resources.get(i); + 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. + // + SimplepdlEditorPlugin.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 SimplepdlEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return SimplepdlEditorPlugin.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/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlEditorPlugin.java b/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlEditorPlugin.java new file mode 100644 index 0000000..20c7a81 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlEditorPlugin.java @@ -0,0 +1,91 @@ +/** + */ +package simplepdl.presentation; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.ui.EclipseUIPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Simplepdl editor plugin. + * + * + * @generated + */ +public final class SimplepdlEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final SimplepdlEditorPlugin INSTANCE = new SimplepdlEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public SimplepdlEditorPlugin() { + super + (new ResourceLocator [] { + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipseUIPlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlModelWizard.java b/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlModelWizard.java new file mode 100644 index 0000000..a632edb --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.editor/src/simplepdl/presentation/SimplepdlModelWizard.java @@ -0,0 +1,628 @@ +/** + */ +package simplepdl.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 simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; +import simplepdl.provider.SimplepdlEditPlugin; + + +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 SimplepdlModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(SimplepdlEditorPlugin.INSTANCE.getString("_UI_SimplepdlEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + SimplepdlEditorPlugin.INSTANCE.getString("_UI_SimplepdlEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected SimplepdlPackage simplepdlPackage = SimplepdlPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected SimplepdlFactory simplepdlFactory = simplepdlPackage.getSimplepdlFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected SimplepdlModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected SimplepdlModelWizardInitialObjectCreationPage 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(SimplepdlEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(SimplepdlEditorPlugin.INSTANCE.getImage("full/wizban/NewSimplepdl"))); + } + + /** + * 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 : simplepdlPackage.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)simplepdlPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = simplepdlFactory.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) { + SimplepdlEditorPlugin.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(), SimplepdlEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } + catch (Exception exception) { + SimplepdlEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class SimplepdlModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public SimplepdlModelWizardNewFileCreationPage(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(SimplepdlEditorPlugin.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 SimplepdlModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public SimplepdlModelWizardInitialObjectCreationPage(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(SimplepdlEditorPlugin.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(SimplepdlEditorPlugin.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 SimplepdlEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } + catch(MissingResourceException mre) { + SimplepdlEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(SimplepdlEditorPlugin.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 SimplepdlModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(SimplepdlEditorPlugin.INSTANCE.getString("_UI_SimplepdlModelWizard_label")); + newFileCreationPage.setDescription(SimplepdlEditorPlugin.INSTANCE.getString("_UI_SimplepdlModelWizard_description")); + newFileCreationPage.setFileName(SimplepdlEditorPlugin.INSTANCE.getString("_UI_SimplepdlEditorFilenameDefaultBase") + "." + 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 = SimplepdlEditorPlugin.INSTANCE.getString("_UI_SimplepdlEditorFilenameDefaultBase"); + 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 SimplepdlModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(SimplepdlEditorPlugin.INSTANCE.getString("_UI_SimplepdlModelWizard_label")); + initialObjectCreationPage.setDescription(SimplepdlEditorPlugin.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/eclipse-workspace/fr.n7.simplepdl.exemples/.project b/eclipse-workspace/fr.n7.simplepdl.exemples/.project new file mode 100644 index 0000000..f640101 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.exemples/.project @@ -0,0 +1,11 @@ + + + fr.n7.simplepdl.exemples + + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl.exemples/My.simplepdl b/eclipse-workspace/fr.n7.simplepdl.exemples/My.simplepdl new file mode 100644 index 0000000..655bc82 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.exemples/My.simplepdl @@ -0,0 +1,6 @@ + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl.exemples/developpement.simplepdl b/eclipse-workspace/fr.n7.simplepdl.exemples/developpement.simplepdl new file mode 100644 index 0000000..01510d1 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.exemples/developpement.simplepdl @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl.feature/.project b/eclipse-workspace/fr.n7.simplepdl.feature/.project new file mode 100644 index 0000000..bc7b595 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.feature/.project @@ -0,0 +1,17 @@ + + + fr.n7.simplepdl.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/eclipse-workspace/fr.n7.simplepdl.feature/build.properties b/eclipse-workspace/fr.n7.simplepdl.feature/build.properties new file mode 100644 index 0000000..64f93a9 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.feature/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml diff --git a/eclipse-workspace/fr.n7.simplepdl.feature/feature.xml b/eclipse-workspace/fr.n7.simplepdl.feature/feature.xml new file mode 100644 index 0000000..3f15aeb --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.feature/feature.xml @@ -0,0 +1,47 @@ + + + + + [Enter Feature Description here.] + + + + [Enter Copyright Description here.] + + + + [Enter License Description here.] + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/.classpath b/eclipse-workspace/fr.n7.simplepdl.tests/.classpath new file mode 100644 index 0000000..c3ba59e --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/.project b/eclipse-workspace/fr.n7.simplepdl.tests/.project new file mode 100644 index 0000000..0543691 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/.project @@ -0,0 +1,28 @@ + + + fr.n7.simplepdl.tests + + + + + + 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/eclipse-workspace/fr.n7.simplepdl.tests/META-INF/MANIFEST.MF b/eclipse-workspace/fr.n7.simplepdl.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000..631d3cb --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.simplepdl.tests;singleton:=true +Automatic-Module-Name: fr.n7.simplepdl.tests +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: simplepdl.tests +Require-Bundle: org.eclipse.core.runtime, + fr.n7.simplepdl;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/build.properties b/eclipse-workspace/fr.n7.simplepdl.tests/build.properties new file mode 100644 index 0000000..08af068 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/build.properties @@ -0,0 +1,8 @@ +# + +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/plugin.properties b/eclipse-workspace/fr.n7.simplepdl.tests/plugin.properties new file mode 100644 index 0000000..ca2ed32 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/plugin.properties @@ -0,0 +1,4 @@ +# + +pluginName = Simplepdl Tests +providerName = www.example.org diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/GuidanceTest.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/GuidanceTest.java new file mode 100644 index 0000000..03f5092 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/GuidanceTest.java @@ -0,0 +1,70 @@ +/** + */ +package simplepdl.tests; + +import junit.textui.TestRunner; + +import simplepdl.Guidance; +import simplepdl.SimplepdlFactory; + +/** + * + * A test case for the model object 'Guidance'. + * + * @generated + */ +public class GuidanceTest extends ProcessElementTest { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(GuidanceTest.class); + } + + /** + * Constructs a new Guidance test case with the given name. + * + * + * @generated + */ + public GuidanceTest(String name) { + super(name); + } + + /** + * Returns the fixture for this Guidance test case. + * + * + * @generated + */ + @Override + protected Guidance getFixture() { + return (Guidance)fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(SimplepdlFactory.eINSTANCE.createGuidance()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //GuidanceTest diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/ProcessElementTest.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/ProcessElementTest.java new file mode 100644 index 0000000..854fab1 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/ProcessElementTest.java @@ -0,0 +1,55 @@ +/** + */ +package simplepdl.tests; + +import junit.framework.TestCase; + +import simplepdl.ProcessElement; + +/** + * + * A test case for the model object 'Process Element'. + * + * @generated + */ +public abstract class ProcessElementTest extends TestCase { + + /** + * The fixture for this Process Element test case. + * + * + * @generated + */ + protected ProcessElement fixture = null; + + /** + * Constructs a new Process Element test case with the given name. + * + * + * @generated + */ + public ProcessElementTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Process Element test case. + * + * + * @generated + */ + protected void setFixture(ProcessElement fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Process Element test case. + * + * + * @generated + */ + protected ProcessElement getFixture() { + return fixture; + } + +} //ProcessElementTest diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/ProcessTest.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/ProcessTest.java new file mode 100644 index 0000000..e00e451 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/ProcessTest.java @@ -0,0 +1,88 @@ +/** + */ +package simplepdl.tests; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +import simplepdl.SimplepdlFactory; + +/** + * + * A test case for the model object 'Process'. + * + * @generated + */ +public class ProcessTest extends TestCase { + + /** + * The fixture for this Process test case. + * + * + * @generated + */ + protected simplepdl.Process fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(ProcessTest.class); + } + + /** + * Constructs a new Process test case with the given name. + * + * + * @generated + */ + public ProcessTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Process test case. + * + * + * @generated + */ + protected void setFixture(simplepdl.Process fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Process test case. + * + * + * @generated + */ + protected simplepdl.Process getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(SimplepdlFactory.eINSTANCE.createProcess()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //ProcessTest diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/RequestTest.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/RequestTest.java new file mode 100644 index 0000000..cb24227 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/RequestTest.java @@ -0,0 +1,89 @@ +/** + */ +package simplepdl.tests; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +import simplepdl.Request; +import simplepdl.SimplepdlFactory; + +/** + * + * A test case for the model object 'Request'. + * + * @generated + */ +public class RequestTest extends TestCase { + + /** + * The fixture for this Request test case. + * + * + * @generated + */ + protected Request fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(RequestTest.class); + } + + /** + * Constructs a new Request test case with the given name. + * + * + * @generated + */ + public RequestTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Request test case. + * + * + * @generated + */ + protected void setFixture(Request fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Request test case. + * + * + * @generated + */ + protected Request getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(SimplepdlFactory.eINSTANCE.createRequest()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //RequestTest diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/ResourceTest.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/ResourceTest.java new file mode 100644 index 0000000..23eb32e --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/ResourceTest.java @@ -0,0 +1,70 @@ +/** + */ +package simplepdl.tests; + +import junit.textui.TestRunner; + +import simplepdl.Resource; +import simplepdl.SimplepdlFactory; + +/** + * + * A test case for the model object 'Resource'. + * + * @generated + */ +public class ResourceTest extends ProcessElementTest { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(ResourceTest.class); + } + + /** + * Constructs a new Resource test case with the given name. + * + * + * @generated + */ + public ResourceTest(String name) { + super(name); + } + + /** + * Returns the fixture for this Resource test case. + * + * + * @generated + */ + @Override + protected Resource getFixture() { + return (Resource)fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(SimplepdlFactory.eINSTANCE.createResource()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //ResourceTest diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/SimplepdlAllTests.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/SimplepdlAllTests.java new file mode 100644 index 0000000..8fa243a --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/SimplepdlAllTests.java @@ -0,0 +1,46 @@ +/** + */ +package simplepdl.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'Simplepdl' model. + * + * @generated + */ +public class SimplepdlAllTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new SimplepdlAllTests("Simplepdl Tests"); + return suite; + } + + /** + * + * + * @generated + */ + public SimplepdlAllTests(String name) { + super(name); + } + +} //SimplepdlAllTests diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/SimplepdlExample.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/SimplepdlExample.java new file mode 100644 index 0000000..bcbf1f5 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/SimplepdlExample.java @@ -0,0 +1,121 @@ +/** + */ +package simplepdl.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.util.Diagnostician; + +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; + +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; +import simplepdl.WorkDefinition; + +/** + * + * A sample utility for the 'simplepdl' package. + * + * @generated + */ +public class SimplepdlExample { + /** + * + * Load all the argument file paths or URIs as instances of the model. + * + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put + (Resource.Factory.Registry.DEFAULT_EXTENSION, + new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put + (SimplepdlPackage.eNS_URI, + SimplepdlPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.simplepdl")); + WorkDefinition root = SimplepdlFactory.eINSTANCE.createWorkDefinition(); + resource.getContents().add(root); + resource.save(System.out, null); + } + catch (IOException exception) { + exception.printStackTrace(); + } + } + else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() ? URI.createFileURI(file.getAbsolutePath()): URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } + catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * + * Prints diagnostics with indentation. + * + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} //SimplepdlExample diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/SimplepdlTests.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/SimplepdlTests.java new file mode 100644 index 0000000..03c63f1 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/SimplepdlTests.java @@ -0,0 +1,46 @@ +/** + */ +package simplepdl.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'simplepdl' package. + * + * @generated + */ +public class SimplepdlTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new SimplepdlTests("simplepdl Tests"); + return suite; + } + + /** + * + * + * @generated + */ + public SimplepdlTests(String name) { + super(name); + } + +} //SimplepdlTests diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/WorkDefinitionTest.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/WorkDefinitionTest.java new file mode 100644 index 0000000..fc9e71b --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/WorkDefinitionTest.java @@ -0,0 +1,70 @@ +/** + */ +package simplepdl.tests; + +import junit.textui.TestRunner; + +import simplepdl.SimplepdlFactory; +import simplepdl.WorkDefinition; + +/** + * + * A test case for the model object 'Work Definition'. + * + * @generated + */ +public class WorkDefinitionTest extends ProcessElementTest { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(WorkDefinitionTest.class); + } + + /** + * Constructs a new Work Definition test case with the given name. + * + * + * @generated + */ + public WorkDefinitionTest(String name) { + super(name); + } + + /** + * Returns the fixture for this Work Definition test case. + * + * + * @generated + */ + @Override + protected WorkDefinition getFixture() { + return (WorkDefinition)fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(SimplepdlFactory.eINSTANCE.createWorkDefinition()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //WorkDefinitionTest diff --git a/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/WorkSequenceTest.java b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/WorkSequenceTest.java new file mode 100644 index 0000000..6687b75 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl.tests/src/simplepdl/tests/WorkSequenceTest.java @@ -0,0 +1,70 @@ +/** + */ +package simplepdl.tests; + +import junit.textui.TestRunner; + +import simplepdl.SimplepdlFactory; +import simplepdl.WorkSequence; + +/** + * + * A test case for the model object 'Work Sequence'. + * + * @generated + */ +public class WorkSequenceTest extends ProcessElementTest { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(WorkSequenceTest.class); + } + + /** + * Constructs a new Work Sequence test case with the given name. + * + * + * @generated + */ + public WorkSequenceTest(String name) { + super(name); + } + + /** + * Returns the fixture for this Work Sequence test case. + * + * + * @generated + */ + @Override + protected WorkSequence getFixture() { + return (WorkSequence)fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(SimplepdlFactory.eINSTANCE.createWorkSequence()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //WorkSequenceTest diff --git a/eclipse-workspace/fr.n7.simplepdl/.classpath b/eclipse-workspace/fr.n7.simplepdl/.classpath new file mode 100644 index 0000000..c3ba59e --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl/.project b/eclipse-workspace/fr.n7.simplepdl/.project index dab3835..1c41d91 100644 --- a/eclipse-workspace/fr.n7.simplepdl/.project +++ b/eclipse-workspace/fr.n7.simplepdl/.project @@ -5,6 +5,11 @@ + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.ocl.pivot.ui.oclbuilder @@ -26,8 +31,20 @@ + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + org.eclipse.ocl.pivot.ui.oclnature + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature diff --git a/eclipse-workspace/fr.n7.simplepdl/META-INF/MANIFEST.MF b/eclipse-workspace/fr.n7.simplepdl/META-INF/MANIFEST.MF new file mode 100644 index 0000000..bfccc0f --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.simplepdl;singleton:=true +Automatic-Module-Name: fr.n7.simplepdl +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: simplepdl, + simplepdl.impl, + simplepdl.util +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport +Bundle-ActivationPolicy: lazy +Import-Package: org.eclipse.emf.ecore.xmi.impl, + petrinet diff --git a/eclipse-workspace/fr.n7.simplepdl/build.properties b/eclipse-workspace/fr.n7.simplepdl/build.properties new file mode 100644 index 0000000..4465407 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/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/eclipse-workspace/fr.n7.simplepdl/models/SimplePDLCreator_Created_Process.xmi b/eclipse-workspace/fr.n7.simplepdl/models/SimplePDLCreator_Created_Process.xmi new file mode 100644 index 0000000..e77e0c4 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/models/SimplePDLCreator_Created_Process.xmi @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl/plugin.properties b/eclipse-workspace/fr.n7.simplepdl/plugin.properties new file mode 100644 index 0000000..603d99d --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/plugin.properties @@ -0,0 +1,4 @@ +# + +pluginName = Simplepdl Model +providerName = www.example.org diff --git a/eclipse-workspace/fr.n7.simplepdl/plugin.xml b/eclipse-workspace/fr.n7.simplepdl/plugin.xml new file mode 100644 index 0000000..04d1b7c --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/plugin.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl/simplepdl.genmodel b/eclipse-workspace/fr.n7.simplepdl/simplepdl.genmodel new file mode 100644 index 0000000..919c4bf --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/simplepdl.genmodel @@ -0,0 +1,44 @@ + + + simplepdl.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Guidance.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Guidance.java new file mode 100644 index 0000000..7a79f9d --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Guidance.java @@ -0,0 +1,59 @@ +/** + */ +package simplepdl; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Guidance'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link simplepdl.Guidance#getText Text}
  • + *
  • {@link simplepdl.Guidance#getElements Elements}
  • + *
+ * + * @see simplepdl.SimplepdlPackage#getGuidance() + * @model + * @generated + */ +public interface Guidance extends ProcessElement { + /** + * Returns the value of the 'Text' attribute. + * + * + * @return the value of the 'Text' attribute. + * @see #setText(String) + * @see simplepdl.SimplepdlPackage#getGuidance_Text() + * @model required="true" + * @generated + */ + String getText(); + + /** + * Sets the value of the '{@link simplepdl.Guidance#getText Text}' attribute. + * + * + * @param value the new value of the 'Text' attribute. + * @see #getText() + * @generated + */ + void setText(String value); + + /** + * Returns the value of the 'Elements' reference list. + * The list contents are of type {@link simplepdl.ProcessElement}. + * + * + * @return the value of the 'Elements' reference list. + * @see simplepdl.SimplepdlPackage#getGuidance_Elements() + * @model + * @generated + */ + EList getElements(); + +} // Guidance diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Process.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Process.java new file mode 100644 index 0000000..7457b4c --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Process.java @@ -0,0 +1,61 @@ +/** + */ +package simplepdl; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Process'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link simplepdl.Process#getName Name}
  • + *
  • {@link simplepdl.Process#getProcessElements Process Elements}
  • + *
+ * + * @see simplepdl.SimplepdlPackage#getProcess() + * @model + * @generated + */ +public interface Process extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see simplepdl.SimplepdlPackage#getProcess_Name() + * @model required="true" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link simplepdl.Process#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Process Elements' containment reference list. + * The list contents are of type {@link simplepdl.ProcessElement}. + * + * + * @return the value of the 'Process Elements' containment reference list. + * @see simplepdl.SimplepdlPackage#getProcess_ProcessElements() + * @model containment="true" + * @generated + */ + EList getProcessElements(); + +} // Process diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/ProcessElement.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/ProcessElement.java new file mode 100644 index 0000000..f8bf674 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/ProcessElement.java @@ -0,0 +1,18 @@ +/** + */ +package simplepdl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Process Element'. + * + * + * + * @see simplepdl.SimplepdlPackage#getProcessElement() + * @model abstract="true" + * @generated + */ +public interface ProcessElement extends EObject { +} // ProcessElement diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Request.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Request.java new file mode 100644 index 0000000..f7efba5 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Request.java @@ -0,0 +1,69 @@ +/** + */ +package simplepdl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Request'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link simplepdl.Request#getQuantity Quantity}
  • + *
  • {@link simplepdl.Request#getTarget Target}
  • + *
+ * + * @see simplepdl.SimplepdlPackage#getRequest() + * @model + * @generated + */ +public interface Request extends EObject { + /** + * Returns the value of the 'Quantity' attribute. + * + * + * @return the value of the 'Quantity' attribute. + * @see #setQuantity(int) + * @see simplepdl.SimplepdlPackage#getRequest_Quantity() + * @model required="true" + * @generated + */ + int getQuantity(); + + /** + * Sets the value of the '{@link simplepdl.Request#getQuantity Quantity}' attribute. + * + * + * @param value the new value of the 'Quantity' attribute. + * @see #getQuantity() + * @generated + */ + void setQuantity(int value); + + /** + * Returns the value of the 'Target' reference. + * + * + * @return the value of the 'Target' reference. + * @see #setTarget(Resource) + * @see simplepdl.SimplepdlPackage#getRequest_Target() + * @model required="true" + * @generated + */ + Resource getTarget(); + + /** + * Sets the value of the '{@link simplepdl.Request#getTarget Target}' reference. + * + * + * @param value the new value of the 'Target' reference. + * @see #getTarget() + * @generated + */ + void setTarget(Resource value); + +} // Request diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Resource.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Resource.java new file mode 100644 index 0000000..5947a8a --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/Resource.java @@ -0,0 +1,68 @@ +/** + */ +package simplepdl; + + +/** + * + * A representation of the model object 'Resource'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link simplepdl.Resource#getQuantity Quantity}
  • + *
  • {@link simplepdl.Resource#getName Name}
  • + *
+ * + * @see simplepdl.SimplepdlPackage#getResource() + * @model + * @generated + */ +public interface Resource extends ProcessElement { + /** + * Returns the value of the 'Quantity' attribute. + * + * + * @return the value of the 'Quantity' attribute. + * @see #setQuantity(int) + * @see simplepdl.SimplepdlPackage#getResource_Quantity() + * @model required="true" + * @generated + */ + int getQuantity(); + + /** + * Sets the value of the '{@link simplepdl.Resource#getQuantity Quantity}' attribute. + * + * + * @param value the new value of the 'Quantity' attribute. + * @see #getQuantity() + * @generated + */ + void setQuantity(int value); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see simplepdl.SimplepdlPackage#getResource_Name() + * @model required="true" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link simplepdl.Resource#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Resource diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/SimplepdlFactory.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/SimplepdlFactory.java new file mode 100644 index 0000000..f93b8c6 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/SimplepdlFactory.java @@ -0,0 +1,87 @@ +/** + */ +package simplepdl; + +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 simplepdl.SimplepdlPackage + * @generated + */ +public interface SimplepdlFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + SimplepdlFactory eINSTANCE = simplepdl.impl.SimplepdlFactoryImpl.init(); + + /** + * Returns a new object of class 'Work Definition'. + * + * + * @return a new object of class 'Work Definition'. + * @generated + */ + WorkDefinition createWorkDefinition(); + + /** + * Returns a new object of class 'Work Sequence'. + * + * + * @return a new object of class 'Work Sequence'. + * @generated + */ + WorkSequence createWorkSequence(); + + /** + * Returns a new object of class 'Process'. + * + * + * @return a new object of class 'Process'. + * @generated + */ + Process createProcess(); + + /** + * Returns a new object of class 'Guidance'. + * + * + * @return a new object of class 'Guidance'. + * @generated + */ + Guidance createGuidance(); + + /** + * Returns a new object of class 'Resource'. + * + * + * @return a new object of class 'Resource'. + * @generated + */ + Resource createResource(); + + /** + * Returns a new object of class 'Request'. + * + * + * @return a new object of class 'Request'. + * @generated + */ + Request createRequest(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + SimplepdlPackage getSimplepdlPackage(); + +} //SimplepdlFactory diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/SimplepdlPackage.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/SimplepdlPackage.java new file mode 100644 index 0000000..3a3d42d --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/SimplepdlPackage.java @@ -0,0 +1,872 @@ +/** + */ +package simplepdl; + +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 simplepdl.SimplepdlFactory + * @model kind="package" + * @generated + */ +public interface SimplepdlPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "simplepdl"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://simplepdl"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "simplepdl"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + SimplepdlPackage eINSTANCE = simplepdl.impl.SimplepdlPackageImpl.init(); + + /** + * The meta object id for the '{@link simplepdl.impl.ProcessElementImpl Process Element}' class. + * + * + * @see simplepdl.impl.ProcessElementImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getProcessElement() + * @generated + */ + int PROCESS_ELEMENT = 0; + + /** + * The number of structural features of the 'Process Element' class. + * + * + * @generated + * @ordered + */ + int PROCESS_ELEMENT_FEATURE_COUNT = 0; + + /** + * The number of operations of the 'Process Element' class. + * + * + * @generated + * @ordered + */ + int PROCESS_ELEMENT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link simplepdl.impl.WorkDefinitionImpl Work Definition}' class. + * + * + * @see simplepdl.impl.WorkDefinitionImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getWorkDefinition() + * @generated + */ + int WORK_DEFINITION = 1; + + /** + * The feature id for the 'Links To Predecessors' reference list. + * + * + * @generated + * @ordered + */ + int WORK_DEFINITION__LINKS_TO_PREDECESSORS = PROCESS_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Links To Successors' reference list. + * + * + * @generated + * @ordered + */ + int WORK_DEFINITION__LINKS_TO_SUCCESSORS = PROCESS_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int WORK_DEFINITION__NAME = PROCESS_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Requests' containment reference list. + * + * + * @generated + * @ordered + */ + int WORK_DEFINITION__REQUESTS = PROCESS_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Work Definition' class. + * + * + * @generated + * @ordered + */ + int WORK_DEFINITION_FEATURE_COUNT = PROCESS_ELEMENT_FEATURE_COUNT + 4; + + /** + * The number of operations of the 'Work Definition' class. + * + * + * @generated + * @ordered + */ + int WORK_DEFINITION_OPERATION_COUNT = PROCESS_ELEMENT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link simplepdl.impl.WorkSequenceImpl Work Sequence}' class. + * + * + * @see simplepdl.impl.WorkSequenceImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getWorkSequence() + * @generated + */ + int WORK_SEQUENCE = 2; + + /** + * The feature id for the 'Link Type' attribute. + * + * + * @generated + * @ordered + */ + int WORK_SEQUENCE__LINK_TYPE = PROCESS_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Predecessor' reference. + * + * + * @generated + * @ordered + */ + int WORK_SEQUENCE__PREDECESSOR = PROCESS_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Successor' reference. + * + * + * @generated + * @ordered + */ + int WORK_SEQUENCE__SUCCESSOR = PROCESS_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Work Sequence' class. + * + * + * @generated + * @ordered + */ + int WORK_SEQUENCE_FEATURE_COUNT = PROCESS_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of operations of the 'Work Sequence' class. + * + * + * @generated + * @ordered + */ + int WORK_SEQUENCE_OPERATION_COUNT = PROCESS_ELEMENT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link simplepdl.impl.ProcessImpl Process}' class. + * + * + * @see simplepdl.impl.ProcessImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getProcess() + * @generated + */ + int PROCESS = 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PROCESS__NAME = 0; + + /** + * The feature id for the 'Process Elements' containment reference list. + * + * + * @generated + * @ordered + */ + int PROCESS__PROCESS_ELEMENTS = 1; + + /** + * The number of structural features of the 'Process' class. + * + * + * @generated + * @ordered + */ + int PROCESS_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Process' class. + * + * + * @generated + * @ordered + */ + int PROCESS_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link simplepdl.impl.GuidanceImpl Guidance}' class. + * + * + * @see simplepdl.impl.GuidanceImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getGuidance() + * @generated + */ + int GUIDANCE = 4; + + /** + * The feature id for the 'Text' attribute. + * + * + * @generated + * @ordered + */ + int GUIDANCE__TEXT = PROCESS_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Elements' reference list. + * + * + * @generated + * @ordered + */ + int GUIDANCE__ELEMENTS = PROCESS_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Guidance' class. + * + * + * @generated + * @ordered + */ + int GUIDANCE_FEATURE_COUNT = PROCESS_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Guidance' class. + * + * + * @generated + * @ordered + */ + int GUIDANCE_OPERATION_COUNT = PROCESS_ELEMENT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link simplepdl.impl.ResourceImpl Resource}' class. + * + * + * @see simplepdl.impl.ResourceImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getResource() + * @generated + */ + int RESOURCE = 5; + + /** + * The feature id for the 'Quantity' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE__QUANTITY = PROCESS_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE__NAME = PROCESS_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Resource' class. + * + * + * @generated + * @ordered + */ + int RESOURCE_FEATURE_COUNT = PROCESS_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'Resource' class. + * + * + * @generated + * @ordered + */ + int RESOURCE_OPERATION_COUNT = PROCESS_ELEMENT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link simplepdl.impl.RequestImpl Request}' class. + * + * + * @see simplepdl.impl.RequestImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getRequest() + * @generated + */ + int REQUEST = 6; + + /** + * The feature id for the 'Quantity' attribute. + * + * + * @generated + * @ordered + */ + int REQUEST__QUANTITY = 0; + + /** + * The feature id for the 'Target' reference. + * + * + * @generated + * @ordered + */ + int REQUEST__TARGET = 1; + + /** + * The number of structural features of the 'Request' class. + * + * + * @generated + * @ordered + */ + int REQUEST_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Request' class. + * + * + * @generated + * @ordered + */ + int REQUEST_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link simplepdl.WorkSequenceType Work Sequence Type}' enum. + * + * + * @see simplepdl.WorkSequenceType + * @see simplepdl.impl.SimplepdlPackageImpl#getWorkSequenceType() + * @generated + */ + int WORK_SEQUENCE_TYPE = 7; + + + /** + * Returns the meta object for class '{@link simplepdl.ProcessElement Process Element}'. + * + * + * @return the meta object for class 'Process Element'. + * @see simplepdl.ProcessElement + * @generated + */ + EClass getProcessElement(); + + /** + * Returns the meta object for class '{@link simplepdl.WorkDefinition Work Definition}'. + * + * + * @return the meta object for class 'Work Definition'. + * @see simplepdl.WorkDefinition + * @generated + */ + EClass getWorkDefinition(); + + /** + * Returns the meta object for the reference list '{@link simplepdl.WorkDefinition#getLinksToPredecessors Links To Predecessors}'. + * + * + * @return the meta object for the reference list 'Links To Predecessors'. + * @see simplepdl.WorkDefinition#getLinksToPredecessors() + * @see #getWorkDefinition() + * @generated + */ + EReference getWorkDefinition_LinksToPredecessors(); + + /** + * Returns the meta object for the reference list '{@link simplepdl.WorkDefinition#getLinksToSuccessors Links To Successors}'. + * + * + * @return the meta object for the reference list 'Links To Successors'. + * @see simplepdl.WorkDefinition#getLinksToSuccessors() + * @see #getWorkDefinition() + * @generated + */ + EReference getWorkDefinition_LinksToSuccessors(); + + /** + * Returns the meta object for the attribute '{@link simplepdl.WorkDefinition#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see simplepdl.WorkDefinition#getName() + * @see #getWorkDefinition() + * @generated + */ + EAttribute getWorkDefinition_Name(); + + /** + * Returns the meta object for the containment reference list '{@link simplepdl.WorkDefinition#getRequests Requests}'. + * + * + * @return the meta object for the containment reference list 'Requests'. + * @see simplepdl.WorkDefinition#getRequests() + * @see #getWorkDefinition() + * @generated + */ + EReference getWorkDefinition_Requests(); + + /** + * Returns the meta object for class '{@link simplepdl.WorkSequence Work Sequence}'. + * + * + * @return the meta object for class 'Work Sequence'. + * @see simplepdl.WorkSequence + * @generated + */ + EClass getWorkSequence(); + + /** + * Returns the meta object for the attribute '{@link simplepdl.WorkSequence#getLinkType Link Type}'. + * + * + * @return the meta object for the attribute 'Link Type'. + * @see simplepdl.WorkSequence#getLinkType() + * @see #getWorkSequence() + * @generated + */ + EAttribute getWorkSequence_LinkType(); + + /** + * Returns the meta object for the reference '{@link simplepdl.WorkSequence#getPredecessor Predecessor}'. + * + * + * @return the meta object for the reference 'Predecessor'. + * @see simplepdl.WorkSequence#getPredecessor() + * @see #getWorkSequence() + * @generated + */ + EReference getWorkSequence_Predecessor(); + + /** + * Returns the meta object for the reference '{@link simplepdl.WorkSequence#getSuccessor Successor}'. + * + * + * @return the meta object for the reference 'Successor'. + * @see simplepdl.WorkSequence#getSuccessor() + * @see #getWorkSequence() + * @generated + */ + EReference getWorkSequence_Successor(); + + /** + * Returns the meta object for class '{@link simplepdl.Process Process}'. + * + * + * @return the meta object for class 'Process'. + * @see simplepdl.Process + * @generated + */ + EClass getProcess(); + + /** + * Returns the meta object for the attribute '{@link simplepdl.Process#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see simplepdl.Process#getName() + * @see #getProcess() + * @generated + */ + EAttribute getProcess_Name(); + + /** + * Returns the meta object for the containment reference list '{@link simplepdl.Process#getProcessElements Process Elements}'. + * + * + * @return the meta object for the containment reference list 'Process Elements'. + * @see simplepdl.Process#getProcessElements() + * @see #getProcess() + * @generated + */ + EReference getProcess_ProcessElements(); + + /** + * Returns the meta object for class '{@link simplepdl.Guidance Guidance}'. + * + * + * @return the meta object for class 'Guidance'. + * @see simplepdl.Guidance + * @generated + */ + EClass getGuidance(); + + /** + * Returns the meta object for the attribute '{@link simplepdl.Guidance#getText Text}'. + * + * + * @return the meta object for the attribute 'Text'. + * @see simplepdl.Guidance#getText() + * @see #getGuidance() + * @generated + */ + EAttribute getGuidance_Text(); + + /** + * Returns the meta object for the reference list '{@link simplepdl.Guidance#getElements Elements}'. + * + * + * @return the meta object for the reference list 'Elements'. + * @see simplepdl.Guidance#getElements() + * @see #getGuidance() + * @generated + */ + EReference getGuidance_Elements(); + + /** + * Returns the meta object for class '{@link simplepdl.Resource Resource}'. + * + * + * @return the meta object for class 'Resource'. + * @see simplepdl.Resource + * @generated + */ + EClass getResource(); + + /** + * Returns the meta object for the attribute '{@link simplepdl.Resource#getQuantity Quantity}'. + * + * + * @return the meta object for the attribute 'Quantity'. + * @see simplepdl.Resource#getQuantity() + * @see #getResource() + * @generated + */ + EAttribute getResource_Quantity(); + + /** + * Returns the meta object for the attribute '{@link simplepdl.Resource#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see simplepdl.Resource#getName() + * @see #getResource() + * @generated + */ + EAttribute getResource_Name(); + + /** + * Returns the meta object for class '{@link simplepdl.Request Request}'. + * + * + * @return the meta object for class 'Request'. + * @see simplepdl.Request + * @generated + */ + EClass getRequest(); + + /** + * Returns the meta object for the attribute '{@link simplepdl.Request#getQuantity Quantity}'. + * + * + * @return the meta object for the attribute 'Quantity'. + * @see simplepdl.Request#getQuantity() + * @see #getRequest() + * @generated + */ + EAttribute getRequest_Quantity(); + + /** + * Returns the meta object for the reference '{@link simplepdl.Request#getTarget Target}'. + * + * + * @return the meta object for the reference 'Target'. + * @see simplepdl.Request#getTarget() + * @see #getRequest() + * @generated + */ + EReference getRequest_Target(); + + /** + * Returns the meta object for enum '{@link simplepdl.WorkSequenceType Work Sequence Type}'. + * + * + * @return the meta object for enum 'Work Sequence Type'. + * @see simplepdl.WorkSequenceType + * @generated + */ + EEnum getWorkSequenceType(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + SimplepdlFactory getSimplepdlFactory(); + + /** + * + * 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 simplepdl.impl.ProcessElementImpl Process Element}' class. + * + * + * @see simplepdl.impl.ProcessElementImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getProcessElement() + * @generated + */ + EClass PROCESS_ELEMENT = eINSTANCE.getProcessElement(); + + /** + * The meta object literal for the '{@link simplepdl.impl.WorkDefinitionImpl Work Definition}' class. + * + * + * @see simplepdl.impl.WorkDefinitionImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getWorkDefinition() + * @generated + */ + EClass WORK_DEFINITION = eINSTANCE.getWorkDefinition(); + + /** + * The meta object literal for the 'Links To Predecessors' reference list feature. + * + * + * @generated + */ + EReference WORK_DEFINITION__LINKS_TO_PREDECESSORS = eINSTANCE.getWorkDefinition_LinksToPredecessors(); + + /** + * The meta object literal for the 'Links To Successors' reference list feature. + * + * + * @generated + */ + EReference WORK_DEFINITION__LINKS_TO_SUCCESSORS = eINSTANCE.getWorkDefinition_LinksToSuccessors(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute WORK_DEFINITION__NAME = eINSTANCE.getWorkDefinition_Name(); + + /** + * The meta object literal for the 'Requests' containment reference list feature. + * + * + * @generated + */ + EReference WORK_DEFINITION__REQUESTS = eINSTANCE.getWorkDefinition_Requests(); + + /** + * The meta object literal for the '{@link simplepdl.impl.WorkSequenceImpl Work Sequence}' class. + * + * + * @see simplepdl.impl.WorkSequenceImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getWorkSequence() + * @generated + */ + EClass WORK_SEQUENCE = eINSTANCE.getWorkSequence(); + + /** + * The meta object literal for the 'Link Type' attribute feature. + * + * + * @generated + */ + EAttribute WORK_SEQUENCE__LINK_TYPE = eINSTANCE.getWorkSequence_LinkType(); + + /** + * The meta object literal for the 'Predecessor' reference feature. + * + * + * @generated + */ + EReference WORK_SEQUENCE__PREDECESSOR = eINSTANCE.getWorkSequence_Predecessor(); + + /** + * The meta object literal for the 'Successor' reference feature. + * + * + * @generated + */ + EReference WORK_SEQUENCE__SUCCESSOR = eINSTANCE.getWorkSequence_Successor(); + + /** + * The meta object literal for the '{@link simplepdl.impl.ProcessImpl Process}' class. + * + * + * @see simplepdl.impl.ProcessImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getProcess() + * @generated + */ + EClass PROCESS = eINSTANCE.getProcess(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute PROCESS__NAME = eINSTANCE.getProcess_Name(); + + /** + * The meta object literal for the 'Process Elements' containment reference list feature. + * + * + * @generated + */ + EReference PROCESS__PROCESS_ELEMENTS = eINSTANCE.getProcess_ProcessElements(); + + /** + * The meta object literal for the '{@link simplepdl.impl.GuidanceImpl Guidance}' class. + * + * + * @see simplepdl.impl.GuidanceImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getGuidance() + * @generated + */ + EClass GUIDANCE = eINSTANCE.getGuidance(); + + /** + * The meta object literal for the 'Text' attribute feature. + * + * + * @generated + */ + EAttribute GUIDANCE__TEXT = eINSTANCE.getGuidance_Text(); + + /** + * The meta object literal for the 'Elements' reference list feature. + * + * + * @generated + */ + EReference GUIDANCE__ELEMENTS = eINSTANCE.getGuidance_Elements(); + + /** + * The meta object literal for the '{@link simplepdl.impl.ResourceImpl Resource}' class. + * + * + * @see simplepdl.impl.ResourceImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getResource() + * @generated + */ + EClass RESOURCE = eINSTANCE.getResource(); + + /** + * The meta object literal for the 'Quantity' attribute feature. + * + * + * @generated + */ + EAttribute RESOURCE__QUANTITY = eINSTANCE.getResource_Quantity(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute RESOURCE__NAME = eINSTANCE.getResource_Name(); + + /** + * The meta object literal for the '{@link simplepdl.impl.RequestImpl Request}' class. + * + * + * @see simplepdl.impl.RequestImpl + * @see simplepdl.impl.SimplepdlPackageImpl#getRequest() + * @generated + */ + EClass REQUEST = eINSTANCE.getRequest(); + + /** + * The meta object literal for the 'Quantity' attribute feature. + * + * + * @generated + */ + EAttribute REQUEST__QUANTITY = eINSTANCE.getRequest_Quantity(); + + /** + * The meta object literal for the 'Target' reference feature. + * + * + * @generated + */ + EReference REQUEST__TARGET = eINSTANCE.getRequest_Target(); + + /** + * The meta object literal for the '{@link simplepdl.WorkSequenceType Work Sequence Type}' enum. + * + * + * @see simplepdl.WorkSequenceType + * @see simplepdl.impl.SimplepdlPackageImpl#getWorkSequenceType() + * @generated + */ + EEnum WORK_SEQUENCE_TYPE = eINSTANCE.getWorkSequenceType(); + + } + +} //SimplepdlPackage diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/WorkDefinition.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/WorkDefinition.java new file mode 100644 index 0000000..b4c6357 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/WorkDefinition.java @@ -0,0 +1,89 @@ +/** + */ +package simplepdl; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Work Definition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link simplepdl.WorkDefinition#getLinksToPredecessors Links To Predecessors}
  • + *
  • {@link simplepdl.WorkDefinition#getLinksToSuccessors Links To Successors}
  • + *
  • {@link simplepdl.WorkDefinition#getName Name}
  • + *
  • {@link simplepdl.WorkDefinition#getRequests Requests}
  • + *
+ * + * @see simplepdl.SimplepdlPackage#getWorkDefinition() + * @model + * @generated + */ +public interface WorkDefinition extends ProcessElement { + /** + * Returns the value of the 'Links To Predecessors' reference list. + * The list contents are of type {@link simplepdl.WorkSequence}. + * It is bidirectional and its opposite is '{@link simplepdl.WorkSequence#getSuccessor Successor}'. + * + * + * @return the value of the 'Links To Predecessors' reference list. + * @see simplepdl.SimplepdlPackage#getWorkDefinition_LinksToPredecessors() + * @see simplepdl.WorkSequence#getSuccessor + * @model opposite="successor" + * @generated + */ + EList getLinksToPredecessors(); + + /** + * Returns the value of the 'Links To Successors' reference list. + * The list contents are of type {@link simplepdl.WorkSequence}. + * It is bidirectional and its opposite is '{@link simplepdl.WorkSequence#getPredecessor Predecessor}'. + * + * + * @return the value of the 'Links To Successors' reference list. + * @see simplepdl.SimplepdlPackage#getWorkDefinition_LinksToSuccessors() + * @see simplepdl.WorkSequence#getPredecessor + * @model opposite="predecessor" + * @generated + */ + EList getLinksToSuccessors(); + + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see simplepdl.SimplepdlPackage#getWorkDefinition_Name() + * @model required="true" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link simplepdl.WorkDefinition#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Requests' containment reference list. + * The list contents are of type {@link simplepdl.Request}. + * + * + * @return the value of the 'Requests' containment reference list. + * @see simplepdl.SimplepdlPackage#getWorkDefinition_Requests() + * @model containment="true" + * @generated + */ + EList getRequests(); + +} // WorkDefinition diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/WorkSequence.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/WorkSequence.java new file mode 100644 index 0000000..51755aa --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/WorkSequence.java @@ -0,0 +1,98 @@ +/** + */ +package simplepdl; + + +/** + * + * A representation of the model object 'Work Sequence'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link simplepdl.WorkSequence#getLinkType Link Type}
  • + *
  • {@link simplepdl.WorkSequence#getPredecessor Predecessor}
  • + *
  • {@link simplepdl.WorkSequence#getSuccessor Successor}
  • + *
+ * + * @see simplepdl.SimplepdlPackage#getWorkSequence() + * @model + * @generated + */ +public interface WorkSequence extends ProcessElement { + /** + * Returns the value of the 'Link Type' attribute. + * The literals are from the enumeration {@link simplepdl.WorkSequenceType}. + * + * + * @return the value of the 'Link Type' attribute. + * @see simplepdl.WorkSequenceType + * @see #setLinkType(WorkSequenceType) + * @see simplepdl.SimplepdlPackage#getWorkSequence_LinkType() + * @model required="true" + * @generated + */ + WorkSequenceType getLinkType(); + + /** + * Sets the value of the '{@link simplepdl.WorkSequence#getLinkType Link Type}' attribute. + * + * + * @param value the new value of the 'Link Type' attribute. + * @see simplepdl.WorkSequenceType + * @see #getLinkType() + * @generated + */ + void setLinkType(WorkSequenceType value); + + /** + * Returns the value of the 'Predecessor' reference. + * It is bidirectional and its opposite is '{@link simplepdl.WorkDefinition#getLinksToSuccessors Links To Successors}'. + * + * + * @return the value of the 'Predecessor' reference. + * @see #setPredecessor(WorkDefinition) + * @see simplepdl.SimplepdlPackage#getWorkSequence_Predecessor() + * @see simplepdl.WorkDefinition#getLinksToSuccessors + * @model opposite="linksToSuccessors" required="true" + * @generated + */ + WorkDefinition getPredecessor(); + + /** + * Sets the value of the '{@link simplepdl.WorkSequence#getPredecessor Predecessor}' reference. + * + * + * @param value the new value of the 'Predecessor' reference. + * @see #getPredecessor() + * @generated + */ + void setPredecessor(WorkDefinition value); + + /** + * Returns the value of the 'Successor' reference. + * It is bidirectional and its opposite is '{@link simplepdl.WorkDefinition#getLinksToPredecessors Links To Predecessors}'. + * + * + * @return the value of the 'Successor' reference. + * @see #setSuccessor(WorkDefinition) + * @see simplepdl.SimplepdlPackage#getWorkSequence_Successor() + * @see simplepdl.WorkDefinition#getLinksToPredecessors + * @model opposite="linksToPredecessors" required="true" + * @generated + */ + WorkDefinition getSuccessor(); + + /** + * Sets the value of the '{@link simplepdl.WorkSequence#getSuccessor Successor}' reference. + * + * + * @param value the new value of the 'Successor' reference. + * @see #getSuccessor() + * @generated + */ + void setSuccessor(WorkDefinition value); + +} // WorkSequence diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/WorkSequenceType.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/WorkSequenceType.java new file mode 100644 index 0000000..a43c5a3 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/WorkSequenceType.java @@ -0,0 +1,252 @@ +/** + */ +package simplepdl; + +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 'Work Sequence Type', + * and utility methods for working with them. + * + * @see simplepdl.SimplepdlPackage#getWorkSequenceType() + * @model + * @generated + */ +public enum WorkSequenceType implements Enumerator { + /** + * The 'Start To Start' literal object. + * + * + * @see #START_TO_START_VALUE + * @generated + * @ordered + */ + START_TO_START(0, "startToStart", "startToStart"), + + /** + * The 'Finish To Start' literal object. + * + * + * @see #FINISH_TO_START_VALUE + * @generated + * @ordered + */ + FINISH_TO_START(1, "finishToStart", "finishToStart"), + + /** + * The 'Start To Finish' literal object. + * + * + * @see #START_TO_FINISH_VALUE + * @generated + * @ordered + */ + START_TO_FINISH(2, "startToFinish", "startToFinish"), + + /** + * The 'Finish To Finish' literal object. + * + * + * @see #FINISH_TO_FINISH_VALUE + * @generated + * @ordered + */ + FINISH_TO_FINISH(3, "finishToFinish", "finishToFinish"); + + /** + * The 'Start To Start' literal value. + * + * + * @see #START_TO_START + * @model name="startToStart" + * @generated + * @ordered + */ + public static final int START_TO_START_VALUE = 0; + + /** + * The 'Finish To Start' literal value. + * + * + * @see #FINISH_TO_START + * @model name="finishToStart" + * @generated + * @ordered + */ + public static final int FINISH_TO_START_VALUE = 1; + + /** + * The 'Start To Finish' literal value. + * + * + * @see #START_TO_FINISH + * @model name="startToFinish" + * @generated + * @ordered + */ + public static final int START_TO_FINISH_VALUE = 2; + + /** + * The 'Finish To Finish' literal value. + * + * + * @see #FINISH_TO_FINISH + * @model name="finishToFinish" + * @generated + * @ordered + */ + public static final int FINISH_TO_FINISH_VALUE = 3; + + /** + * An array of all the 'Work Sequence Type' enumerators. + * + * + * @generated + */ + private static final WorkSequenceType[] VALUES_ARRAY = + new WorkSequenceType[] { + START_TO_START, + FINISH_TO_START, + START_TO_FINISH, + FINISH_TO_FINISH, + }; + + /** + * A public read-only list of all the 'Work Sequence Type' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Work Sequence Type' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static WorkSequenceType get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + WorkSequenceType result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Work Sequence Type' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static WorkSequenceType getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + WorkSequenceType result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Work Sequence Type' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static WorkSequenceType get(int value) { + switch (value) { + case START_TO_START_VALUE: return START_TO_START; + case FINISH_TO_START_VALUE: return FINISH_TO_START; + case START_TO_FINISH_VALUE: return START_TO_FINISH; + case FINISH_TO_FINISH_VALUE: return FINISH_TO_FINISH; + } + 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 WorkSequenceType(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; + } + +} //WorkSequenceType diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/GuidanceImpl.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/GuidanceImpl.java new file mode 100644 index 0000000..fb8f7a0 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/GuidanceImpl.java @@ -0,0 +1,204 @@ +/** + */ +package simplepdl.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +import simplepdl.Guidance; +import simplepdl.ProcessElement; +import simplepdl.SimplepdlPackage; + +/** + * + * An implementation of the model object 'Guidance'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link simplepdl.impl.GuidanceImpl#getText Text}
  • + *
  • {@link simplepdl.impl.GuidanceImpl#getElements Elements}
  • + *
+ * + * @generated + */ +public class GuidanceImpl extends ProcessElementImpl implements Guidance { + /** + * The default value of the '{@link #getText() Text}' attribute. + * + * + * @see #getText() + * @generated + * @ordered + */ + protected static final String TEXT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getText() Text}' attribute. + * + * + * @see #getText() + * @generated + * @ordered + */ + protected String text = TEXT_EDEFAULT; + + /** + * The cached value of the '{@link #getElements() Elements}' reference list. + * + * + * @see #getElements() + * @generated + * @ordered + */ + protected EList elements; + + /** + * + * + * @generated + */ + protected GuidanceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SimplepdlPackage.Literals.GUIDANCE; + } + + /** + * + * + * @generated + */ + public String getText() { + return text; + } + + /** + * + * + * @generated + */ + public void setText(String newText) { + String oldText = text; + text = newText; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.GUIDANCE__TEXT, oldText, text)); + } + + /** + * + * + * @generated + */ + public EList getElements() { + if (elements == null) { + elements = new EObjectResolvingEList(ProcessElement.class, this, SimplepdlPackage.GUIDANCE__ELEMENTS); + } + return elements; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SimplepdlPackage.GUIDANCE__TEXT: + return getText(); + case SimplepdlPackage.GUIDANCE__ELEMENTS: + return getElements(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SimplepdlPackage.GUIDANCE__TEXT: + setText((String)newValue); + return; + case SimplepdlPackage.GUIDANCE__ELEMENTS: + getElements().clear(); + getElements().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SimplepdlPackage.GUIDANCE__TEXT: + setText(TEXT_EDEFAULT); + return; + case SimplepdlPackage.GUIDANCE__ELEMENTS: + getElements().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SimplepdlPackage.GUIDANCE__TEXT: + return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text); + case SimplepdlPackage.GUIDANCE__ELEMENTS: + return elements != null && !elements.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (text: "); + result.append(text); + result.append(')'); + return result.toString(); + } + +} //GuidanceImpl diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/ProcessElementImpl.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/ProcessElementImpl.java new file mode 100644 index 0000000..0df9f5f --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/ProcessElementImpl.java @@ -0,0 +1,39 @@ +/** + */ +package simplepdl.impl; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import simplepdl.ProcessElement; +import simplepdl.SimplepdlPackage; + +/** + * + * An implementation of the model object 'Process Element'. + * + * + * @generated + */ +public abstract class ProcessElementImpl extends MinimalEObjectImpl.Container implements ProcessElement { + /** + * + * + * @generated + */ + protected ProcessElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SimplepdlPackage.Literals.PROCESS_ELEMENT; + } + +} //ProcessElementImpl diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/ProcessImpl.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/ProcessImpl.java new file mode 100644 index 0000000..a6908b3 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/ProcessImpl.java @@ -0,0 +1,221 @@ +/** + */ +package simplepdl.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import simplepdl.ProcessElement; +import simplepdl.SimplepdlPackage; + +/** + * + * An implementation of the model object 'Process'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link simplepdl.impl.ProcessImpl#getName Name}
  • + *
  • {@link simplepdl.impl.ProcessImpl#getProcessElements Process Elements}
  • + *
+ * + * @generated + */ +public class ProcessImpl extends MinimalEObjectImpl.Container implements simplepdl.Process { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getProcessElements() Process Elements}' containment reference list. + * + * + * @see #getProcessElements() + * @generated + * @ordered + */ + protected EList processElements; + + /** + * + * + * @generated + */ + protected ProcessImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SimplepdlPackage.Literals.PROCESS; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.PROCESS__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public EList getProcessElements() { + if (processElements == null) { + processElements = new EObjectContainmentEList(ProcessElement.class, this, SimplepdlPackage.PROCESS__PROCESS_ELEMENTS); + } + return processElements; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SimplepdlPackage.PROCESS__PROCESS_ELEMENTS: + return ((InternalEList)getProcessElements()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SimplepdlPackage.PROCESS__NAME: + return getName(); + case SimplepdlPackage.PROCESS__PROCESS_ELEMENTS: + return getProcessElements(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SimplepdlPackage.PROCESS__NAME: + setName((String)newValue); + return; + case SimplepdlPackage.PROCESS__PROCESS_ELEMENTS: + getProcessElements().clear(); + getProcessElements().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SimplepdlPackage.PROCESS__NAME: + setName(NAME_EDEFAULT); + return; + case SimplepdlPackage.PROCESS__PROCESS_ELEMENTS: + getProcessElements().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SimplepdlPackage.PROCESS__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case SimplepdlPackage.PROCESS__PROCESS_ELEMENTS: + return processElements != null && !processElements.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ProcessImpl diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/RequestImpl.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/RequestImpl.java new file mode 100644 index 0000000..4489022 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/RequestImpl.java @@ -0,0 +1,225 @@ +/** + */ +package simplepdl.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import simplepdl.Request; +import simplepdl.Resource; +import simplepdl.SimplepdlPackage; + +/** + * + * An implementation of the model object 'Request'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link simplepdl.impl.RequestImpl#getQuantity Quantity}
  • + *
  • {@link simplepdl.impl.RequestImpl#getTarget Target}
  • + *
+ * + * @generated + */ +public class RequestImpl extends MinimalEObjectImpl.Container implements Request { + /** + * The default value of the '{@link #getQuantity() Quantity}' attribute. + * + * + * @see #getQuantity() + * @generated + * @ordered + */ + protected static final int QUANTITY_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getQuantity() Quantity}' attribute. + * + * + * @see #getQuantity() + * @generated + * @ordered + */ + protected int quantity = QUANTITY_EDEFAULT; + + /** + * The cached value of the '{@link #getTarget() Target}' reference. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected Resource target; + + /** + * + * + * @generated + */ + protected RequestImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SimplepdlPackage.Literals.REQUEST; + } + + /** + * + * + * @generated + */ + public int getQuantity() { + return quantity; + } + + /** + * + * + * @generated + */ + public void setQuantity(int newQuantity) { + int oldQuantity = quantity; + quantity = newQuantity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.REQUEST__QUANTITY, oldQuantity, quantity)); + } + + /** + * + * + * @generated + */ + public Resource getTarget() { + if (target != null && target.eIsProxy()) { + InternalEObject oldTarget = (InternalEObject)target; + target = (Resource)eResolveProxy(oldTarget); + if (target != oldTarget) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, SimplepdlPackage.REQUEST__TARGET, oldTarget, target)); + } + } + return target; + } + + /** + * + * + * @generated + */ + public Resource basicGetTarget() { + return target; + } + + /** + * + * + * @generated + */ + public void setTarget(Resource newTarget) { + Resource oldTarget = target; + target = newTarget; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.REQUEST__TARGET, oldTarget, target)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SimplepdlPackage.REQUEST__QUANTITY: + return getQuantity(); + case SimplepdlPackage.REQUEST__TARGET: + if (resolve) return getTarget(); + return basicGetTarget(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SimplepdlPackage.REQUEST__QUANTITY: + setQuantity((Integer)newValue); + return; + case SimplepdlPackage.REQUEST__TARGET: + setTarget((Resource)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SimplepdlPackage.REQUEST__QUANTITY: + setQuantity(QUANTITY_EDEFAULT); + return; + case SimplepdlPackage.REQUEST__TARGET: + setTarget((Resource)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SimplepdlPackage.REQUEST__QUANTITY: + return quantity != QUANTITY_EDEFAULT; + case SimplepdlPackage.REQUEST__TARGET: + return target != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (quantity: "); + result.append(quantity); + result.append(')'); + return result.toString(); + } + +} //RequestImpl diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/ResourceImpl.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/ResourceImpl.java new file mode 100644 index 0000000..3c36103 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/ResourceImpl.java @@ -0,0 +1,216 @@ +/** + */ +package simplepdl.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import simplepdl.Resource; +import simplepdl.SimplepdlPackage; + +/** + * + * An implementation of the model object 'Resource'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link simplepdl.impl.ResourceImpl#getQuantity Quantity}
  • + *
  • {@link simplepdl.impl.ResourceImpl#getName Name}
  • + *
+ * + * @generated + */ +public class ResourceImpl extends ProcessElementImpl implements Resource { + /** + * The default value of the '{@link #getQuantity() Quantity}' attribute. + * + * + * @see #getQuantity() + * @generated + * @ordered + */ + protected static final int QUANTITY_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getQuantity() Quantity}' attribute. + * + * + * @see #getQuantity() + * @generated + * @ordered + */ + protected int quantity = QUANTITY_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected ResourceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SimplepdlPackage.Literals.RESOURCE; + } + + /** + * + * + * @generated + */ + public int getQuantity() { + return quantity; + } + + /** + * + * + * @generated + */ + public void setQuantity(int newQuantity) { + int oldQuantity = quantity; + quantity = newQuantity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.RESOURCE__QUANTITY, oldQuantity, quantity)); + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.RESOURCE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SimplepdlPackage.RESOURCE__QUANTITY: + return getQuantity(); + case SimplepdlPackage.RESOURCE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SimplepdlPackage.RESOURCE__QUANTITY: + setQuantity((Integer)newValue); + return; + case SimplepdlPackage.RESOURCE__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SimplepdlPackage.RESOURCE__QUANTITY: + setQuantity(QUANTITY_EDEFAULT); + return; + case SimplepdlPackage.RESOURCE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SimplepdlPackage.RESOURCE__QUANTITY: + return quantity != QUANTITY_EDEFAULT; + case SimplepdlPackage.RESOURCE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (quantity: "); + result.append(quantity); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //ResourceImpl diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/SimplepdlFactoryImpl.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/SimplepdlFactoryImpl.java new file mode 100644 index 0000000..507d7b1 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/SimplepdlFactoryImpl.java @@ -0,0 +1,208 @@ +/** + */ +package simplepdl.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import simplepdl.Guidance; +import simplepdl.Request; +import simplepdl.Resource; +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class SimplepdlFactoryImpl extends EFactoryImpl implements SimplepdlFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static SimplepdlFactory init() { + try { + SimplepdlFactory theSimplepdlFactory = (SimplepdlFactory)EPackage.Registry.INSTANCE.getEFactory(SimplepdlPackage.eNS_URI); + if (theSimplepdlFactory != null) { + return theSimplepdlFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new SimplepdlFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public SimplepdlFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case SimplepdlPackage.WORK_DEFINITION: return createWorkDefinition(); + case SimplepdlPackage.WORK_SEQUENCE: return createWorkSequence(); + case SimplepdlPackage.PROCESS: return createProcess(); + case SimplepdlPackage.GUIDANCE: return createGuidance(); + case SimplepdlPackage.RESOURCE: return createResource(); + case SimplepdlPackage.REQUEST: return createRequest(); + 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 SimplepdlPackage.WORK_SEQUENCE_TYPE: + return createWorkSequenceTypeFromString(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 SimplepdlPackage.WORK_SEQUENCE_TYPE: + return convertWorkSequenceTypeToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public WorkDefinition createWorkDefinition() { + WorkDefinitionImpl workDefinition = new WorkDefinitionImpl(); + return workDefinition; + } + + /** + * + * + * @generated + */ + public WorkSequence createWorkSequence() { + WorkSequenceImpl workSequence = new WorkSequenceImpl(); + return workSequence; + } + + /** + * + * + * @generated + */ + public simplepdl.Process createProcess() { + ProcessImpl process = new ProcessImpl(); + return process; + } + + /** + * + * + * @generated + */ + public Guidance createGuidance() { + GuidanceImpl guidance = new GuidanceImpl(); + return guidance; + } + + /** + * + * + * @generated + */ + public Resource createResource() { + ResourceImpl resource = new ResourceImpl(); + return resource; + } + + /** + * + * + * @generated + */ + public Request createRequest() { + RequestImpl request = new RequestImpl(); + return request; + } + + /** + * + * + * @generated + */ + public WorkSequenceType createWorkSequenceTypeFromString(EDataType eDataType, String initialValue) { + WorkSequenceType result = WorkSequenceType.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertWorkSequenceTypeToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public SimplepdlPackage getSimplepdlPackage() { + return (SimplepdlPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static SimplepdlPackage getPackage() { + return SimplepdlPackage.eINSTANCE; + } + +} //SimplepdlFactoryImpl diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/SimplepdlPackageImpl.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/SimplepdlPackageImpl.java new file mode 100644 index 0000000..808fb5e --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/SimplepdlPackageImpl.java @@ -0,0 +1,489 @@ +/** + */ +package simplepdl.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import simplepdl.Guidance; +import simplepdl.ProcessElement; +import simplepdl.Request; +import simplepdl.Resource; +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class SimplepdlPackageImpl extends EPackageImpl implements SimplepdlPackage { + /** + * + * + * @generated + */ + private EClass processElementEClass = null; + + /** + * + * + * @generated + */ + private EClass workDefinitionEClass = null; + + /** + * + * + * @generated + */ + private EClass workSequenceEClass = null; + + /** + * + * + * @generated + */ + private EClass processEClass = null; + + /** + * + * + * @generated + */ + private EClass guidanceEClass = null; + + /** + * + * + * @generated + */ + private EClass resourceEClass = null; + + /** + * + * + * @generated + */ + private EClass requestEClass = null; + + /** + * + * + * @generated + */ + private EEnum workSequenceTypeEEnum = 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 simplepdl.SimplepdlPackage#eNS_URI + * @see #init() + * @generated + */ + private SimplepdlPackageImpl() { + super(eNS_URI, SimplepdlFactory.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 SimplepdlPackage#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 SimplepdlPackage init() { + if (isInited) return (SimplepdlPackage)EPackage.Registry.INSTANCE.getEPackage(SimplepdlPackage.eNS_URI); + + // Obtain or create and register package + Object registeredSimplepdlPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + SimplepdlPackageImpl theSimplepdlPackage = registeredSimplepdlPackage instanceof SimplepdlPackageImpl ? (SimplepdlPackageImpl)registeredSimplepdlPackage : new SimplepdlPackageImpl(); + + isInited = true; + + // Create package meta-data objects + theSimplepdlPackage.createPackageContents(); + + // Initialize created meta-data + theSimplepdlPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theSimplepdlPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(SimplepdlPackage.eNS_URI, theSimplepdlPackage); + return theSimplepdlPackage; + } + + /** + * + * + * @generated + */ + public EClass getProcessElement() { + return processElementEClass; + } + + /** + * + * + * @generated + */ + public EClass getWorkDefinition() { + return workDefinitionEClass; + } + + /** + * + * + * @generated + */ + public EReference getWorkDefinition_LinksToPredecessors() { + return (EReference)workDefinitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getWorkDefinition_LinksToSuccessors() { + return (EReference)workDefinitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getWorkDefinition_Name() { + return (EAttribute)workDefinitionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EReference getWorkDefinition_Requests() { + return (EReference)workDefinitionEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + public EClass getWorkSequence() { + return workSequenceEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getWorkSequence_LinkType() { + return (EAttribute)workSequenceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getWorkSequence_Predecessor() { + return (EReference)workSequenceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getWorkSequence_Successor() { + return (EReference)workSequenceEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getProcess() { + return processEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getProcess_Name() { + return (EAttribute)processEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getProcess_ProcessElements() { + return (EReference)processEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getGuidance() { + return guidanceEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getGuidance_Text() { + return (EAttribute)guidanceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getGuidance_Elements() { + return (EReference)guidanceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getResource() { + return resourceEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getResource_Quantity() { + return (EAttribute)resourceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getResource_Name() { + return (EAttribute)resourceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getRequest() { + return requestEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getRequest_Quantity() { + return (EAttribute)requestEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getRequest_Target() { + return (EReference)requestEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EEnum getWorkSequenceType() { + return workSequenceTypeEEnum; + } + + /** + * + * + * @generated + */ + public SimplepdlFactory getSimplepdlFactory() { + return (SimplepdlFactory)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 + processElementEClass = createEClass(PROCESS_ELEMENT); + + workDefinitionEClass = createEClass(WORK_DEFINITION); + createEReference(workDefinitionEClass, WORK_DEFINITION__LINKS_TO_PREDECESSORS); + createEReference(workDefinitionEClass, WORK_DEFINITION__LINKS_TO_SUCCESSORS); + createEAttribute(workDefinitionEClass, WORK_DEFINITION__NAME); + createEReference(workDefinitionEClass, WORK_DEFINITION__REQUESTS); + + workSequenceEClass = createEClass(WORK_SEQUENCE); + createEAttribute(workSequenceEClass, WORK_SEQUENCE__LINK_TYPE); + createEReference(workSequenceEClass, WORK_SEQUENCE__PREDECESSOR); + createEReference(workSequenceEClass, WORK_SEQUENCE__SUCCESSOR); + + processEClass = createEClass(PROCESS); + createEAttribute(processEClass, PROCESS__NAME); + createEReference(processEClass, PROCESS__PROCESS_ELEMENTS); + + guidanceEClass = createEClass(GUIDANCE); + createEAttribute(guidanceEClass, GUIDANCE__TEXT); + createEReference(guidanceEClass, GUIDANCE__ELEMENTS); + + resourceEClass = createEClass(RESOURCE); + createEAttribute(resourceEClass, RESOURCE__QUANTITY); + createEAttribute(resourceEClass, RESOURCE__NAME); + + requestEClass = createEClass(REQUEST); + createEAttribute(requestEClass, REQUEST__QUANTITY); + createEReference(requestEClass, REQUEST__TARGET); + + // Create enums + workSequenceTypeEEnum = createEEnum(WORK_SEQUENCE_TYPE); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + workDefinitionEClass.getESuperTypes().add(this.getProcessElement()); + workSequenceEClass.getESuperTypes().add(this.getProcessElement()); + guidanceEClass.getESuperTypes().add(this.getProcessElement()); + resourceEClass.getESuperTypes().add(this.getProcessElement()); + + // Initialize classes, features, and operations; add parameters + initEClass(processElementEClass, ProcessElement.class, "ProcessElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(workDefinitionEClass, WorkDefinition.class, "WorkDefinition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getWorkDefinition_LinksToPredecessors(), this.getWorkSequence(), this.getWorkSequence_Successor(), "linksToPredecessors", null, 0, -1, WorkDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getWorkDefinition_LinksToSuccessors(), this.getWorkSequence(), this.getWorkSequence_Predecessor(), "linksToSuccessors", null, 0, -1, WorkDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getWorkDefinition_Name(), ecorePackage.getEString(), "name", null, 1, 1, WorkDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getWorkDefinition_Requests(), this.getRequest(), null, "requests", null, 0, -1, WorkDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(workSequenceEClass, WorkSequence.class, "WorkSequence", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getWorkSequence_LinkType(), this.getWorkSequenceType(), "linkType", null, 1, 1, WorkSequence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getWorkSequence_Predecessor(), this.getWorkDefinition(), this.getWorkDefinition_LinksToSuccessors(), "predecessor", null, 1, 1, WorkSequence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getWorkSequence_Successor(), this.getWorkDefinition(), this.getWorkDefinition_LinksToPredecessors(), "successor", null, 1, 1, WorkSequence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(processEClass, simplepdl.Process.class, "Process", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getProcess_Name(), ecorePackage.getEString(), "name", null, 1, 1, simplepdl.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getProcess_ProcessElements(), this.getProcessElement(), null, "processElements", null, 0, -1, simplepdl.Process.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(guidanceEClass, Guidance.class, "Guidance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGuidance_Text(), ecorePackage.getEString(), "text", null, 1, 1, Guidance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getGuidance_Elements(), this.getProcessElement(), null, "elements", null, 0, -1, Guidance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(resourceEClass, Resource.class, "Resource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getResource_Quantity(), ecorePackage.getEInt(), "quantity", null, 1, 1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getResource_Name(), ecorePackage.getEString(), "name", null, 1, 1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(requestEClass, Request.class, "Request", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getRequest_Quantity(), ecorePackage.getEInt(), "quantity", null, 1, 1, Request.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRequest_Target(), this.getResource(), null, "target", null, 1, 1, Request.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(workSequenceTypeEEnum, WorkSequenceType.class, "WorkSequenceType"); + addEEnumLiteral(workSequenceTypeEEnum, WorkSequenceType.START_TO_START); + addEEnumLiteral(workSequenceTypeEEnum, WorkSequenceType.FINISH_TO_START); + addEEnumLiteral(workSequenceTypeEEnum, WorkSequenceType.START_TO_FINISH); + addEEnumLiteral(workSequenceTypeEEnum, WorkSequenceType.FINISH_TO_FINISH); + + // Create resource + createResource(eNS_URI); + } + +} //SimplepdlPackageImpl diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/WorkDefinitionImpl.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/WorkDefinitionImpl.java new file mode 100644 index 0000000..3e69f5f --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/WorkDefinitionImpl.java @@ -0,0 +1,312 @@ +/** + */ +package simplepdl.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import simplepdl.Request; +import simplepdl.SimplepdlPackage; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; + +/** + * + * An implementation of the model object 'Work Definition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link simplepdl.impl.WorkDefinitionImpl#getLinksToPredecessors Links To Predecessors}
  • + *
  • {@link simplepdl.impl.WorkDefinitionImpl#getLinksToSuccessors Links To Successors}
  • + *
  • {@link simplepdl.impl.WorkDefinitionImpl#getName Name}
  • + *
  • {@link simplepdl.impl.WorkDefinitionImpl#getRequests Requests}
  • + *
+ * + * @generated + */ +public class WorkDefinitionImpl extends ProcessElementImpl implements WorkDefinition { + /** + * The cached value of the '{@link #getLinksToPredecessors() Links To Predecessors}' reference list. + * + * + * @see #getLinksToPredecessors() + * @generated + * @ordered + */ + protected EList linksToPredecessors; + + /** + * The cached value of the '{@link #getLinksToSuccessors() Links To Successors}' reference list. + * + * + * @see #getLinksToSuccessors() + * @generated + * @ordered + */ + protected EList linksToSuccessors; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getRequests() Requests}' containment reference list. + * + * + * @see #getRequests() + * @generated + * @ordered + */ + protected EList requests; + + /** + * + * + * @generated + */ + protected WorkDefinitionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SimplepdlPackage.Literals.WORK_DEFINITION; + } + + /** + * + * + * @generated + */ + public EList getLinksToPredecessors() { + if (linksToPredecessors == null) { + linksToPredecessors = new EObjectWithInverseResolvingEList(WorkSequence.class, this, SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS, SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR); + } + return linksToPredecessors; + } + + /** + * + * + * @generated + */ + public EList getLinksToSuccessors() { + if (linksToSuccessors == null) { + linksToSuccessors = new EObjectWithInverseResolvingEList(WorkSequence.class, this, SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS, SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR); + } + return linksToSuccessors; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.WORK_DEFINITION__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public EList getRequests() { + if (requests == null) { + requests = new EObjectContainmentEList(Request.class, this, SimplepdlPackage.WORK_DEFINITION__REQUESTS); + } + return requests; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS: + return ((InternalEList)(InternalEList)getLinksToPredecessors()).basicAdd(otherEnd, msgs); + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS: + return ((InternalEList)(InternalEList)getLinksToSuccessors()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS: + return ((InternalEList)getLinksToPredecessors()).basicRemove(otherEnd, msgs); + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS: + return ((InternalEList)getLinksToSuccessors()).basicRemove(otherEnd, msgs); + case SimplepdlPackage.WORK_DEFINITION__REQUESTS: + return ((InternalEList)getRequests()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS: + return getLinksToPredecessors(); + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS: + return getLinksToSuccessors(); + case SimplepdlPackage.WORK_DEFINITION__NAME: + return getName(); + case SimplepdlPackage.WORK_DEFINITION__REQUESTS: + return getRequests(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS: + getLinksToPredecessors().clear(); + getLinksToPredecessors().addAll((Collection)newValue); + return; + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS: + getLinksToSuccessors().clear(); + getLinksToSuccessors().addAll((Collection)newValue); + return; + case SimplepdlPackage.WORK_DEFINITION__NAME: + setName((String)newValue); + return; + case SimplepdlPackage.WORK_DEFINITION__REQUESTS: + getRequests().clear(); + getRequests().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS: + getLinksToPredecessors().clear(); + return; + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS: + getLinksToSuccessors().clear(); + return; + case SimplepdlPackage.WORK_DEFINITION__NAME: + setName(NAME_EDEFAULT); + return; + case SimplepdlPackage.WORK_DEFINITION__REQUESTS: + getRequests().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS: + return linksToPredecessors != null && !linksToPredecessors.isEmpty(); + case SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS: + return linksToSuccessors != null && !linksToSuccessors.isEmpty(); + case SimplepdlPackage.WORK_DEFINITION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case SimplepdlPackage.WORK_DEFINITION__REQUESTS: + return requests != null && !requests.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //WorkDefinitionImpl diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/WorkSequenceImpl.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/WorkSequenceImpl.java new file mode 100644 index 0000000..9e6ab81 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/impl/WorkSequenceImpl.java @@ -0,0 +1,366 @@ +/** + */ +package simplepdl.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import simplepdl.SimplepdlPackage; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; + +/** + * + * An implementation of the model object 'Work Sequence'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link simplepdl.impl.WorkSequenceImpl#getLinkType Link Type}
  • + *
  • {@link simplepdl.impl.WorkSequenceImpl#getPredecessor Predecessor}
  • + *
  • {@link simplepdl.impl.WorkSequenceImpl#getSuccessor Successor}
  • + *
+ * + * @generated + */ +public class WorkSequenceImpl extends ProcessElementImpl implements WorkSequence { + /** + * The default value of the '{@link #getLinkType() Link Type}' attribute. + * + * + * @see #getLinkType() + * @generated + * @ordered + */ + protected static final WorkSequenceType LINK_TYPE_EDEFAULT = WorkSequenceType.START_TO_START; + + /** + * The cached value of the '{@link #getLinkType() Link Type}' attribute. + * + * + * @see #getLinkType() + * @generated + * @ordered + */ + protected WorkSequenceType linkType = LINK_TYPE_EDEFAULT; + + /** + * The cached value of the '{@link #getPredecessor() Predecessor}' reference. + * + * + * @see #getPredecessor() + * @generated + * @ordered + */ + protected WorkDefinition predecessor; + + /** + * The cached value of the '{@link #getSuccessor() Successor}' reference. + * + * + * @see #getSuccessor() + * @generated + * @ordered + */ + protected WorkDefinition successor; + + /** + * + * + * @generated + */ + protected WorkSequenceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SimplepdlPackage.Literals.WORK_SEQUENCE; + } + + /** + * + * + * @generated + */ + public WorkSequenceType getLinkType() { + return linkType; + } + + /** + * + * + * @generated + */ + public void setLinkType(WorkSequenceType newLinkType) { + WorkSequenceType oldLinkType = linkType; + linkType = newLinkType == null ? LINK_TYPE_EDEFAULT : newLinkType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.WORK_SEQUENCE__LINK_TYPE, oldLinkType, linkType)); + } + + /** + * + * + * @generated + */ + public WorkDefinition getPredecessor() { + if (predecessor != null && predecessor.eIsProxy()) { + InternalEObject oldPredecessor = (InternalEObject)predecessor; + predecessor = (WorkDefinition)eResolveProxy(oldPredecessor); + if (predecessor != oldPredecessor) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR, oldPredecessor, predecessor)); + } + } + return predecessor; + } + + /** + * + * + * @generated + */ + public WorkDefinition basicGetPredecessor() { + return predecessor; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetPredecessor(WorkDefinition newPredecessor, NotificationChain msgs) { + WorkDefinition oldPredecessor = predecessor; + predecessor = newPredecessor; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR, oldPredecessor, newPredecessor); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setPredecessor(WorkDefinition newPredecessor) { + if (newPredecessor != predecessor) { + NotificationChain msgs = null; + if (predecessor != null) + msgs = ((InternalEObject)predecessor).eInverseRemove(this, SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS, WorkDefinition.class, msgs); + if (newPredecessor != null) + msgs = ((InternalEObject)newPredecessor).eInverseAdd(this, SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS, WorkDefinition.class, msgs); + msgs = basicSetPredecessor(newPredecessor, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR, newPredecessor, newPredecessor)); + } + + /** + * + * + * @generated + */ + public WorkDefinition getSuccessor() { + if (successor != null && successor.eIsProxy()) { + InternalEObject oldSuccessor = (InternalEObject)successor; + successor = (WorkDefinition)eResolveProxy(oldSuccessor); + if (successor != oldSuccessor) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR, oldSuccessor, successor)); + } + } + return successor; + } + + /** + * + * + * @generated + */ + public WorkDefinition basicGetSuccessor() { + return successor; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetSuccessor(WorkDefinition newSuccessor, NotificationChain msgs) { + WorkDefinition oldSuccessor = successor; + successor = newSuccessor; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR, oldSuccessor, newSuccessor); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setSuccessor(WorkDefinition newSuccessor) { + if (newSuccessor != successor) { + NotificationChain msgs = null; + if (successor != null) + msgs = ((InternalEObject)successor).eInverseRemove(this, SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS, WorkDefinition.class, msgs); + if (newSuccessor != null) + msgs = ((InternalEObject)newSuccessor).eInverseAdd(this, SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS, WorkDefinition.class, msgs); + msgs = basicSetSuccessor(newSuccessor, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR, newSuccessor, newSuccessor)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR: + if (predecessor != null) + msgs = ((InternalEObject)predecessor).eInverseRemove(this, SimplepdlPackage.WORK_DEFINITION__LINKS_TO_SUCCESSORS, WorkDefinition.class, msgs); + return basicSetPredecessor((WorkDefinition)otherEnd, msgs); + case SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR: + if (successor != null) + msgs = ((InternalEObject)successor).eInverseRemove(this, SimplepdlPackage.WORK_DEFINITION__LINKS_TO_PREDECESSORS, WorkDefinition.class, msgs); + return basicSetSuccessor((WorkDefinition)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR: + return basicSetPredecessor(null, msgs); + case SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR: + return basicSetSuccessor(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SimplepdlPackage.WORK_SEQUENCE__LINK_TYPE: + return getLinkType(); + case SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR: + if (resolve) return getPredecessor(); + return basicGetPredecessor(); + case SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR: + if (resolve) return getSuccessor(); + return basicGetSuccessor(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SimplepdlPackage.WORK_SEQUENCE__LINK_TYPE: + setLinkType((WorkSequenceType)newValue); + return; + case SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR: + setPredecessor((WorkDefinition)newValue); + return; + case SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR: + setSuccessor((WorkDefinition)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SimplepdlPackage.WORK_SEQUENCE__LINK_TYPE: + setLinkType(LINK_TYPE_EDEFAULT); + return; + case SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR: + setPredecessor((WorkDefinition)null); + return; + case SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR: + setSuccessor((WorkDefinition)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SimplepdlPackage.WORK_SEQUENCE__LINK_TYPE: + return linkType != LINK_TYPE_EDEFAULT; + case SimplepdlPackage.WORK_SEQUENCE__PREDECESSOR: + return predecessor != null; + case SimplepdlPackage.WORK_SEQUENCE__SUCCESSOR: + return successor != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (linkType: "); + result.append(linkType); + result.append(')'); + return result.toString(); + } + +} //WorkSequenceImpl diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/manip/SimplePDLCreator.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/manip/SimplePDLCreator.java new file mode 100644 index 0000000..dc4526a --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/manip/SimplePDLCreator.java @@ -0,0 +1,86 @@ +package simplepdl.manip; + +import java.io.IOException; +import java.util.Collections; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import petrinet.PetrinetPackage; +import simplepdl.Process; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; + +public class SimplePDLCreator { + + public static void main(String[] args) { + + // Charger le package SimplePDL afin de l'enregistrer dans le registre d'Eclipse. + SimplepdlPackage packageInstance = SimplepdlPackage.eINSTANCE; + PetrinetPackage packageInstance2 = PetrinetPackage.eINSTANCE; + + // Enregistrer l'extension ".xmi" comme devant être ouverte à + // l'aide d'un objet "XMIResourceFactoryImpl" + Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; + Map m = reg.getExtensionToFactoryMap(); + m.put("xmi", new XMIResourceFactoryImpl()); + + // Créer un objet resourceSetImpl qui contiendra une ressource EMF (le modèle) + ResourceSet resSet = new ResourceSetImpl(); + + // Définir la ressource (le modèle) + URI modelURI = URI.createURI("models/SimplePDLCreator_Created_Process.xmi"); + Resource resource = resSet.createResource(modelURI); + + // La fabrique pour fabriquer les éléments de SimplePDL + SimplepdlFactory myFactory = SimplepdlFactory.eINSTANCE; + + // Créer un élément Process + Process process = myFactory.createProcess(); + process.setName("Mon premier processus"); + + // Ajouter le Process dans le modèle + resource.getContents().add(process); + + // Ajouter deux WorkDefinitions + WorkDefinition wd1 = myFactory.createWorkDefinition(); + wd1.setName("Ma première WorkDefinition, quelle émotion"); + + WorkDefinition wd2 = myFactory.createWorkDefinition(); + wd2.setName("Ma deuxième WorkDefinition, toujours autant d'émotion"); + + process.getProcessElements().add(wd1); + process.getProcessElements().add(wd2); + + // Ajouter une WorkSequence entre les deux WorkDefinitions + WorkSequence seq = myFactory.createWorkSequence(); + seq.setPredecessor(wd1); + seq.setSuccessor(wd2); + seq.setLinkType(WorkSequenceType.FINISH_TO_FINISH); + + process.getProcessElements().add(seq); + + // Ajouter une deuxième WorkSequence entre les deux WorkDefinitions + WorkSequence seq2 = myFactory.createWorkSequence(); + seq2.setPredecessor(wd1); + seq2.setSuccessor(wd2); + seq2.setLinkType(WorkSequenceType.START_TO_START); + + process.getProcessElements().add(seq2); + + + // Sauver la ressource + try { + resource.save(Collections.EMPTY_MAP); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/manip/SimplePDLManipulator.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/manip/SimplePDLManipulator.java new file mode 100644 index 0000000..61131d8 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/manip/SimplePDLManipulator.java @@ -0,0 +1,62 @@ +package simplepdl.manip; + +import java.util.Collections; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; + +import simplepdl.Process; +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; + +public class SimplePDLManipulator { + + public static void main(String[] args) { + + // Chargement du package SimplePDL afin de l'enregistrer dans le registre d'Eclipse. + SimplepdlPackage packageInstance = SimplepdlPackage.eINSTANCE; + + // Enregistrer l'extension ".xmi" comme devant être ouverte à + // l'aide d'un objet "XMIResourceFactoryImpl" + Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; + Map m = reg.getExtensionToFactoryMap(); + m.put("xmi", new XMIResourceFactoryImpl()); + + // Créer un objet resourceSetImpl qui contiendra une ressource EMF (notre modèle) + ResourceSet resSet = new ResourceSetImpl(); + + // Charger la ressource (notre modèle) + URI modelURI = URI.createURI("models/SimplePDLCreator_Created_Process.xmi"); + Resource resource = resSet.getResource(modelURI, true); + + // Récupérer le premier élément du modèle (élément racine) + Process process = (Process) resource.getContents().get(0); + + /** + * Manipulation de notre instance + */ + // Accéder aux informations du processus chargé + System.out.println("Processus : " + process.getName()); + // Naviguer dans les références + Integer nbPE = process.getProcessElements().size(); + System.out.println("Nombre de ProcessElement dans " + process.getName() + " : " + nbPE); + + // Afficher les sous-activités + System.out.println("Les sous-activités sont :"); + for (Object o : process.getProcessElements()) { + if (o instanceof WorkDefinition) { + WorkDefinition wd = (WorkDefinition) o; + System.out.println(" - " + wd.getName()); + } + } + + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/manip/simplepdl2petrinet.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/manip/simplepdl2petrinet.java new file mode 100644 index 0000000..b007609 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/manip/simplepdl2petrinet.java @@ -0,0 +1,85 @@ +package simplepdl.manip; + +import java.io.IOException; +import java.util.Collections; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; + +import simplepdl.Process; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; +import simplepdl.WorkSequenceType; +import simplepdl.SimplepdlFactory; +import simplepdl.SimplepdlPackage; + +public class simplepdl2petrinet { + + public static void main(String[] args) { + + // Charger le package SimplePDL afin de l'enregistrer dans le registre d'Eclipse. + SimplepdlPackage packageInstance = SimplepdlPackage.eINSTANCE; + + // Enregistrer l'extension ".xmi" comme devant être ouverte à + // l'aide d'un objet "XMIResourceFactoryImpl" + Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; + Map m = reg.getExtensionToFactoryMap(); + m.put("xmi", new XMIResourceFactoryImpl()); + + // Créer un objet resourceSetImpl qui contiendra une ressource EMF (le modèle) + ResourceSet resSet = new ResourceSetImpl(); + + // Définir la ressource (le modèle) + URI modelURI = URI.createURI("models/SimplePDLCreator_Created_Process.xmi"); + Resource resource = resSet.createResource(modelURI); + + // La fabrique pour fabriquer les éléments de SimplePDL + SimplepdlFactory myFactory = SimplepdlFactory.eINSTANCE; + + // Créer un élément Process + Process process = myFactory.createProcess(); + process.setName("Mon premier processus"); + + // Ajouter le Process dans le modèle + resource.getContents().add(process); + + // Ajouter deux WorkDefinitions + WorkDefinition wd1 = myFactory.createWorkDefinition(); + wd1.setName("Ma première WorkDefinition, quelle émotion"); + + WorkDefinition wd2 = myFactory.createWorkDefinition(); + wd2.setName("Ma deuxième WorkDefinition, toujours autant d'émotion"); + + process.getProcessElements().add(wd1); + process.getProcessElements().add(wd2); + + // Ajouter une WorkSequence entre les deux WorkDefinitions + WorkSequence seq = myFactory.createWorkSequence(); + seq.setPredecessor(wd1); + seq.setSuccessor(wd2); + seq.setLinkType(WorkSequenceType.FINISH_TO_FINISH); + + process.getProcessElements().add(seq); + + // Ajouter une deuxième WorkSequence entre les deux WorkDefinitions + WorkSequence seq2 = myFactory.createWorkSequence(); + seq2.setPredecessor(wd1); + seq2.setSuccessor(wd2); + seq2.setLinkType(WorkSequenceType.START_TO_START); + + process.getProcessElements().add(seq2); + + + // Sauver la ressource + try { + resource.save(Collections.EMPTY_MAP); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/util/SimplepdlAdapterFactory.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/util/SimplepdlAdapterFactory.java new file mode 100644 index 0000000..8c33ca0 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/util/SimplepdlAdapterFactory.java @@ -0,0 +1,234 @@ +/** + */ +package simplepdl.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import simplepdl.Guidance; +import simplepdl.ProcessElement; +import simplepdl.Request; +import simplepdl.Resource; +import simplepdl.SimplepdlPackage; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see simplepdl.SimplepdlPackage + * @generated + */ +public class SimplepdlAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static SimplepdlPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public SimplepdlAdapterFactory() { + if (modelPackage == null) { + modelPackage = SimplepdlPackage.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 SimplepdlSwitch modelSwitch = + new SimplepdlSwitch() { + @Override + public Adapter caseProcessElement(ProcessElement object) { + return createProcessElementAdapter(); + } + @Override + public Adapter caseWorkDefinition(WorkDefinition object) { + return createWorkDefinitionAdapter(); + } + @Override + public Adapter caseWorkSequence(WorkSequence object) { + return createWorkSequenceAdapter(); + } + @Override + public Adapter caseProcess(simplepdl.Process object) { + return createProcessAdapter(); + } + @Override + public Adapter caseGuidance(Guidance object) { + return createGuidanceAdapter(); + } + @Override + public Adapter caseResource(Resource object) { + return createResourceAdapter(); + } + @Override + public Adapter caseRequest(Request object) { + return createRequestAdapter(); + } + @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 simplepdl.ProcessElement Process Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see simplepdl.ProcessElement + * @generated + */ + public Adapter createProcessElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link simplepdl.WorkDefinition Work Definition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see simplepdl.WorkDefinition + * @generated + */ + public Adapter createWorkDefinitionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link simplepdl.WorkSequence Work Sequence}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see simplepdl.WorkSequence + * @generated + */ + public Adapter createWorkSequenceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link simplepdl.Process Process}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see simplepdl.Process + * @generated + */ + public Adapter createProcessAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link simplepdl.Guidance Guidance}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see simplepdl.Guidance + * @generated + */ + public Adapter createGuidanceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link simplepdl.Resource Resource}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see simplepdl.Resource + * @generated + */ + public Adapter createResourceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link simplepdl.Request Request}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see simplepdl.Request + * @generated + */ + public Adapter createRequestAdapter() { + 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; + } + +} //SimplepdlAdapterFactory diff --git a/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/util/SimplepdlSwitch.java b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/util/SimplepdlSwitch.java new file mode 100644 index 0000000..dc98e57 --- /dev/null +++ b/eclipse-workspace/fr.n7.simplepdl/src/simplepdl/util/SimplepdlSwitch.java @@ -0,0 +1,246 @@ +/** + */ +package simplepdl.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import simplepdl.Guidance; +import simplepdl.ProcessElement; +import simplepdl.Request; +import simplepdl.Resource; +import simplepdl.SimplepdlPackage; +import simplepdl.WorkDefinition; +import simplepdl.WorkSequence; + +/** + * + * 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 simplepdl.SimplepdlPackage + * @generated + */ +public class SimplepdlSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static SimplepdlPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public SimplepdlSwitch() { + if (modelPackage == null) { + modelPackage = SimplepdlPackage.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 SimplepdlPackage.PROCESS_ELEMENT: { + ProcessElement processElement = (ProcessElement)theEObject; + T result = caseProcessElement(processElement); + if (result == null) result = defaultCase(theEObject); + return result; + } + case SimplepdlPackage.WORK_DEFINITION: { + WorkDefinition workDefinition = (WorkDefinition)theEObject; + T result = caseWorkDefinition(workDefinition); + if (result == null) result = caseProcessElement(workDefinition); + if (result == null) result = defaultCase(theEObject); + return result; + } + case SimplepdlPackage.WORK_SEQUENCE: { + WorkSequence workSequence = (WorkSequence)theEObject; + T result = caseWorkSequence(workSequence); + if (result == null) result = caseProcessElement(workSequence); + if (result == null) result = defaultCase(theEObject); + return result; + } + case SimplepdlPackage.PROCESS: { + simplepdl.Process process = (simplepdl.Process)theEObject; + T result = caseProcess(process); + if (result == null) result = defaultCase(theEObject); + return result; + } + case SimplepdlPackage.GUIDANCE: { + Guidance guidance = (Guidance)theEObject; + T result = caseGuidance(guidance); + if (result == null) result = caseProcessElement(guidance); + if (result == null) result = defaultCase(theEObject); + return result; + } + case SimplepdlPackage.RESOURCE: { + Resource resource = (Resource)theEObject; + T result = caseResource(resource); + if (result == null) result = caseProcessElement(resource); + if (result == null) result = defaultCase(theEObject); + return result; + } + case SimplepdlPackage.REQUEST: { + Request request = (Request)theEObject; + T result = caseRequest(request); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Process Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Process Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseProcessElement(ProcessElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Work Definition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Work Definition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseWorkDefinition(WorkDefinition object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Work Sequence'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Work Sequence'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseWorkSequence(WorkSequence object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Process'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Process'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseProcess(simplepdl.Process object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Guidance'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Guidance'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGuidance(Guidance object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Resource'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Resource'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseResource(Resource object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Request'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Request'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRequest(Request 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; + } + +} //SimplepdlSwitch diff --git a/update-site-gls/artifacts.jar b/update-site-gls/artifacts.jar new file mode 100644 index 0000000..8057724 Binary files /dev/null and b/update-site-gls/artifacts.jar differ diff --git a/update-site-gls/content.jar b/update-site-gls/content.jar new file mode 100644 index 0000000..d8d5f26 Binary files /dev/null and b/update-site-gls/content.jar differ diff --git a/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091747.jar b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091747.jar new file mode 100644 index 0000000..c49233a Binary files /dev/null and b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091747.jar differ diff --git a/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091753.jar b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091753.jar new file mode 100644 index 0000000..86d1e46 Binary files /dev/null and b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091753.jar differ diff --git a/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091755.jar b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091755.jar new file mode 100644 index 0000000..984a745 Binary files /dev/null and b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091755.jar differ diff --git a/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091807.jar b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091807.jar new file mode 100644 index 0000000..bc70569 Binary files /dev/null and b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091807.jar differ diff --git a/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091813.jar b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091813.jar new file mode 100644 index 0000000..8d89817 Binary files /dev/null and b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091813.jar differ diff --git a/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091817.jar b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091817.jar new file mode 100644 index 0000000..7bdb949 Binary files /dev/null and b/update-site-gls/features/fr.n7.petrinet.feature_1.0.0.202110091817.jar differ diff --git a/update-site-gls/features/fr.n7.simplepdl.feature_1.0.0.202110091748.jar b/update-site-gls/features/fr.n7.simplepdl.feature_1.0.0.202110091748.jar new file mode 100644 index 0000000..66e0e31 Binary files /dev/null and b/update-site-gls/features/fr.n7.simplepdl.feature_1.0.0.202110091748.jar differ diff --git a/update-site-gls/logs.zip b/update-site-gls/logs.zip new file mode 100644 index 0000000..2d24d7b Binary files /dev/null and b/update-site-gls/logs.zip differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091747.jar b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091747.jar new file mode 100644 index 0000000..3ee2522 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091747.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091753.jar b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091753.jar new file mode 100644 index 0000000..c84736b Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091753.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091755.jar b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091755.jar new file mode 100644 index 0000000..200dab4 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091755.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091807.jar b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091807.jar new file mode 100644 index 0000000..d81d9da Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091807.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091813.jar b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091813.jar new file mode 100644 index 0000000..387c8fd Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091813.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091817.jar b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091817.jar new file mode 100644 index 0000000..5660138 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.edit_1.0.0.202110091817.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091747.jar b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091747.jar new file mode 100644 index 0000000..1290ecc Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091747.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091753.jar b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091753.jar new file mode 100644 index 0000000..1c390b6 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091753.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091755.jar b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091755.jar new file mode 100644 index 0000000..2154338 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091755.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091807.jar b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091807.jar new file mode 100644 index 0000000..38ba089 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091807.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091813.jar b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091813.jar new file mode 100644 index 0000000..9b00359 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091813.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091817.jar b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091817.jar new file mode 100644 index 0000000..23d94d5 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.editor_1.0.0.202110091817.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091747.jar b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091747.jar new file mode 100644 index 0000000..819d8ed Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091747.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091753.jar b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091753.jar new file mode 100644 index 0000000..99c61e5 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091753.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091755.jar b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091755.jar new file mode 100644 index 0000000..c8bd08d Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091755.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091807.jar b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091807.jar new file mode 100644 index 0000000..2597f92 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091807.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091813.jar b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091813.jar new file mode 100644 index 0000000..b5fd71b Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091813.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091817.jar b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091817.jar new file mode 100644 index 0000000..ce4f0d9 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet.tests_1.0.0.202110091817.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091747.jar b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091747.jar new file mode 100644 index 0000000..299c0df Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091747.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091753.jar b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091753.jar new file mode 100644 index 0000000..65da5f1 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091753.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091755.jar b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091755.jar new file mode 100644 index 0000000..4587119 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091755.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091807.jar b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091807.jar new file mode 100644 index 0000000..ed26354 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091807.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091813.jar b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091813.jar new file mode 100644 index 0000000..e2cf9ee Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091813.jar differ diff --git a/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091817.jar b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091817.jar new file mode 100644 index 0000000..5d0e7bc Binary files /dev/null and b/update-site-gls/plugins/fr.n7.petrinet_1.0.0.202110091817.jar differ diff --git a/update-site-gls/plugins/fr.n7.simplepdl.edit_1.0.0.202110091748.jar b/update-site-gls/plugins/fr.n7.simplepdl.edit_1.0.0.202110091748.jar new file mode 100644 index 0000000..91c3b39 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.simplepdl.edit_1.0.0.202110091748.jar differ diff --git a/update-site-gls/plugins/fr.n7.simplepdl.editor_1.0.0.202110091748.jar b/update-site-gls/plugins/fr.n7.simplepdl.editor_1.0.0.202110091748.jar new file mode 100644 index 0000000..a30a7e7 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.simplepdl.editor_1.0.0.202110091748.jar differ diff --git a/update-site-gls/plugins/fr.n7.simplepdl.tests_1.0.0.202110091748.jar b/update-site-gls/plugins/fr.n7.simplepdl.tests_1.0.0.202110091748.jar new file mode 100644 index 0000000..86600c2 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.simplepdl.tests_1.0.0.202110091748.jar differ diff --git a/update-site-gls/plugins/fr.n7.simplepdl_1.0.0.202110091748.jar b/update-site-gls/plugins/fr.n7.simplepdl_1.0.0.202110091748.jar new file mode 100644 index 0000000..a85b0d7 Binary files /dev/null and b/update-site-gls/plugins/fr.n7.simplepdl_1.0.0.202110091748.jar differ