Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugins/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Binary file not shown.
15 changes: 15 additions & 0 deletions plugins/de.cognicrypt.order.editor/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="src" path="config"/>
<classpathentry kind="src" path="output"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.emf.mwe2.launch.Mwe2LaunchConfigurationType">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/de.cognicrypt.order.editor"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/de.cognicrypt.order.editor&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/de.cognicrypt.order.editor.ide&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/de.cognicrypt.order.editor.ui&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/de.cognicrypt.order.editor.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/de.cognicrypt.order.editor.ui.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/de.cognicrypt.order.editor.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/de.cognicrypt.order.editor.ui.tests&quot; type=&quot;4&quot;/&gt;&#10;;&lt;/resources&gt;}"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="de.cognicrypt.order.editor.GenerateStatemachine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="de.cognicrypt.order.editor"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
<booleanAttribute key="append.args" value="true"/>
<booleanAttribute key="askclear" value="true"/>
<booleanAttribute key="automaticAdd" value="true"/>
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bad_container_name" value="/de.cognicrypt.order.editor/.launch/"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="true"/>
<booleanAttribute key="clearws" value="false"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Launch Runtime Eclipse"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../runtime-EclipseXtext"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
<booleanAttribute key="useProduct" value="true"/>
<booleanAttribute key="usefeatures" value="false"/>
</launchConfiguration>
34 changes: 34 additions & 0 deletions plugins/de.cognicrypt.order.editor/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>de.cognicrypt.order.editor</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=windows-1252
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
53 changes: 53 additions & 0 deletions plugins/de.cognicrypt.order.editor/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Order Editor
Bundle-Activator: de.cognicrypt.order.editor.Activator
Bundle-Vendor: Technical University Darmstadt, Paderborn University
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: de.cognicrypt.order.editor; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xtext,
org.eclipse.xtext.xbase,
org.eclipse.equinox.common;bundle-version="3.5.0",
org.eclipse.emf.ecore,
org.eclipse.xtext.common.types,
org.eclipse.xtext.xbase.lib;bundle-version="2.14.0",
org.objectweb.asm;bundle-version="[7.2.0,7.3.0)";resolution:=optional,
org.eclipse.xtext.util,
org.eclipse.emf.common,
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)",
org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.emf.mwe2.launch;bundle-version="2.11.2",
org.eclipse.emf.mwe2.runtime;bundle-version="2.11.2",
org.eclipse.xtext.generator,
org.eclipse.xtext.common.types.ui,
org.apache.log4j,
org.apache.commons.logging,
de.cognicrypt.codegenerator;bundle-version="1.0.0",
de.cognicrypt.core,
org.eclipse.ui.workbench,
com.google.gson,
com.google.guava,
org.junit,
de.darmstadt.tu.crossing.CrySL
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: lib/claferchocoig.jar,
lib/dom4j-2.0.0.jar,
.
Export-Package: de.cognicrypt.order.editor.services,
de.cognicrypt.order.editor.parser.antlr,
de.cognicrypt.order.editor,
de.cognicrypt.order.editor.statemachine,
de.cognicrypt.order.editor.statemachine.impl,
de.cognicrypt.order.editor.scoping,
de.cognicrypt.order.editor.serializer,
de.cognicrypt.order.editor.statemachine.util,
de.cognicrypt.order.editor.parser.antlr.internal,
de.cognicrypt.order.editor.validation,
de.cognicrypt.order.editor.generator,
.
Import-Package: org.apache.log4j,
org.eclipse.core.resources,
org.eclipse.jdt.core.dom
Automatic-Module-Name: de.cognicrypt.order.editor
31 changes: 31 additions & 0 deletions plugins/de.cognicrypt.order.editor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CrySL Visual Order Editor

The Order Editor displays the usage pattern of the class as defined in the Order expression of its CrySL rule as a state machine.

More detailed documentation on the use of this feature can be found in the document
"CogniCrypt\plugins\de.cognicrypt.order.editor\doc\CrySL Visual Order Editor � User Manual.pdf".


## Set up

