This commit is contained in:
Laurent Fainsin 2021-10-09 22:04:54 +02:00
parent c923ddc564
commit e1419fa6ab
306 changed files with 11112 additions and 2328 deletions

View file

@ -1,409 +1,22 @@
!ENTRY org.eclipse.emf.cdo.explorer 4 0 2021-10-09 18:08:30.240
!MESSAGE InterruptedException
!ENTRY fr.n7.simplepdl.toHTML.ui 4 0 2021-10-09 21:26:13.352
!MESSAGE '/fr/n7/simplepdl/toHTML/main/toHTML.emtl' not found
!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
java.io.IOException: '/fr/n7/simplepdl/toHTML/main/toHTML.emtl' not found
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:481)
at fr.n7.simplepdl.toHTML.main.ToHTML.<init>(ToHTML.java:91)
at fr.n7.simplepdl.toHTML.ui.common.GenerateAll.doGenerate(GenerateAll.java:77)
at fr.n7.simplepdl.toHTML.ui.popupMenus.AcceleoGenerateToHTMLAction$1.run(AcceleoGenerateToHTMLAction.java:78)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
!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.jdt.core 4 969 2021-10-09 22:03:20.149
!MESSAGE fr.n7.petrinet.toTINA.ui does not exist
!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.jdt.core 4 969 2021-10-09 22:03:20.151
!MESSAGE fr.n7.petrinet.toTINA.ui does not exist
!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.jdt.core 4 969 2021-10-09 22:03:20.154
!MESSAGE fr.n7.petrinet.toTINA.ui does not exist
!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)
!ENTRY org.eclipse.jdt.core 4 969 2021-10-09 22:03:20.166
!MESSAGE fr.n7.petrinet.toTINA.ui does not exist

View file

