Loading plugins/org.etsi.mts.tdl.constraints/META-INF/MANIFEST.MF +4 −2 Original line number Diff line number Diff line Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Constraints Bundle-SymbolicName: org.etsi.mts.tdl.constraints Bundle-SymbolicName: org.etsi.mts.tdl.constraints;singleton:=true Bundle-Version: 1.0.0.qualifier Require-Bundle: org.eclipse.emf.common, org.eclipse.epsilon.common, Loading @@ -16,5 +16,7 @@ Require-Bundle: org.eclipse.emf.common, org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.emf.ecore.xmi, org.etsi.mts.tdl.model org.etsi.mts.tdl.model, org.eclipse.xtext, org.eclipse.epsilon.common.dt Export-Package: org.etsi.mts.tdl.constraints.evl plugins/org.etsi.mts.tdl.constraints/build.properties +2 −1 Original line number Diff line number Diff line source.. = src/ output.. = bin/ bin.includes = META-INF/,\ . .,\ plugin.xml plugins/org.etsi.mts.tdl.constraints/plugin.xml 0 → 100644 +12 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension point="org.eclipse.epsilon.common.dt.tool"> <tool class="org.etsi.mts.tdl.constraints.evl.XtextBridge" defaultName="XtextBridge"> </tool> </extension> </plugin> plugins/org.etsi.mts.tdl.constraints/src/org/etsi/mts/tdl/constraints/evl/XtextBridge.java 0 → 100644 +21 −0 Original line number Diff line number Diff line package org.etsi.mts.tdl.constraints.evl; import org.eclipse.emf.ecore.EObject; import org.eclipse.epsilon.eol.tools.AbstractTool; import org.eclipse.xtext.nodemodel.ICompositeNode; import org.eclipse.xtext.nodemodel.util.NodeModelUtils; import org.eclipse.xtext.resource.XtextResource; //DONE: extract to plugin? -> not for now public class XtextBridge extends AbstractTool { public String getTextFor(EObject o) { String text = ""; if (o.eResource() instanceof XtextResource) { ICompositeNode node = NodeModelUtils.findActualNodeFor(o); text = "Line "+node.getStartLine()+"-"+node.getEndLine()+ ": "+node.getText().trim(); } else { //TODO: handle non-xtext resources } return text; } } plugins/org.etsi.mts.tdl.constraints/src/org/etsi/mts/tdl/constraints/evl/XtextBridgeNativeTypeDelegate.java 0 → 100644 +25 −0 Original line number Diff line number Diff line package org.etsi.mts.tdl.constraints.evl; import java.util.List; import org.eclipse.epsilon.eol.exceptions.EolRuntimeException; import org.eclipse.epsilon.eol.types.AbstractToolNativeTypeDelegate; public class XtextBridgeNativeTypeDelegate extends AbstractToolNativeTypeDelegate{ public XtextBridgeNativeTypeDelegate() { } public Object createInstance(String clazz, List<Object> parameters) throws EolRuntimeException { return new XtextBridge() { }; } public boolean knowsAbout(String clazz) { if (clazz.equals("org.etsi.mts.tdl.constraints.evl.XtextBridge")) return true; return false; } } No newline at end of file Loading
plugins/org.etsi.mts.tdl.constraints/META-INF/MANIFEST.MF +4 −2 Original line number Diff line number Diff line Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Constraints Bundle-SymbolicName: org.etsi.mts.tdl.constraints Bundle-SymbolicName: org.etsi.mts.tdl.constraints;singleton:=true Bundle-Version: 1.0.0.qualifier Require-Bundle: org.eclipse.emf.common, org.eclipse.epsilon.common, Loading @@ -16,5 +16,7 @@ Require-Bundle: org.eclipse.emf.common, org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.emf.ecore.xmi, org.etsi.mts.tdl.model org.etsi.mts.tdl.model, org.eclipse.xtext, org.eclipse.epsilon.common.dt Export-Package: org.etsi.mts.tdl.constraints.evl
plugins/org.etsi.mts.tdl.constraints/build.properties +2 −1 Original line number Diff line number Diff line source.. = src/ output.. = bin/ bin.includes = META-INF/,\ . .,\ plugin.xml
plugins/org.etsi.mts.tdl.constraints/plugin.xml 0 → 100644 +12 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension point="org.eclipse.epsilon.common.dt.tool"> <tool class="org.etsi.mts.tdl.constraints.evl.XtextBridge" defaultName="XtextBridge"> </tool> </extension> </plugin>
plugins/org.etsi.mts.tdl.constraints/src/org/etsi/mts/tdl/constraints/evl/XtextBridge.java 0 → 100644 +21 −0 Original line number Diff line number Diff line package org.etsi.mts.tdl.constraints.evl; import org.eclipse.emf.ecore.EObject; import org.eclipse.epsilon.eol.tools.AbstractTool; import org.eclipse.xtext.nodemodel.ICompositeNode; import org.eclipse.xtext.nodemodel.util.NodeModelUtils; import org.eclipse.xtext.resource.XtextResource; //DONE: extract to plugin? -> not for now public class XtextBridge extends AbstractTool { public String getTextFor(EObject o) { String text = ""; if (o.eResource() instanceof XtextResource) { ICompositeNode node = NodeModelUtils.findActualNodeFor(o); text = "Line "+node.getStartLine()+"-"+node.getEndLine()+ ": "+node.getText().trim(); } else { //TODO: handle non-xtext resources } return text; } }
plugins/org.etsi.mts.tdl.constraints/src/org/etsi/mts/tdl/constraints/evl/XtextBridgeNativeTypeDelegate.java 0 → 100644 +25 −0 Original line number Diff line number Diff line package org.etsi.mts.tdl.constraints.evl; import java.util.List; import org.eclipse.epsilon.eol.exceptions.EolRuntimeException; import org.eclipse.epsilon.eol.types.AbstractToolNativeTypeDelegate; public class XtextBridgeNativeTypeDelegate extends AbstractToolNativeTypeDelegate{ public XtextBridgeNativeTypeDelegate() { } public Object createInstance(String clazz, List<Object> parameters) throws EolRuntimeException { return new XtextBridge() { }; } public boolean knowsAbout(String clazz) { if (clazz.equals("org.etsi.mts.tdl.constraints.evl.XtextBridge")) return true; return false; } } No newline at end of file