Menu
  • HOME
  • TAGS

Change comment symbol in Xtext editor

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) ...

Value must be stored in EMF model but should not propagate to xml file

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.

EMF: How can i reload an Emf model resource when the xml file is editied manually and saved

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.

Inverse reference lookup

java,xtext,emf,xtend

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...

Neo4j, Blueprint and UpgradeNotAllowedByConfigurationException

neo4j,emf,tinkerpop-blueprint

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> ...

Call super method from xcore operation

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. ......

Acceleo Collection of Collections

eclipse,emf,acceleo,ocl

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.

Xtext - Temporarily tolerate unresolvable references and make the reference name user readable

xtext,emf

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

Get notified on EAnnotation references list change

eclipse,emf,ecore

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...

Set value knowing the EObject and its EAttribute

java,eclipse,emf

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...

create emf generated model from an uml model

uml,emf,eclipse-gmf,papyrus

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

Use eStorage in EMF

java,eclipse-emf,emf

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 =...

xtext linking service and derived state

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...

ContentControl WPF does not display Content

c#,wpf,emf,metafile

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...

not support when writing xsd schema for EMF

xsd,choice,emf

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...

how to handle complexed type in emf M2M

model,emf,m2m

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 :...

Xtext: Create an EMF Resource on the fly

xtext,emf

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....

Initializing a (transient) EAttribute while parsing an Xtext resource

java,xtext,eclipse-emf,emf

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....

EMF alternate child references

emf

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...

Eclipse Project Explorer filter for XML files

eclipse,jface,emf

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...

Treeview inside getChildern()

java,treeview,rcp,emf

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...

EMF Merging Two Objects

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...