@ -0,0 +1,412 @@
/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package fr.n7.petrinet.toTINA.main;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener;
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy;
import org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* Entry point of the 'ToTINA' generation module.
*
* @generated
*/
public class ToTINA extends AbstractAcceleoGenerator {
/**
* The name of the module.
*
* @generated
*/
public static final String MODULE_FILE_NAME = "/fr/n7/petrinet/toTINA/main/toTINA";
/**
* The name of the templates that are to be generated.
*
* @generated
*/
public static final String[] TEMPLATE_NAMES = { "networkToTINA" };
/**
* The list of properties files from the launch parameters (Launch configuration).
*
* @generated
*/
private List<String> propertiesFiles = new ArrayList<String>();
/**
* Allows the public constructor to be used. Note that a generator created
* this way cannot be used to launch generations before one of
* {@link #initialize(EObject, File, List)} or
* {@link #initialize(URI, File, List)} is called.
* <p>
* The main reason for this constructor is to allow clients of this
* generation to call it from another Java file, as it allows for the
* retrieval of {@link #getProperties()} and
* {@link #getGenerationListeners()}.
* </p>
*
* @generated
*/
public ToTINA() {
// Empty implementation
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param modelURI
* URI where the model on which this generator will be used is located.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
* the model cannot be loaded.
* @generated
*/
public ToTINA(URI modelURI, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(modelURI, targetFolder, arguments);
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param model
* We'll iterate over the content of this element to find Objects matching the first parameter
* of the template we need to call.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
* @generated
*/
public ToTINA(EObject model, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(model, targetFolder, arguments);
}
/**
* This can be used to launch the generation from a standalone application.
*
* @param args
* Arguments of the generation.
* @generated
*/
public static void main(String[] args) {
try {
if (args.length < 2) {
System.out.println("Arguments not valid : {model, folder}.");
} else {
URI modelURI = URI.createFileURI(args[0]);
File folder = new File(args[1]);
List<String> arguments = new ArrayList<String>();
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* Add in this list all the arguments used by the starting point of the generation
* If your main template is called on an element of your model and a String, you can
* add in "arguments" this "String" attribute.
*/
ToTINA generator = new ToTINA(modelURI, folder, arguments);
/*
* Add the properties from the launch arguments.
* If you want to programmatically add new properties, add them in "propertiesFiles"
* You can add the absolute path of a properties files, or even a project relative path.
* If you want to add another "protocol" for your properties files, please override
* "getPropertiesLoaderService(AcceleoService)" in order to return a new property loader.
* The behavior of the properties loader service is explained in the Acceleo documentation
* (Help -> Help Contents).
*/
for (int i = 2; i < args.length; i++) {
generator.addPropertiesFile(args[i]);
}
generator.doGenerate(new BasicMonitor());
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Launches the generation described by this instance.
*
* @param monitor
* This will be used to display progress information to the user.
* @throws IOException
* This will be thrown if any of the output files cannot be saved to disk.
* @generated
*/
@Override
public void doGenerate(Monitor monitor) throws IOException {
/*
* TODO if you wish to change the generation as a whole, override this. The default behavior should
* be sufficient in most cases. If you want to change the content of this method, do NOT forget to
* change the "@generated" tag in the Javadoc of this method to "@generated NOT". Without this new tag,
* any compilation of the Acceleo module with the main template that has caused the creation of this
* class will revert your modifications. If you encounter a problem with an unresolved proxy during the
* generation, you can remove the comments in the following instructions to check for problems. Please
* note that those instructions may have a significant impact on the performances.
*/
//org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
/*
* If you want to check for potential errors in your models before the launch of the generation, you
* use the code below.
*/
//if (model != null && model.eResource() != null) {
// List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
// for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
// System.err.println(diagnostic.toString());
// }
//}
super.doGenerate(monitor);
}
/**
* If this generator needs to listen to text generation events, listeners can be returned from here.
*
* @return List of listeners that are to be notified when text is generated through this launch.
* @generated
*/
@Override
public List<IAcceleoTextGenerationListener> getGenerationListeners() {
List<IAcceleoTextGenerationListener> listeners = super.getGenerationListeners();
/*
* TODO if you need to listen to generation event, add listeners to the list here. If you want to change
* the content of this method, do NOT forget to change the "@generated" tag in the Javadoc of this method
* to "@generated NOT". Without this new tag, any compilation of the Acceleo module with the main template
* that has caused the creation of this class will revert your modifications.
*/
return listeners;
}
/**
* If you need to change the way files are generated, this is your entry point.
* <p>
* The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates
* files on the fly. If you only need to preview the results, return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware of
* the running Eclipse and can be used standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical example is when you wanna
* override files that are under clear case or any other VCS that could forbid the overriding), then
* return a new {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}.
* <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return super.getGenerationStrategy();
}
/**
* This will be called in order to find and load the module that will be launched through this launcher.
* We expect this name not to contain file extension, and the module to be located beside the launcher.
*
* @return The name of the module that is to be launched.
* @generated
*/
@Override
public String getModuleName() {
return MODULE_FILE_NAME;
}
/**
* If the module(s) called by this launcher require properties files, return their qualified path from
* here.Take note that the first added properties files will take precedence over subsequent ones if they
* contain conflicting keys.
*
* @return The list of properties file we need to add to the generation context.
* @see java.util.ResourceBundle#getBundle(String)
* @generated
*/
@Override
public List<String> getProperties() {
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO if your generation module requires access to properties files, add their qualified path to the list here.
*
* Properties files can be located in an Eclipse plug-in or in the file system (all Acceleo projects are Eclipse
* plug-in). In order to use properties files located in an Eclipse plugin, you need to add the path of the properties
* files to the "propertiesFiles" list:
*
* final String prefix = "platform:/plugin/";
* final String pluginName = "org.eclipse.acceleo.module.sample";
* final String packagePath = "/org/eclipse/acceleo/module/sample/properties/";
* final String fileName = "default.properties";
* propertiesFiles.add(prefix + pluginName + packagePath + fileName);
*
* With this mechanism, you can load properties files from your plugin or from another plugin.
*
* You may want to load properties files from the file system, for that you need to add the absolute path of the file:
*
* propertiesFiles.add("C:\Users\MyName\MyFile.properties");
*
* If you want to let your users add properties files located in the same folder as the model:
*
* if (EMFPlugin.IS_ECLIPSE_RUNNING && model != null && model.eResource() != null) {
* propertiesFiles.addAll(AcceleoEngineUtils.getPropertiesFilesNearModel(model.eResource()));
* }
*
* To learn more about Properties Files, have a look at the Acceleo documentation (Help -> Help Contents).
*/
return propertiesFiles;
}
/**
* Adds a properties file in the list of properties files.
*
* @param propertiesFile
* The properties file to add.
* @generated
* @since 3.1
*/
@Override
public void addPropertiesFile(String propertiesFile) {
this.propertiesFiles.add(propertiesFile);
}
/**
* This will be used to get the list of templates that are to be launched by this launcher.
*
* @return The list of templates to call on the module {@link #getModuleName()}.
* @generated
*/
@Override
public String[] getTemplateNames() {
return TEMPLATE_NAMES;
}
/**
* This can be used to update the resource set's package registry with all needed EPackages.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML.
*
* You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
* register is in the workspace.
*
* To register a package properly, please follow the following conventions:
*
* If the package is located in another plug-in, already installed in Eclipse. The following content should
* have been generated at the beginning of this method. Do not register the package using this mechanism if
* the metamodel is located in the workspace.
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* }
*
* If the package is located in another project in your workspace, the plugin containing the package has not
* been register by EMF and Acceleo should register it automatically. If you want to use the generator in
* stand alone, the regular registration (seen a couple lines before) is needed.
*
* To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
*/
}
/**
* This can be used to update the resource set's resource factory registry with all needed factories.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated
*/
@Override
public void registerResourceFactories(ResourceSet resourceSet) {
super.registerResourceFactories(resourceSet);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO If you need additional resource factories registrations, you can register them here. the following line
* (in comment) is an example of the resource factory registration.
*
* If you want to use the generator in stand alone, the resource factory registration will be required.
*
* To learn more about the registration of Resource Factories, have a look at the Acceleo documentation (Help -> Help Contents).
*/
// resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(XyzResource.FILE_EXTENSION, XyzResource.Factory.INSTANCE);
/*
* Some metamodels require a very complex setup for standalone usage. For example, if you want to use a generator
* targetting UML models in standalone, you NEED to use the following:
*/
// UMLResourcesUtil.init(resourceSet)
}
}

View file

@ -0,0 +1,19 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net [aNetwork.name/]
[/file]
[/template]
[query public getPlaces(p: Place) : OrderedSet(Places) =
p.Node
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]

View file

@ -0,0 +1,19 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net [aNetwork.name/]
[/file]
[/template]
[query public getPlaces(p: Place) : OrderedSet(Place) =
p.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]

View file

@ -0,0 +1,19 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net [aNetwork.name/]
[/file]
[/template]
[query public getPlaces(p: Place) : OrderedSet(Place) =
p.Node
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]

View file

@ -0,0 +1,23 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Acceleo ToHTML Module Runtime Plug-in
Bundle-SymbolicName: fr.n7.simplepdl.toHTML
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: fr.n7.simplepdl.toHTML.Activator
Bundle-Vendor: Eclipse Modeling Project
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.xmi,
org.eclipse.ocl,
org.eclipse.ocl.ecore,
org.eclipse.acceleo.common;bundle-version="3.3.0",
org.eclipse.acceleo.model;bundle-version="3.3.0",
org.eclipse.acceleo.profiler;bundle-version="3.3.0",
org.eclipse.acceleo.engine;bundle-version="3.3.0",
com.google.guava
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Export-Package: fr.n7.simplepdl.toHTML.main

View file

@ -0,0 +1,10 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name, false, 'UTF-8')]
[/file]
[/template]

View file

@ -0,0 +1,23 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Acceleo ToDOT Module Runtime Plug-in
Bundle-SymbolicName: fr.n7.simplepdl.toDOT
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: fr.n7.simplepdl.toDOT.Activator
Bundle-Vendor: Eclipse Modeling Project
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.xmi,
org.eclipse.ocl,
org.eclipse.ocl.ecore,
org.eclipse.acceleo.common;bundle-version="3.3.0",
org.eclipse.acceleo.model;bundle-version="3.3.0",
org.eclipse.acceleo.profiler;bundle-version="3.3.0",
org.eclipse.acceleo.engine;bundle-version="3.3.0",
com.google.guava
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Export-Package: fr.n7.simplepdl.toDOT.main

View file

@ -0,0 +1,11 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
[/file]
[/template]

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/] [for (a : Arc | t.arcs)][if (a.isOutgoing()) ][/if][/for]
[/template]

View file

@ -0,0 +1,12 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net [aNetwork.name/]
[/file]
[/template]

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/] [for (a : Arc | t.arcs)][if (not a.outgoing)][a.target.name/]*[a.weight/][/if] [/for]-> [for (a : Arc | t.arcs)][if (a.outgoing)][a.target.name/]*[a.weight/][/if][/for]
[/template]

View file

@ -0,0 +1,14 @@
<head>
<title>developpement</title>
</head>
<body>
<h1>Process "developpement"</h1>
<h2>Work definitions</h2>
<ul>
<li>Conception</li>
<li>RedactionDoc requires Conception to be started, Conception to be finished.</li>
<li>Programmation requires Conception to be finished.</li>
<li>RedactionTests requires Conception to be started, Programmation to be finished.</li>
</ul>
</body>

View file

