Skip to content

Commit

Permalink
migrated to Xtext/Xbase 2.4.2 and latest Kieler - imports TBD
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Koehnlein committed Jun 22, 2013
1 parent d563ab3 commit 3c8f3e3
Show file tree
Hide file tree
Showing 225 changed files with 75,110 additions and 62,853 deletions.
Expand Up @@ -6,4 +6,4 @@ Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Eclipse Modeling Project
Fragment-Host: org.eclipse.xtext.example.domainmodel.ui;bundle-version="2.2.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.xtext.graphview;bundle-version="1.0.0"
Require-Bundle: org.eclipse.xtext.graphview.providers;bundle-version="1.0.0"
Expand Up @@ -4,7 +4,7 @@
<extension
point="org.eclipse.xtext.graphview.selectionStrategy">
<strategy
class="org.eclipse.xtext.example.domainmodel.ui.DomainmodelExecutableExtensionFactory:org.eclipse.xtext.graphview.view.selection.XtextEditorSelectionStrategy">
class="org.eclipse.xtext.example.domainmodel.ui.DomainmodelExecutableExtensionFactory:org.eclipse.xtext.graphview.providers.XtextEditorSelectionStrategy">
</strategy>
</extension>
</fragment>
Expand Up @@ -6,4 +6,4 @@ Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Eclipse Modeling Project
Fragment-Host: org.eclipse.xtext.example.fowlerdsl.ui;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.xtext.graphview;bundle-version="1.0.0"
Require-Bundle: org.eclipse.xtext.graphview.providers;bundle-version="1.0.0"
2 changes: 1 addition & 1 deletion org.eclipse.xtext.example.fowlerdsl.graphview/fragment.xml
Expand Up @@ -4,7 +4,7 @@
<extension
point="org.eclipse.xtext.graphview.selectionStrategy">
<strategy
class="org.eclipse.xtext.example.fowlerdsl.ui.StatemachineExecutableExtensionFactory:org.eclipse.xtext.graphview.view.selection.XtextEditorSelectionStrategy">
class="org.eclipse.xtext.example.fowlerdsl.ui.StatemachineExecutableExtensionFactory:org.eclipse.xtext.graphview.providers.XtextEditorSelectionStrategy">
</strategy>
</extension>
</fragment>
2 changes: 1 addition & 1 deletion org.eclipse.xtext.graphview.example/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
Expand Down
4 changes: 3 additions & 1 deletion org.eclipse.xtext.graphview.example/META-INF/MANIFEST.MF
Expand Up @@ -8,4 +8,6 @@ Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.6.1",
org.eclipse.xtext.xbase.lib;bundle-version="2.0.0",
org.eclipse.xtext.example.fowlerdsl;bundle-version="1.0.0",
org.eclipse.xtext.example.domainmodel;bundle-version="2.2.0",
org.eclipse.xtext.graphview;bundle-version="1.0.0"
org.eclipse.xtext.graphview.lib;bundle-version="1.0.0",
org.eclipse.xtext.common.types;bundle-version="2.4.2"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
1 change: 1 addition & 0 deletions org.eclipse.xtext.graphview.example/src-gen/.gitignore
@@ -0,0 +1 @@
/MrsGrantsSecretCompartments.java
3 changes: 3 additions & 0 deletions org.eclipse.xtext.graphview.example/src-gen/base/.gitignore
@@ -0,0 +1,3 @@
/Address.java
/Person.java
/Phone.java
Expand Up @@ -3,6 +3,7 @@
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.util.ToStringHelper;