* Clone the project, open Eclipse.
* Clone the [**Crypto-API-Rules**](https://github.com/CROSSINGTUD/Crypto-API-Rules) repository to a folder named "git" in your home directory.
This is required since the class StaxWriter which writes the configuration file needs to access this different repository and therefore accesses the paths relative to home directory by e.g. "<home-dir>\\git\\Crypto-API-Rules\\JavaCryptographicArchitecture\\src".
* Install Sirius (http://www.eclipse.org/sirius) from the Eclipse Marketplace.

## Create a diagram

* Launch a new runtime from your Eclipse. Click on the black plugin icon "S" in the upper left corner, next to the other buttons for TaskIntegrator and CogniCrypt,
then click on the button "Generate Statemachine Models", which is currently a simple button but should later be replaced by a single crysl rule selection. The
button triggers the generation of the statemachine model resources into the output folder, i.e., "de.cognicrypt.order.editor\output".
* Within the runtime environment, select the Sirius perspective. This opens a model explorer in the left corner.
* Open the Sirius project contained in the plugin relative sirius
folder, i.e. "CogniCrypt\plugins\de.cognicrypt.order.editor\sirius".
The project folder "~\CogniCrypt\plugins\de.cognicrypt.order.editor\sirius\my.project.design"
is the Viewpoint Specification Project containing the .odesign file (definition of the modeling workbench), the other project folder
"~\CogniCrypt\plugins\de.cognicrypt.order.editor\sirius\my.project.order.diagram.modeling" is the Modeling project containing the graphical representations created with Sirius.
* To open a diagram, select the file representations.aird from the modeling project.
In the left corner of the new window, named "Models", click on Add > Browse File System
to select a statemachine model from the plugin-relative output folder. The model will
appear in the Models window. Now double click "orderDiagram" below "orderViewpoint" in the Representations window on the right. This opens a new window "Create a new representation" which allows to select a semantic element for a new representation. Here, you can select the model you just added, click on its "Statemachine" model identifier and click on Finish. You can optionally type a custom name for the diagram. The representation is opened now and you can play around with the Sirius model editor features to enhace the representation.
* For more information on Sirius, have a look at their [**tutorial**](https://wiki.eclipse.org/Sirius/Tutorials/StarterTutorial).
7 changes: 7 additions & 0 deletions plugins/de.cognicrypt.order.editor/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source.. = src/,\
src-gen/,\
xtend-gen/
bin.includes = model/generated/,\
.,\
META-INF/,\
plugin.xml
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="statemachine" nsURI="http://www.cognicrypt.de/order/editor/Statemachine"
nsPrefix="statemachine">
<eClassifiers xsi:type="ecore:EClass" name="Statemachine">
<eStructuralFeatures xsi:type="ecore:EReference" name="states" upperBound="-1"
eType="#//State" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="transitions" upperBound="-1"
eType="#//Transition" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="State">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isFinal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="transitions" upperBound="-1"
eType="#//Transition" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Transition">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="fromState" eType="#//State"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="event" eType="#//Event"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="endState" eType="#//State"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Event">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext 2.25.0" modelDirectory="/de.cognicrypt.order.editor/src-gen"
modelPluginID="de.cognicrypt.order.editor" forceOverwrite="true" modelName="Statemachine"
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
complianceLevel="8.0" copyrightFields="false" runtimeVersion="2.20">
<genPackages prefix="Statemachine" basePackage="de.cognicrypt.order.editor" disposableProviderFactory="true"
fileExtensions="statemachine" ecorePackage="Statemachine.ecore#/">
<genClasses ecoreClass="Statemachine.ecore#//Statemachine">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Statemachine.ecore#//Statemachine/states"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Statemachine.ecore#//Statemachine/transitions"/>
</genClasses>
<genClasses ecoreClass="Statemachine.ecore#//State">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Statemachine.ecore#//State/name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Statemachine.ecore#//State/isFinal"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Statemachine.ecore#//State/transitions"/>
</genClasses>
<genClasses ecoreClass="Statemachine.ecore#//Transition">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Statemachine.ecore#//Transition/name"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Statemachine.ecore#//Transition/fromState"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Statemachine.ecore#//Transition/event"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Statemachine.ecore#//Transition/endState"/>
</genClasses>
<genClasses ecoreClass="Statemachine.ecore#//Event">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Statemachine.ecore#//Event/name"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
50 changes: 50 additions & 0 deletions plugins/de.cognicrypt.order.editor/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="windows-1252"?>
<?eclipse version="3.0"?>
<plugin>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.cognicrypt.de/order/editor/Statemachine"
class = "de.cognicrypt.order.editor.statemachine.StatemachinePackage"
genModel = "model/generated/Statemachine.genmodel" />
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup:de.cognicrypt.core.menu">
<command
commandId="de.cognicrypt.order.editor.runordereditor"
icon="icons/icon_order_editor.png"
label="Run CogniCrypt Order Editor"
style="push">
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="de.cognicrypt.order.editor.actions.RunOrderEditorHandler"
id="de.cognicrypt.order.editor.runordereditor"
name="RunOrderEditor">
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
id="de.cognicrypt.toolbar"
label="CogniCrypt">
<command
commandId="de.cognicrypt.order.editor.runordereditor"
icon="icons/icon_order_editor.png"
label="RunOrderEditorToolBar"
style="push"
tooltip="Open Visual Order Editor">
</command>
</toolbar>
</menuContribution>
</extension>
</plugin>

10 changes: 10 additions & 0 deletions plugins/de.cognicrypt.order.editor/plugin.xml_gen
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="windows-1252"?>
<?eclipse version="3.0"?>
<plugin>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.cognicrypt.de/order/editor/Statemachine"
class = "de.cognicrypt.order.editor.statemachine.StatemachinePackage"
genModel = "model/generated/Statemachine.genmodel" />
</extension>
</plugin>
Loading