@ -0,0 +1,416 @@
/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package fr.n7.simplepdl.toHTML.main;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener;
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy;
import org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* Entry point of the 'ToHTML' generation module.
*
* @generated
*/
public class ToHTML extends AbstractAcceleoGenerator {
/**
* The name of the module.
*
* @generated
*/
public static final String MODULE_FILE_NAME = "/fr/n7/simplepdl/toHTML/main/toHTML";
/**
* The name of the templates that are to be generated.
*
* @generated
*/
public static final String[] TEMPLATE_NAMES = { "processToHTML" };
/**
* The list of properties files from the launch parameters (Launch configuration).
*
* @generated
*/
private List<String> propertiesFiles = new ArrayList<String>();
/**
* Allows the public constructor to be used. Note that a generator created
* this way cannot be used to launch generations before one of
* {@link #initialize(EObject, File, List)} or
* {@link #initialize(URI, File, List)} is called.
* <p>
* The main reason for this constructor is to allow clients of this
* generation to call it from another Java file, as it allows for the
* retrieval of {@link #getProperties()} and
* {@link #getGenerationListeners()}.
* </p>
*
* @generated
*/
public ToHTML() {
// Empty implementation
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param modelURI
* URI where the model on which this generator will be used is located.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
* the model cannot be loaded.
* @generated
*/
public ToHTML(URI modelURI, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(modelURI, targetFolder, arguments);
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param model
* We'll iterate over the content of this element to find Objects matching the first parameter
* of the template we need to call.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
* @generated
*/
public ToHTML(EObject model, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(model, targetFolder, arguments);
}
/**
* This can be used to launch the generation from a standalone application.
*
* @param args
* Arguments of the generation.
* @generated
*/
public static void main(String[] args) {
try {
if (args.length < 2) {
System.out.println("Arguments not valid : {model, folder}.");
} else {
URI modelURI = URI.createFileURI(args[0]);
File folder = new File(args[1]);
List<String> arguments = new ArrayList<String>();
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* Add in this list all the arguments used by the starting point of the generation
* If your main template is called on an element of your model and a String, you can
* add in "arguments" this "String" attribute.
*/
ToHTML generator = new ToHTML(modelURI, folder, arguments);
/*
* Add the properties from the launch arguments.
* If you want to programmatically add new properties, add them in "propertiesFiles"
* You can add the absolute path of a properties files, or even a project relative path.
* If you want to add another "protocol" for your properties files, please override
* "getPropertiesLoaderService(AcceleoService)" in order to return a new property loader.
* The behavior of the properties loader service is explained in the Acceleo documentation
* (Help -> Help Contents).
*/
for (int i = 2; i < args.length; i++) {
generator.addPropertiesFile(args[i]);
}
generator.doGenerate(new BasicMonitor());
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Launches the generation described by this instance.
*
* @param monitor
* This will be used to display progress information to the user.
* @throws IOException
* This will be thrown if any of the output files cannot be saved to disk.
* @generated
*/
@Override
public void doGenerate(Monitor monitor) throws IOException {
/*
* TODO if you wish to change the generation as a whole, override this. The default behavior should
* be sufficient in most cases. If you want to change the content of this method, do NOT forget to
* change the "@generated" tag in the Javadoc of this method to "@generated NOT". Without this new tag,
* any compilation of the Acceleo module with the main template that has caused the creation of this
* class will revert your modifications. If you encounter a problem with an unresolved proxy during the
* generation, you can remove the comments in the following instructions to check for problems. Please
* note that those instructions may have a significant impact on the performances.
*/
//org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
/*
* If you want to check for potential errors in your models before the launch of the generation, you
* use the code below.
*/
//if (model != null && model.eResource() != null) {
// List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
// for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
// System.err.println(diagnostic.toString());
// }
//}
super.doGenerate(monitor);
}
/**
* If this generator needs to listen to text generation events, listeners can be returned from here.
*
* @return List of listeners that are to be notified when text is generated through this launch.
* @generated
*/
@Override
public List<IAcceleoTextGenerationListener> getGenerationListeners() {
List<IAcceleoTextGenerationListener> listeners = super.getGenerationListeners();
/*
* TODO if you need to listen to generation event, add listeners to the list here. If you want to change
* the content of this method, do NOT forget to change the "@generated" tag in the Javadoc of this method
* to "@generated NOT". Without this new tag, any compilation of the Acceleo module with the main template
* that has caused the creation of this class will revert your modifications.
*/
return listeners;
}
/**
* If you need to change the way files are generated, this is your entry point.
* <p>
* The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates
* files on the fly. If you only need to preview the results, return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware of
* the running Eclipse and can be used standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical example is when you wanna
* override files that are under clear case or any other VCS that could forbid the overriding), then
* return a new {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}.
* <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return super.getGenerationStrategy();
}
/**
* This will be called in order to find and load the module that will be launched through this launcher.
* We expect this name not to contain file extension, and the module to be located beside the launcher.
*
* @return The name of the module that is to be launched.
* @generated
*/
@Override
public String getModuleName() {
return MODULE_FILE_NAME;
}
/**
* If the module(s) called by this launcher require properties files, return their qualified path from
* here.Take note that the first added properties files will take precedence over subsequent ones if they
* contain conflicting keys.
*
* @return The list of properties file we need to add to the generation context.
* @see java.util.ResourceBundle#getBundle(String)
* @generated
*/
@Override
public List<String> getProperties() {
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO if your generation module requires access to properties files, add their qualified path to the list here.
*
* Properties files can be located in an Eclipse plug-in or in the file system (all Acceleo projects are Eclipse
* plug-in). In order to use properties files located in an Eclipse plugin, you need to add the path of the properties
* files to the "propertiesFiles" list:
*
* final String prefix = "platform:/plugin/";
* final String pluginName = "org.eclipse.acceleo.module.sample";
* final String packagePath = "/org/eclipse/acceleo/module/sample/properties/";
* final String fileName = "default.properties";
* propertiesFiles.add(prefix + pluginName + packagePath + fileName);
*
* With this mechanism, you can load properties files from your plugin or from another plugin.
*
* You may want to load properties files from the file system, for that you need to add the absolute path of the file:
*
* propertiesFiles.add("C:\Users\MyName\MyFile.properties");
*
* If you want to let your users add properties files located in the same folder as the model:
*
* if (EMFPlugin.IS_ECLIPSE_RUNNING && model != null && model.eResource() != null) {
* propertiesFiles.addAll(AcceleoEngineUtils.getPropertiesFilesNearModel(model.eResource()));
* }
*
* To learn more about Properties Files, have a look at the Acceleo documentation (Help -> Help Contents).
*/
return propertiesFiles;
}
/**
* Adds a properties file in the list of properties files.
*
* @param propertiesFile
* The properties file to add.
* @generated
* @since 3.1
*/
@Override
public void addPropertiesFile(String propertiesFile) {
this.propertiesFiles.add(propertiesFile);
}
/**
* This will be used to get the list of templates that are to be launched by this launcher.
*
* @return The list of templates to call on the module {@link #getModuleName()}.
* @generated
*/
@Override
public String[] getTemplateNames() {
return TEMPLATE_NAMES;
}
/**
* This can be used to update the resource set's package registry with all needed EPackages.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated NOOT
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
if (!isInWorkspace(SimplepdlPackage.class))
resourceSet.getPackageRegistry().put(
SimplepdlPackage.eNS_URI, SimplepdlPackage.eINSTANCE);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML.
*
* You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
* register is in the workspace.
*
* To register a package properly, please follow the following conventions:
*
* If the package is located in another plug-in, already installed in Eclipse. The following content should
* have been generated at the beginning of this method. Do not register the package using this mechanism if
* the metamodel is located in the workspace.
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* }
*
* If the package is located in another project in your workspace, the plugin containing the package has not
* been register by EMF and Acceleo should register it automatically. If you want to use the generator in
* stand alone, the regular registration (seen a couple lines before) is needed.
*
* To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
*/
}
/**
* This can be used to update the resource set's resource factory registry with all needed factories.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated
*/
@Override
public void registerResourceFactories(ResourceSet resourceSet) {
super.registerResourceFactories(resourceSet);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO If you need additional resource factories registrations, you can register them here. the following line
* (in comment) is an example of the resource factory registration.
*
* If you want to use the generator in stand alone, the resource factory registration will be required.
*
* To learn more about the registration of Resource Factories, have a look at the Acceleo documentation (Help -> Help Contents).
*/
// resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(XyzResource.FILE_EXTENSION, XyzResource.Factory.INSTANCE);
/*
* Some metamodels require a very complex setup for standalone usage. For example, if you want to use a generator
* targetting UML models in standalone, you NEED to use the following:
*/
// UMLResourcesUtil.init(resourceSet)
}
}

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/] [for (a : Arc | t.arcs)][if (not a.outgoing)][a.target.name/]*[a.weight/][/if] [/for]-> [for (a : Arc | t.arcs)][if (a.outgoing)][a.target.name/]*[a.weight/][/if][/for]
[/template]

View file

@ -0,0 +1,10 @@
[comment encoding = UTF-8 /]
[module toHTML('http://simplepdl')]
[template public processToHTML(aProcess : Process)]
[comment @main/]
[file (aProcess.name, false, 'UTF-8')]
[/file]
[/template]

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/] [for (a : Arc | t.arcs)][if (not a.outgoing)][a.target.name/]*[a.weight/] [/if][/for]-> [for (a : Arc | t.arcs)][if (a.outgoing)][a.target.name/]*[a.weight/][/if][/for]
[/template]

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="fr.n7.petrinet.feature"
label="petrinet plugin"
version="1.0.0.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<plugin
id="fr.n7.petrinet.edit"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.petrinet.editor"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.petrinet"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.petrinet.tests"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/]
[/template]

View file

@ -0,0 +1,416 @@
/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package fr.n7.simplepdl.toDOT.main;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener;
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy;
import org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* Entry point of the 'ToDOT' generation module.
*
* @generated
*/
public class ToDOT extends AbstractAcceleoGenerator {
/**
* The name of the module.
*
* @generated
*/
public static final String MODULE_FILE_NAME = "/fr/n7/simplepdl/toDOT/main/toDOT";
/**
* The name of the templates that are to be generated.
*
* @generated
*/
public static final String[] TEMPLATE_NAMES = { "processToDot" };
/**
* The list of properties files from the launch parameters (Launch configuration).
*
* @generated
*/
private List<String> propertiesFiles = new ArrayList<String>();
/**
* Allows the public constructor to be used. Note that a generator created
* this way cannot be used to launch generations before one of
* {@link #initialize(EObject, File, List)} or
* {@link #initialize(URI, File, List)} is called.
* <p>
* The main reason for this constructor is to allow clients of this
* generation to call it from another Java file, as it allows for the
* retrieval of {@link #getProperties()} and
* {@link #getGenerationListeners()}.
* </p>
*
* @generated
*/
public ToDOT() {
// Empty implementation
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param modelURI
* URI where the model on which this generator will be used is located.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
* the model cannot be loaded.
* @generated
*/
public ToDOT(URI modelURI, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(modelURI, targetFolder, arguments);
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param model
* We'll iterate over the content of this element to find Objects matching the first parameter
* of the template we need to call.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
* @generated
*/
public ToDOT(EObject model, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(model, targetFolder, arguments);
}
/**
* This can be used to launch the generation from a standalone application.
*
* @param args
* Arguments of the generation.
* @generated
*/
public static void main(String[] args) {
try {
if (args.length < 2) {
System.out.println("Arguments not valid : {model, folder}.");
} else {
URI modelURI = URI.createFileURI(args[0]);
File folder = new File(args[1]);
List<String> arguments = new ArrayList<String>();
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* Add in this list all the arguments used by the starting point of the generation
* If your main template is called on an element of your model and a String, you can
* add in "arguments" this "String" attribute.
*/
ToDOT generator = new ToDOT(modelURI, folder, arguments);
/*
* Add the properties from the launch arguments.
* If you want to programmatically add new properties, add them in "propertiesFiles"
* You can add the absolute path of a properties files, or even a project relative path.
* If you want to add another "protocol" for your properties files, please override
* "getPropertiesLoaderService(AcceleoService)" in order to return a new property loader.
* The behavior of the properties loader service is explained in the Acceleo documentation
* (Help -> Help Contents).
*/
for (int i = 2; i < args.length; i++) {
generator.addPropertiesFile(args[i]);
}
generator.doGenerate(new BasicMonitor());
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Launches the generation described by this instance.
*
* @param monitor
* This will be used to display progress information to the user.
* @throws IOException
* This will be thrown if any of the output files cannot be saved to disk.
* @generated
*/
@Override
public void doGenerate(Monitor monitor) throws IOException {
/*
* TODO if you wish to change the generation as a whole, override this. The default behavior should
* be sufficient in most cases. If you want to change the content of this method, do NOT forget to
* change the "@generated" tag in the Javadoc of this method to "@generated NOT". Without this new tag,
* any compilation of the Acceleo module with the main template that has caused the creation of this
* class will revert your modifications. If you encounter a problem with an unresolved proxy during the
* generation, you can remove the comments in the following instructions to check for problems. Please
* note that those instructions may have a significant impact on the performances.
*/
//org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
/*
* If you want to check for potential errors in your models before the launch of the generation, you
* use the code below.
*/
//if (model != null && model.eResource() != null) {
// List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
// for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
// System.err.println(diagnostic.toString());
// }
//}
super.doGenerate(monitor);
}
/**
* If this generator needs to listen to text generation events, listeners can be returned from here.
*
* @return List of listeners that are to be notified when text is generated through this launch.
* @generated
*/
@Override
public List<IAcceleoTextGenerationListener> getGenerationListeners() {
List<IAcceleoTextGenerationListener> listeners = super.getGenerationListeners();
/*
* TODO if you need to listen to generation event, add listeners to the list here. If you want to change
* the content of this method, do NOT forget to change the "@generated" tag in the Javadoc of this method
* to "@generated NOT". Without this new tag, any compilation of the Acceleo module with the main template
* that has caused the creation of this class will revert your modifications.
*/
return listeners;
}
/**
* If you need to change the way files are generated, this is your entry point.
* <p>
* The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates
* files on the fly. If you only need to preview the results, return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware of
* the running Eclipse and can be used standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical example is when you wanna
* override files that are under clear case or any other VCS that could forbid the overriding), then
* return a new {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}.
* <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return super.getGenerationStrategy();
}
/**
* This will be called in order to find and load the module that will be launched through this launcher.
* We expect this name not to contain file extension, and the module to be located beside the launcher.
*
* @return The name of the module that is to be launched.
* @generated
*/
@Override
public String getModuleName() {
return MODULE_FILE_NAME;
}
/**
* If the module(s) called by this launcher require properties files, return their qualified path from
* here.Take note that the first added properties files will take precedence over subsequent ones if they
* contain conflicting keys.
*
* @return The list of properties file we need to add to the generation context.
* @see java.util.ResourceBundle#getBundle(String)
* @generated
*/
@Override
public List<String> getProperties() {
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO if your generation module requires access to properties files, add their qualified path to the list here.
*
* Properties files can be located in an Eclipse plug-in or in the file system (all Acceleo projects are Eclipse
* plug-in). In order to use properties files located in an Eclipse plugin, you need to add the path of the properties
* files to the "propertiesFiles" list:
*
* final String prefix = "platform:/plugin/";
* final String pluginName = "org.eclipse.acceleo.module.sample";
* final String packagePath = "/org/eclipse/acceleo/module/sample/properties/";
* final String fileName = "default.properties";
* propertiesFiles.add(prefix + pluginName + packagePath + fileName);
*
* With this mechanism, you can load properties files from your plugin or from another plugin.
*
* You may want to load properties files from the file system, for that you need to add the absolute path of the file:
*
* propertiesFiles.add("C:\Users\MyName\MyFile.properties");
*
* If you want to let your users add properties files located in the same folder as the model:
*
* if (EMFPlugin.IS_ECLIPSE_RUNNING && model != null && model.eResource() != null) {
* propertiesFiles.addAll(AcceleoEngineUtils.getPropertiesFilesNearModel(model.eResource()));
* }
*
* To learn more about Properties Files, have a look at the Acceleo documentation (Help -> Help Contents).
*/
return propertiesFiles;
}
/**
* Adds a properties file in the list of properties files.
*
* @param propertiesFile
* The properties file to add.
* @generated
* @since 3.1
*/
@Override
public void addPropertiesFile(String propertiesFile) {
this.propertiesFiles.add(propertiesFile);
}
/**
* This will be used to get the list of templates that are to be launched by this launcher.
*
* @return The list of templates to call on the module {@link #getModuleName()}.
* @generated
*/
@Override
public String[] getTemplateNames() {
return TEMPLATE_NAMES;
}
/**
* This can be used to update the resource set's package registry with all needed EPackages.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated NOT
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
if (!isInWorkspace(SimplepdlPackage.class))
resourceSet.getPackageRegistry().put(
SimplepdlPackage.eNS_URI, SimplepdlPackage.eINSTANCE);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML.
*
* You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
* register is in the workspace.
*
* To register a package properly, please follow the following conventions:
*
* If the package is located in another plug-in, already installed in Eclipse. The following content should
* have been generated at the beginning of this method. Do not register the package using this mechanism if
* the metamodel is located in the workspace.
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* }
*
* If the package is located in another project in your workspace, the plugin containing the package has not
* been register by EMF and Acceleo should register it automatically. If you want to use the generator in
* stand alone, the regular registration (seen a couple lines before) is needed.
*
* To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
*/
}
/**
* This can be used to update the resource set's resource factory registry with all needed factories.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated
*/
@Override
public void registerResourceFactories(ResourceSet resourceSet) {
super.registerResourceFactories(resourceSet);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO If you need additional resource factories registrations, you can register them here. the following line
* (in comment) is an example of the resource factory registration.
*
* If you want to use the generator in stand alone, the resource factory registration will be required.
*
* To learn more about the registration of Resource Factories, have a look at the Acceleo documentation (Help -> Help Contents).
*/
// resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(XyzResource.FILE_EXTENSION, XyzResource.Factory.INSTANCE);
/*
* Some metamodels require a very complex setup for standalone usage. For example, if you want to use a generator
* targetting UML models in standalone, you NEED to use the following:
*/
// UMLResourcesUtil.init(resourceSet)
}
}

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/] [for (a : Arc | t.arcs)][if (a.outgoing) ][/if][/for]
[/template]

View file

@ -0,0 +1,29 @@
[comment encoding = UTF-8 /]
[module todot('http://simplepdl')]
[template public processToDot(aProcess : Process)]
[comment @main/]
[file (aProcess.name + '.dot', false, 'UTF-8')]
digraph "[aProcess.name/]" {
[let wss : OrderedSet(WorkSequence) = aProcess.getWSs() ]
[if (wss->size() > 0)]
[for (ws : WorkSequence | wss)]
[ws.afficher()/]
[/for]
[else]
[/if]
[/let]
}
[/file]
[/template]
[query public getWSs(p: Process) : OrderedSet(WorkSequence) =
p.processElements
->select( e | e.oclIsTypeOf(WorkSequence) )
->collect( e | e.oclAsType(WorkSequence) )
->asOrderedSet()
/]
[template public afficher(ws : WorkSequence) post (trim()) ]
"[ws.predecessor.name/]" -> "[ws.successor.name/]" ['['/]arrowhead=vee label=[ws.linkType/][']'/]
[/template]

View file

@ -0,0 +1,11 @@
<head><title>developpement</title></head>
<body>
<h1>Process "developpement"</h1>
<h2>Work definitions</h2>
<ul>
<li>Conception</li>
<li>RedactionDoc requires Conception to be finished, Conception to be started.</li>
<li>Programmation requires Conception to be finished.</li>
<li>RedactionTests requires Conception to be started, Programmation to be finished.</li>
</ul>
</body>

View file

@ -0,0 +1,11 @@
<head><title>developpement</title></head>
<body>
<h1>Process "developpement"</h1>
<h2>Work definitions</h2>
<ul>
<li>Conception</li>
<li>RedactionDoc requires Conception to be finished, Conception to be started.</li>
<li>Programmation requires Conception to be finished.</li>
<li>RedactionTests requires Conception to be started, Programmation to be finished.</li>
</ul>
</body>

View file

@ -0,0 +1,28 @@
[comment encoding = UTF-8 /]
[module todot('http://simplepdl')]
[template public processToDot(aProcess : Process)]
[comment @main/]
[file (aProcess.name + '.dot', false, 'UTF-8')]
digraph "[aProcess.name/]" {
[let wss : OrderedSet(WorkSequence) = aProcess.getWSs() ]
[if (wss->size() > 0)]
[for (ws : WorkSequence | wss)]
[ws.afficher()/]
[/for]
[else]
[/if]
[/let]
}
[/file]
[/template]
[query public getWSs(p: Process) : OrderedSet(WorkSequence) =
p.processElements->select( e | e.oclIsTypeOf(WorkSequence) )
->collect( e | e.oclAsType(WorkSequence) )
->asOrderedSet()
/]
[template public afficher(ws : WorkSequence) post (trim()) ]
"[ws.predecessor.name/]" -> "[ws.successor.name/]" ['['/]arrowhead=vee label=[ws.linkType/][']'/]
[/template]

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/] [for (a : Arc | t.Arcs())][if (a.isOutgoing()) ][/if][/for]
[/template]

View file

@ -0,0 +1,7 @@
digraph "developpement" {
"Conception" -> "RedactionDoc" [arrowhead=vee label=finishToFinish]
"Conception" -> "RedactionDoc" [arrowhead=vee label=startToStart]
"Conception" -> "Programmation" [arrowhead=vee label=finishToStart]
"Conception" -> "RedactionTests" [arrowhead=vee label=startToStart]
"Programmation" -> "RedactionTests" [arrowhead=vee label=finishToFinish]
}

View file

@ -0,0 +1,23 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Acceleo ToTINA Module Runtime Plug-in
Bundle-SymbolicName: fr.n7.petrinet.toTINA
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: fr.n7.petrinet.toTINA.Activator
Bundle-Vendor: Eclipse Modeling Project
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.xmi,
org.eclipse.ocl,
org.eclipse.ocl.ecore,
org.eclipse.acceleo.common;bundle-version="3.3.0",
org.eclipse.acceleo.model;bundle-version="3.3.0",
org.eclipse.acceleo.profiler;bundle-version="3.3.0",
org.eclipse.acceleo.engine;bundle-version="3.3.0",
com.google.guava
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Export-Package: fr.n7.petrinet.toTINA.main

View file

@ -0,0 +1,418 @@
/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package fr.n7.petrinet.toTINA.main;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener;
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy;
import org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import petrinet.PetrinetPackage;
import simplepdl.SimplepdlPackage;
/**
* Entry point of the 'ToTINA' generation module.
*
* @generated
*/
public class ToTINA extends AbstractAcceleoGenerator {
/**
* The name of the module.
*
* @generated
*/
public static final String MODULE_FILE_NAME = "/fr/n7/petrinet/toTINA/main/toTINA";
/**
* The name of the templates that are to be generated.
*
* @generated
*/
public static final String[] TEMPLATE_NAMES = { "networkToTINA" };
/**
* The list of properties files from the launch parameters (Launch configuration).
*
* @generated
*/
private List<String> propertiesFiles = new ArrayList<String>();
/**
* Allows the public constructor to be used. Note that a generator created
* this way cannot be used to launch generations before one of
* {@link #initialize(EObject, File, List)} or
* {@link #initialize(URI, File, List)} is called.
* <p>
* The main reason for this constructor is to allow clients of this
* generation to call it from another Java file, as it allows for the
* retrieval of {@link #getProperties()} and
* {@link #getGenerationListeners()}.
* </p>
*
* @generated
*/
public ToTINA() {
// Empty implementation
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param modelURI
* URI where the model on which this generator will be used is located.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
* the model cannot be loaded.
* @generated
*/
public ToTINA(URI modelURI, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(modelURI, targetFolder, arguments);
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param model
* We'll iterate over the content of this element to find Objects matching the first parameter
* of the template we need to call.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
* @generated
*/
public ToTINA(EObject model, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(model, targetFolder, arguments);
}
/**
* This can be used to launch the generation from a standalone application.
*
* @param args
* Arguments of the generation.
* @generated
*/
public static void main(String[] args) {
try {
if (args.length < 2) {
System.out.println("Arguments not valid : {model, folder}.");
} else {
URI modelURI = URI.createFileURI(args[0]);
File folder = new File(args[1]);
List<String> arguments = new ArrayList<String>();
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* Add in this list all the arguments used by the starting point of the generation
* If your main template is called on an element of your model and a String, you can
* add in "arguments" this "String" attribute.
*/
ToTINA generator = new ToTINA(modelURI, folder, arguments);
/*
* Add the properties from the launch arguments.
* If you want to programmatically add new properties, add them in "propertiesFiles"
* You can add the absolute path of a properties files, or even a project relative path.
* If you want to add another "protocol" for your properties files, please override
* "getPropertiesLoaderService(AcceleoService)" in order to return a new property loader.
* The behavior of the properties loader service is explained in the Acceleo documentation
* (Help -> Help Contents).
*/
for (int i = 2; i < args.length; i++) {
generator.addPropertiesFile(args[i]);
}
generator.doGenerate(new BasicMonitor());
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Launches the generation described by this instance.
*
* @param monitor
* This will be used to display progress information to the user.
* @throws IOException
* This will be thrown if any of the output files cannot be saved to disk.
* @generated
*/
@Override
public void doGenerate(Monitor monitor) throws IOException {
/*
* TODO if you wish to change the generation as a whole, override this. The default behavior should
* be sufficient in most cases. If you want to change the content of this method, do NOT forget to
* change the "@generated" tag in the Javadoc of this method to "@generated NOT". Without this new tag,
* any compilation of the Acceleo module with the main template that has caused the creation of this
* class will revert your modifications. If you encounter a problem with an unresolved proxy during the
* generation, you can remove the comments in the following instructions to check for problems. Please
* note that those instructions may have a significant impact on the performances.
*/
//org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
/*
* If you want to check for potential errors in your models before the launch of the generation, you
* use the code below.
*/
//if (model != null && model.eResource() != null) {
// List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
// for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
// System.err.println(diagnostic.toString());
// }
//}
super.doGenerate(monitor);
}
/**
* If this generator needs to listen to text generation events, listeners can be returned from here.
*
* @return List of listeners that are to be notified when text is generated through this launch.
* @generated
*/
@Override
public List<IAcceleoTextGenerationListener> getGenerationListeners() {
List<IAcceleoTextGenerationListener> listeners = super.getGenerationListeners();
/*
* TODO if you need to listen to generation event, add listeners to the list here. If you want to change
* the content of this method, do NOT forget to change the "@generated" tag in the Javadoc of this method
* to "@generated NOT". Without this new tag, any compilation of the Acceleo module with the main template
* that has caused the creation of this class will revert your modifications.
*/
return listeners;
}
/**
* If you need to change the way files are generated, this is your entry point.
* <p>
* The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates
* files on the fly. If you only need to preview the results, return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware of
* the running Eclipse and can be used standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical example is when you wanna
* override files that are under clear case or any other VCS that could forbid the overriding), then
* return a new {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}.
* <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return super.getGenerationStrategy();
}
/**
* This will be called in order to find and load the module that will be launched through this launcher.
* We expect this name not to contain file extension, and the module to be located beside the launcher.
*
* @return The name of the module that is to be launched.
* @generated
*/
@Override
public String getModuleName() {
return MODULE_FILE_NAME;
}
/**
* If the module(s) called by this launcher require properties files, return their qualified path from
* here.Take note that the first added properties files will take precedence over subsequent ones if they
* contain conflicting keys.
*
* @return The list of properties file we need to add to the generation context.
* @see java.util.ResourceBundle#getBundle(String)
* @generated
*/
@Override
public List<String> getProperties() {
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO if your generation module requires access to properties files, add their qualified path to the list here.
*
* Properties files can be located in an Eclipse plug-in or in the file system (all Acceleo projects are Eclipse
* plug-in). In order to use properties files located in an Eclipse plugin, you need to add the path of the properties
* files to the "propertiesFiles" list:
*
* final String prefix = "platform:/plugin/";
* final String pluginName = "org.eclipse.acceleo.module.sample";
* final String packagePath = "/org/eclipse/acceleo/module/sample/properties/";
* final String fileName = "default.properties";
* propertiesFiles.add(prefix + pluginName + packagePath + fileName);
*
* With this mechanism, you can load properties files from your plugin or from another plugin.
*
* You may want to load properties files from the file system, for that you need to add the absolute path of the file:
*
* propertiesFiles.add("C:\Users\MyName\MyFile.properties");
*
* If you want to let your users add properties files located in the same folder as the model:
*
* if (EMFPlugin.IS_ECLIPSE_RUNNING && model != null && model.eResource() != null) {
* propertiesFiles.addAll(AcceleoEngineUtils.getPropertiesFilesNearModel(model.eResource()));
* }
*
* To learn more about Properties Files, have a look at the Acceleo documentation (Help -> Help Contents).
*/
return propertiesFiles;
}
/**
* Adds a properties file in the list of properties files.
*
* @param propertiesFile
* The properties file to add.
* @generated
* @since 3.1
*/
@Override
public void addPropertiesFile(String propertiesFile) {
this.propertiesFiles.add(propertiesFile);
}
/**
* This will be used to get the list of templates that are to be launched by this launcher.
*
* @return The list of templates to call on the module {@link #getModuleName()}.
* @generated
*/
@Override
public String[] getTemplateNames() {
return TEMPLATE_NAMES;
}
/**
* This can be used to update the resource set's package registry with all needed EPackages.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated NOT
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
if (!isInWorkspace(PetrinetPackage.class))
resourceSet.getPackageRegistry().put(
PetrinetPackage.eNS_URI, PetrinetPackage.eINSTANCE);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML.
*
* You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
* register is in the workspace.
*
* To register a package properly, please follow the following conventions:
*
* If the package is located in another plug-in, already installed in Eclipse. The following content should
* have been generated at the beginning of this method. Do not register the package using this mechanism if
* the metamodel is located in the workspace.
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* }
*
* If the package is located in another project in your workspace, the plugin containing the package has not
* been register by EMF and Acceleo should register it automatically. If you want to use the generator in
* stand alone, the regular registration (seen a couple lines before) is needed.
*
* To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
*/
}
/**
* This can be used to update the resource set's resource factory registry with all needed factories.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated
*/
@Override
public void registerResourceFactories(ResourceSet resourceSet) {
super.registerResourceFactories(resourceSet);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO If you need additional resource factories registrations, you can register them here. the following line
* (in comment) is an example of the resource factory registration.
*
* If you want to use the generator in stand alone, the resource factory registration will be required.
*
* To learn more about the registration of Resource Factories, have a look at the Acceleo documentation (Help -> Help Contents).
*/
// resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(XyzResource.FILE_EXTENSION, XyzResource.Factory.INSTANCE);
/*
* Some metamodels require a very complex setup for standalone usage. For example, if you want to use a generator
* targetting UML models in standalone, you NEED to use the following:
*/
// UMLResourcesUtil.init(resourceSet)
}
}

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
tr [t.name/]
[/template]

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/] [for (a : Arc | t.getArcs())][if (a.isOutgoing()) ][/if][/for]
[/template]

View file

@ -0,0 +1,12 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net "[aNetwork.name/]"
[/file]
[/template]

View file

@ -0,0 +1,412 @@
/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package fr.n7.simplepdl.toHTML.main;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener;
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy;
import org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* Entry point of the 'ToHTML' generation module.
*
* @generated
*/
public class ToHTML extends AbstractAcceleoGenerator {
/**
* The name of the module.
*
* @generated
*/
public static final String MODULE_FILE_NAME = "/fr/n7/simplepdl/toHTML/main/toHTML";
/**
* The name of the templates that are to be generated.
*
* @generated
*/
public static final String[] TEMPLATE_NAMES = { "processToHTML" };
/**
* The list of properties files from the launch parameters (Launch configuration).
*
* @generated
*/
private List<String> propertiesFiles = new ArrayList<String>();
/**
* Allows the public constructor to be used. Note that a generator created
* this way cannot be used to launch generations before one of
* {@link #initialize(EObject, File, List)} or
* {@link #initialize(URI, File, List)} is called.
* <p>
* The main reason for this constructor is to allow clients of this
* generation to call it from another Java file, as it allows for the
* retrieval of {@link #getProperties()} and
* {@link #getGenerationListeners()}.
* </p>
*
* @generated
*/
public ToHTML() {
// Empty implementation
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param modelURI
* URI where the model on which this generator will be used is located.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
* the model cannot be loaded.
* @generated
*/
public ToHTML(URI modelURI, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(modelURI, targetFolder, arguments);
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param model
* We'll iterate over the content of this element to find Objects matching the first parameter
* of the template we need to call.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
* @generated
*/
public ToHTML(EObject model, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(model, targetFolder, arguments);
}
/**
* This can be used to launch the generation from a standalone application.
*
* @param args
* Arguments of the generation.
* @generated
*/
public static void main(String[] args) {
try {
if (args.length < 2) {
System.out.println("Arguments not valid : {model, folder}.");
} else {
URI modelURI = URI.createFileURI(args[0]);
File folder = new File(args[1]);
List<String> arguments = new ArrayList<String>();
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* Add in this list all the arguments used by the starting point of the generation
* If your main template is called on an element of your model and a String, you can
* add in "arguments" this "String" attribute.
*/
ToHTML generator = new ToHTML(modelURI, folder, arguments);
/*
* Add the properties from the launch arguments.
* If you want to programmatically add new properties, add them in "propertiesFiles"
* You can add the absolute path of a properties files, or even a project relative path.
* If you want to add another "protocol" for your properties files, please override
* "getPropertiesLoaderService(AcceleoService)" in order to return a new property loader.
* The behavior of the properties loader service is explained in the Acceleo documentation
* (Help -> Help Contents).
*/
for (int i = 2; i < args.length; i++) {
generator.addPropertiesFile(args[i]);
}
generator.doGenerate(new BasicMonitor());
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Launches the generation described by this instance.
*
* @param monitor
* This will be used to display progress information to the user.
* @throws IOException
* This will be thrown if any of the output files cannot be saved to disk.
* @generated
*/
@Override
public void doGenerate(Monitor monitor) throws IOException {
/*
* TODO if you wish to change the generation as a whole, override this. The default behavior should
* be sufficient in most cases. If you want to change the content of this method, do NOT forget to
* change the "@generated" tag in the Javadoc of this method to "@generated NOT". Without this new tag,
* any compilation of the Acceleo module with the main template that has caused the creation of this
* class will revert your modifications. If you encounter a problem with an unresolved proxy during the
* generation, you can remove the comments in the following instructions to check for problems. Please
* note that those instructions may have a significant impact on the performances.
*/
//org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
/*
* If you want to check for potential errors in your models before the launch of the generation, you
* use the code below.
*/
//if (model != null && model.eResource() != null) {
// List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
// for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
// System.err.println(diagnostic.toString());
// }
//}
super.doGenerate(monitor);
}
/**
* If this generator needs to listen to text generation events, listeners can be returned from here.
*
* @return List of listeners that are to be notified when text is generated through this launch.
* @generated
*/
@Override
public List<IAcceleoTextGenerationListener> getGenerationListeners() {
List<IAcceleoTextGenerationListener> listeners = super.getGenerationListeners();
/*
* TODO if you need to listen to generation event, add listeners to the list here. If you want to change
* the content of this method, do NOT forget to change the "@generated" tag in the Javadoc of this method
* to "@generated NOT". Without this new tag, any compilation of the Acceleo module with the main template
* that has caused the creation of this class will revert your modifications.
*/
return listeners;
}
/**
* If you need to change the way files are generated, this is your entry point.
* <p>
* The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates
* files on the fly. If you only need to preview the results, return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware of
* the running Eclipse and can be used standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical example is when you wanna
* override files that are under clear case or any other VCS that could forbid the overriding), then
* return a new {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}.
* <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return super.getGenerationStrategy();
}
/**
* This will be called in order to find and load the module that will be launched through this launcher.
* We expect this name not to contain file extension, and the module to be located beside the launcher.
*
* @return The name of the module that is to be launched.
* @generated
*/
@Override
public String getModuleName() {
return MODULE_FILE_NAME;
}
/**
* If the module(s) called by this launcher require properties files, return their qualified path from
* here.Take note that the first added properties files will take precedence over subsequent ones if they
* contain conflicting keys.
*
* @return The list of properties file we need to add to the generation context.
* @see java.util.ResourceBundle#getBundle(String)
* @generated
*/
@Override
public List<String> getProperties() {
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO if your generation module requires access to properties files, add their qualified path to the list here.
*
* Properties files can be located in an Eclipse plug-in or in the file system (all Acceleo projects are Eclipse
* plug-in). In order to use properties files located in an Eclipse plugin, you need to add the path of the properties
* files to the "propertiesFiles" list:
*
* final String prefix = "platform:/plugin/";
* final String pluginName = "org.eclipse.acceleo.module.sample";
* final String packagePath = "/org/eclipse/acceleo/module/sample/properties/";
* final String fileName = "default.properties";
* propertiesFiles.add(prefix + pluginName + packagePath + fileName);
*
* With this mechanism, you can load properties files from your plugin or from another plugin.
*
* You may want to load properties files from the file system, for that you need to add the absolute path of the file:
*
* propertiesFiles.add("C:\Users\MyName\MyFile.properties");
*
* If you want to let your users add properties files located in the same folder as the model:
*
* if (EMFPlugin.IS_ECLIPSE_RUNNING && model != null && model.eResource() != null) {
* propertiesFiles.addAll(AcceleoEngineUtils.getPropertiesFilesNearModel(model.eResource()));
* }
*
* To learn more about Properties Files, have a look at the Acceleo documentation (Help -> Help Contents).
*/
return propertiesFiles;
}
/**
* Adds a properties file in the list of properties files.
*
* @param propertiesFile
* The properties file to add.
* @generated
* @since 3.1
*/
@Override
public void addPropertiesFile(String propertiesFile) {
this.propertiesFiles.add(propertiesFile);
}
/**
* This will be used to get the list of templates that are to be launched by this launcher.
*
* @return The list of templates to call on the module {@link #getModuleName()}.
* @generated
*/
@Override
public String[] getTemplateNames() {
return TEMPLATE_NAMES;
}
/**
* This can be used to update the resource set's package registry with all needed EPackages.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML.
*
* You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
* register is in the workspace.
*
* To register a package properly, please follow the following conventions:
*
* If the package is located in another plug-in, already installed in Eclipse. The following content should
* have been generated at the beginning of this method. Do not register the package using this mechanism if
* the metamodel is located in the workspace.
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* }
*
* If the package is located in another project in your workspace, the plugin containing the package has not
* been register by EMF and Acceleo should register it automatically. If you want to use the generator in
* stand alone, the regular registration (seen a couple lines before) is needed.
*
* To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
*/
}
/**
* This can be used to update the resource set's resource factory registry with all needed factories.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated
*/
@Override
public void registerResourceFactories(ResourceSet resourceSet) {
super.registerResourceFactories(resourceSet);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO If you need additional resource factories registrations, you can register them here. the following line
* (in comment) is an example of the resource factory registration.
*
* If you want to use the generator in stand alone, the resource factory registration will be required.
*
* To learn more about the registration of Resource Factories, have a look at the Acceleo documentation (Help -> Help Contents).
*/
// resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(XyzResource.FILE_EXTENSION, XyzResource.Factory.INSTANCE);
/*
* Some metamodels require a very complex setup for standalone usage. For example, if you want to use a generator
* targetting UML models in standalone, you NEED to use the following:
*/
// UMLResourcesUtil.init(resourceSet)
}
}

View file

@ -0,0 +1,26 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]

View file

@ -0,0 +1,19 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net [aNetwork.name/]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/] [for (a : Arc | t.arcs)][if (not a.outgoing)][a.target.name/]*[a.weight/] [/if][/for]-> [for (a : Arc | t.arcs)][if (a.outgoing)][a.target.name/]*[a.weight/][/if][/for]
[/template]

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.net', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[comment][let outgoing = t.getArcs()->select( e | e.isOutgoing() ) /][/comment]
tr [t.name/] [for (a : Arc | t.arcs)][if (not a.outgoing)][a.target.name/]*[a.weight/] [/if][/for]-> [for (a : Arc | t.arcs)][if (a.outgoing)][a.target.name/]*[a.weight/][/if][/for]
[/template]

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="fr.n7.simplepdl.feature"
label="simplepdl plugin"
version="1.0.0.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<plugin
id="fr.n7.simplepdl.editor"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.simplepdl.edit"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.simplepdl"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.simplepdl.tests"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.simplepdl.toHTML"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.simplepdl.toHTML.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -0,0 +1,45 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net [aNetwork.name/]
[let places : OrderedSet(Place) = aNetwork.getPlaces() ]
[if (places->size() > 0)]
[for (place : Place | places)]
pl [place.name/] ([place.tokens/])
[/for]
[else]
[/if]
[/let]
[let transitions : OrderedSet(Transition) = aNetwork.getTransitions() ]
[if (transitions->size() > 0)]
[for (transition : Transition | transitions)]
[transition.afficher()/]
[/for]
[else]
[/if]
[/let]
[/file]
[/template]
[query public getPlaces(n: Network) : OrderedSet(Place) =
n.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]
[query public getTransitions(n: Network) : OrderedSet(Transition) =
n.nodes
->select( e | e.oclIsTypeOf(Transition) )
->collect( e | e.oclAsType(Transition) )
->asOrderedSet()
/]
[template public afficher(t : Transition) post (trim()) ]
[let outgoing : t.getArcs()->select( e | e.isOutgoing() ) ]
tr [t.name/]
[/template]

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="fr.n7.simplepdl.feature"
label="simplepdl plugin"
version="1.0.0.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<plugin
id="fr.n7.simplepdl.editor"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.simplepdl.edit"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.simplepdl"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="fr.n7.simplepdl.tests"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -0,0 +1,19 @@
[comment encoding = UTF-8 /]
[module toTINA('http://petrinet')]
[template public networkToTINA(aNetwork : Network)]
[comment @main/]
[file (aNetwork.name + '.tina', false, 'UTF-8')]
net [aNetwork.name/]
[/file]
[/template]
[query public getPlaces(p: Network) : OrderedSet(Place) =
p.nodes
->select( e | e.oclIsTypeOf(Place) )
->collect( e | e.oclAsType(Place) )
->asOrderedSet()
/]

Some files were not shown because too many files have changed in this diff Show more