eclipse,eclipse-plugin,xtext,emf
if you do not want to override SL_COMMENT then you have to hook into the corresponding places for the highlighting: DefaultAntlrTokenToAttributeIdMapper for the toggle sl comment action: ISingleLineCommentHelper.getDefaultPrefixes(ISourceViewer, String) ...
java,xml,eclipse-emf,emf,eclipse-emf-ecore
Setting the transient property of the EAttribute will prevent it from being serialized (it will be reset to the default value when read), which is basically the same effect as the transient keyword in Java serialization.
editor,eclipse-rcp,eclipse-emf,emf,eclipse-emf-ecore
Have a look at resourcechangedlistener. You will get control automatically when some one changes the file in editing domain.
Thanks, Christian Dietrich! Your idea works very good. My solution for a fast, specialised reverse reference lookup looks like this: I extended the XbaseResourceDescriptionStrategy to add custom data to the index. The custom data is a key/value pair which has 'ModifiesUnit' as key and the qualified name of the referenced...
I had the same problem. I added the following dependency along with the blueprints ones and I was able to get my test to run. <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j</artifactId> <version>2.1.7</version> </dependency> ...
super,eclipse-emf,emf,eclipse-emf-ecore,xcore
I had to make some assumptions about the code that you don't show here, but the short answer is that it works. You're calling super.equals correctly. But as I said, I had to make some assumptions. So here is what I have that seems to be fine with xcore. ......
In OCL, "collect" will flatten the result. The operation "collectNested" should be used if you don't want a flattened result. See the Acceleo documentation for more information.
Have a look at the 'Node Model' e.g. org.eclipse.xtext.nodemodel.util.NodeModelUtils.findNodesForFeature(EObject, EStructuralFeature) allows you to access the text that is written in the file
I figured out that the notification was created but the notifyChanged() method initially ignored it. This is what worked for me: @Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(EAnnotation.class)) { case EcorePackage.EANNOTATION__SOURCE: case EcorePackage.EANNOTATION__REFERENCES: /*ADDED*/ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case EcorePackage.EANNOTATION__CONTENTS: fireNotifyChanged(new...
EMF has already its own introspection mechanisms, that do not use Java Reflection but use static generated code. What you need is this: object.eSet(attribute, value); If the attribute is a "many" relationship, such as a List, you need to retrieve the list before and then add the content to the...
I found the solution, actually in this example the association owns both of its ends so changing the owner of the end i want to use in my .ecore file into classifier in the properties view of papyrus worked. This is a screenshot: http://imgur.com/H4UkESU
Chances are that eStorage is a private field. So either, Re-read the javadoc of the EObject interface and/or the javadoc of the particular implementation of EObject you're using. You may find a method offering the data you're looking for. Access the private field via Reflection try { Field f =...
eclipse,xtext,emf,eclipse-emf-ecore,ecore
I think the underlying problem here is that EMF is a graph-based format; classes can be features of other classes, arguments to operations, etc. In general, this graph of relations can contain loops, cycles and knots. So anything that tries to modify things in-place is going to be tricky, requiring...
I am not very familiar with Silverlight, but in WPF when you override MeasureOverride(...) and ArrangeOverride(...) you have to measure and arrange the contol's children so they can measure and arrange their children and so on. In your case, you have to include calls to base.MeasureOverride(...) and base.ArrangeOverride(...) in the...
Yes. Substitution groups apply to global elements. So move your elements out of your type and reference to them in the type. <xsd:element name="src_node" type="xsd:anyURI" ecore:reference="lib:Node"/> <xsd:element name="node_one" type="xsd:anyURI" substitutionGroup="src_node"/> <xsd:element name="dst_node" type="xsd:anyURI" ecore:reference="lib:Node"/> <xsd:element name="node_two" type="xsd:anyURI" substitutionGroup="dst_node"/> <xsd:complexType name="Edge"> <xsd:sequence> <xsd:element...
You rule Member2Female specifies that from a Member, two elements will be created: a Graph and a Node. You have to put the nodes <-... part into the myrule() entrypoint where your "main" Graph element is created. You can try this: module families2graph; create OUT : graph from IN :...
You can try @Inject Provider<XtextResourceSet> resourceSetProvider; Also don't forget to execute <YourLanguage>StandaloneSetup.doSetup() in your non-ui app to initialize emf registries and make all your classes injected properly....
I have found a way by subclassing org.eclipse.xtext.parser.DefaultEcoreElementFactory and Guice-Injecting it as the org.eclipse.xtext.parser.IAstFactory for my language. I override create() and do EObject obj = super.create(...); if(obj instanceof Hello) ((Hello)obj).setSource("Xtext"); return obj; I don't know if this is the correct way, but it works....
This is exactly a use-case for "Feature maps" in EMF. You want to combine multiple types of objects into a single ordered list and then access individual types using separate references. So, I created a minimal meta-model that shows how a Document can contain a mixture of Table and Paragraph...
You could use the org.eclipse.core.contenttype.contentTypes to define new content types for your file. Use the describer argument of the content type definition to specify a 'content describer' class which can check that the XML file meets your requirements. There is already an XMLContentDescriber class that you can use as a...
No you cannot nest tree viewers. You must use a data model for the tree that represents the whole tree. Suppose you have a class TopLevelElement representing one of the top level elements in the tree, and classes Level1Element and Level2Element for the first and second level children. Then your...
object,merge,eclipse-emf,emf,eclipse-emf-ecore
I'm assuming this data can't be edited or even accessed by several users/threads at same time. If so, then the easiest way to implement such behavior is to use the Change Recorder which is part of the EMF framework. When the user starts editing the data, you simply attach the...