@SuppressWarnings("all")
public class Address {
public Address() {
}
Expand Down
Expand Up @@ -6,6 +6,7 @@
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.util.ToStringHelper;

@SuppressWarnings("all")
public class Person {
public Person() {
}
Expand Down
Expand Up @@ -3,6 +3,7 @@
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.util.ToStringHelper;

@SuppressWarnings("all")
public class Phone {
public Phone() {
}
Expand Down
@@ -0,0 +1,2 @@
/Boss.java
/Employee.java
Expand Up @@ -4,6 +4,7 @@
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.util.ToStringHelper;

@SuppressWarnings("all")
public class Boss extends Person {
public Boss() {
}
Expand Down
Expand Up @@ -5,6 +5,7 @@
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.util.ToStringHelper;

@SuppressWarnings("all")
public class Employee extends Person {
public Employee() {
}
Expand Down
@@ -0,0 +1,2 @@
/Customer.java
/Order.java
Expand Up @@ -9,6 +9,7 @@
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.util.ToStringHelper;

@SuppressWarnings("all")
public class Customer extends Person {
public Customer() {
}
Expand Down
Expand Up @@ -3,6 +3,7 @@
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.util.ToStringHelper;

@SuppressWarnings("all")
public class Order {
public Order() {
}
Expand Down
@@ -1,4 +1,5 @@
import java.util.*
import base.Person
import java.util.List

package base {
entity Person {
Expand Down
@@ -1,5 +1,5 @@
import org.eclipse.xtext.graphview.shape.*
import org.eclipse.xtext.graphview.behavior.layout.*
import org.eclipse.xtext.graphview.lib.shape.*
import org.eclipse.xtext.graphview.lib.layout.*
import org.eclipse.draw2d.*
import org.eclipse.swt.SWT
import DomainmodelEntityDiagram.*
Expand All @@ -10,12 +10,12 @@ style DomainmodelEntityDiagram {
autoLayoutManager = new KielerAutoLayout
}

style EntityNode.Name {
style DomainmodelEntityDiagram.EntityNode.Name {
font = font("Helvetica", 13, SWT::BOLD)
text = element.simpleName
}

style EntityNode.Operations.Label {
style DomainmodelEntityDiagram.EntityNode.Operations.Label {
text = (element.simpleName
+ '('
+ element.parameters.map[it.parameterType.simpleName].join(', ') + ') : '
Expand All @@ -24,22 +24,22 @@ style EntityNode.Operations.Label {
else '')
}

style EntityNode.Attributes.Label {
style DomainmodelEntityDiagram.EntityNode.Attributes.Label {
text = element.simpleName + ' : ' + element.type.simpleName
}


style EntityNode.Attributes, EntityNode.Operations as RectangleShape {
style DomainmodelEntityDiagram.EntityNode.Attributes, DomainmodelEntityDiagram.EntityNode.Operations as RectangleShape {
outline = false
backgroundColor = color(#ffffff)
}

style EntityNode.Attributes.Label, EntityNode.Operations.Label {
style DomainmodelEntityDiagram.EntityNode.Attributes.Label, DomainmodelEntityDiagram.EntityNode.Operations.Label {
font = font("Helvetica", 11, SWT::NONE)
border = null
}

style EntityNode.SuperType {
style DomainmodelEntityDiagram.EntityNode.SuperType {
var arrow = new DiamondDecoration
arrow.backgroundColor = color(#ffffff)
targetDecoration = arrow
Expand Down
@@ -1,37 +1,41 @@
import org.eclipse.xtext.graphview.shape.*
import org.eclipse.xtext.graphview.behavior.layout.*
import org.eclipse.xtext.graphview.lib.shape.*
import org.eclipse.xtext.graphview.lib.layout.*
import org.eclipse.draw2d.*
import org.eclipse.swt.SWT
import DomainmodelPackageDiagram.*

stylesheet DomainmodelPackageDiagram for DomainmodelPackageDiagram

style DomainmodelPackageDiagram {
autoLayoutManager = new KielerAutoLayout
autoLayoutManager =
if(element.eContainer instanceof org.eclipse.xtext.example.domainmodel.domainmodel.PackageDeclaration)
new KielerAutoLayout
else
new GridAutoLayout
font = font("Helvetica", 14, SWT::BOLD)
}

style PackageNode as RectangleShape {
style DomainmodelPackageDiagram.PackageNode as RectangleShape {
lineStyle = SWT::LINE_DASH
lineWidth = 2
foregroundColor = color(#8a8a8a)
border = new MarginBorder(16,16,16,16)
}

style EntityNode.Properties, EntityNode.Operations as RectangleShape {
style DomainmodelPackageDiagram.EntityNode.Properties, DomainmodelPackageDiagram.EntityNode.Operations as RectangleShape {
outline = false
backgroundColor = color(#ffffff)
}

style EntityNode.Properties.Property, EntityNode.Operations.Operation {
style DomainmodelPackageDiagram.EntityNode.Properties.Property, DomainmodelPackageDiagram.EntityNode.Operations.Operation {
font = font("Helvetica", 12, 0)
border = null
}

style EntityNode.Properties.Property {
style DomainmodelPackageDiagram.EntityNode.Properties.Property {
text = element.name + ": " + element.type.simpleName
}

style EntityNode.Operations.Operation {
style DomainmodelPackageDiagram.EntityNode.Operations.Operation {
text = element.name + "(" + element.params.map[it.simpleName + ": " + it.parameterType.simpleName].join(", ")+ "): " + element.type.simpleName
}
@@ -1,7 +1,6 @@
import org.eclipse.emf.ecore.*
import org.eclipse.xtext.example.domainmodel.domainmodel.*
import org.eclipse.xtext.common.types.*
import org.eclipse.xtext.graphview.model.JvmModelHelper
import org.eclipse.xtext.EcoreUtil2

diagram DomainmodelPackageDiagram type PackageDeclaration {
Expand All @@ -16,6 +15,6 @@ diagram DomainmodelPackageDiagram type PackageDeclaration {
}
node PackageNode for each elements.filter(typeof(PackageDeclaration)) {
label Name for this
open DomainmodelPackageDiagram for this
call DomainmodelPackageDiagram for this
}
}
@@ -1,16 +1,13 @@
import org.eclipse.xtext.graphview.shape.*
import org.eclipse.xtext.graphview.behavior.layout.*
import org.eclipse.xtext.graphview.lib.layout.*
import org.eclipse.draw2d.*

import EClassHierarchy.*

stylesheet EClassHierarchy for EClassHierarchy

style EClassHierarchy {
autoLayoutManager = new KielerAutoLayout
}

style EClassNode.SuperType {
style EClassHierarchy.EClassNode.SuperType {
var arrow = new PolygonDecoration()
arrow.setScale(8,8)
arrow.backgroundColor = color(#ffffff)
Expand Down
17 changes: 8 additions & 9 deletions org.eclipse.xtext.graphview.example/src/ecore/EObject.gvstyle
@@ -1,28 +1,27 @@
import org.eclipse.emf.ecore.*
import org.eclipse.xtext.graphview.shape.*
import org.eclipse.xtext.graphview.lib.shape.*
import org.eclipse.xtext.util.SimpleAttributeResolver
import EObjectDiagram.EObjectNode.*
import org.eclipse.draw2d.*

stylesheet EObjectStyles for EObjectDiagram

style ClassName {
style EObjectDiagram.EObjectNode.ClassName {
text = '\u00ab' + element.eClass.name + '\u00bb'
border = new MarginBorder(0,5,0,5)
}

style Name {
style EObjectDiagram.EObjectNode.Name {
text = SimpleAttributeResolver::NAME_RESOLVER.apply(element)
border = new MarginBorder(0,5,0,5)
}

style Attributes as RectangleShape {
style EObjectDiagram.EObjectNode.Attributes as RectangleShape {
backgroundColor = color(#ffffff)
outline = false
font = font("Helvetica", 11, 0)
}

style Attributes.AttributeSetting {
style EObjectDiagram.EObjectNode.Attributes.AttributeSetting {
val attr = element.key as EAttribute;
val eObject = element.value as EObject
text = attr.name + " = " +
Expand All @@ -33,14 +32,14 @@ style Attributes.AttributeSetting {
border = null
}

style Containment {
style EObjectDiagram.EObjectNode.Containment {
//sourceDecoration = new DiamondDecoration
//targetDecoration = null
}

style CrossReference, Containment as SplineConnectionShape {
style EObjectDiagram.EObjectNode.CrossReference, EObjectDiagram.EObjectNode.Containment as SplineConnectionShape {
}

style Containment.Name, CrossReference.Name {
style EObjectDiagram.EObjectNode.Containment.Name, EObjectDiagram.EObjectNode.CrossReference.Name {
opaque = true
}
10 changes: 6 additions & 4 deletions org.eclipse.xtext.graphview.example/src/ecore/EPackage.gvmap
@@ -1,18 +1,20 @@
import org.eclipse.emf.ecore.*
import org.eclipse.emf.ecore.EPackage
import org.eclipse.emf.ecore.EClass
import org.eclipse.emf.ecore.EDataType

diagram EPackageDiagram type EPackage {
node EClassNode for each EClassifiers.filter(typeof (EClass)) {
label Name for this
node Attributes for EAttributes {
label Label for each this
} unless EAttributes.empty
node Operations for EOperations {
} unless EAttributes.empty
node Operations for EOperations {
label Label for each this
} unless EOperations.empty
edge ReferenceEdge for each EReferences {
=> ref EClassNode for EType
label EdgeLabel for name
} unless true
} //unless true
edge SuperclassEdge for each ESuperTypes {
=> ref EClassNode for this
}
Expand Down

0 comments on commit 3c8f3e3

Please sign in to comment.