Questions tagged [emf]

For questions about the Eclipse Modeling Framework (EMF) project. EMF is a modeling framework and code generation facility for building tools and other applications based on a structured data model.

Eclipse EMF site: https://eclipse.org/modeling/emf/

433 questions
5
votes
1 answer

Eclipse EMF: How to get access EAttribute by name?

I have a Java method that is passed a String and an EMF EObject. The String is meant to be the name of an attribute of the EObject. For example, if it were passed "foo" and EObject eobj, it would need to access eobj.getFoo(). I know how to get the…
Leonide
  • 235
  • 3
  • 11
5
votes
1 answer

How to set enum reference with default value = null in ecore and gen model?

I have an Eclass Vehicle which has an enum attribute BreakType breakType. BreakType is defined in the same Ecore model as: BreakType{ DRUM(0), DISC(1), BLADE(2) } I want to set attribute breakType default to null. for that I set following…
roul ze
  • 133
  • 1
  • 9
4
votes
1 answer

XSD Schema diagram using Eclipse

Eclipse has an XML perspective which is handy for developing XML and XML Schemas (XSD). One nice this is that it allows you to create a diagram(png) of the schema, however it seems to only do one level at a time. My XSD contains a number of complex…
4
votes
1 answer

Eclipse GMF Compartment Node (List Layout) - Every Compartment Collapsed at start

I created a gmf model using eugenia with the following node in it: @gmf.node(label="name", border.width="0", margin="1", label.icon="false") class ShElement { attr String name; ref EObject element; …
Shorty123
  • 539
  • 1
  • 7
  • 26
4
votes
1 answer

How can I repair a damaged eclipse $HOME/.p2 repository?

I've been working through a long string of issues that apparently started when my Ubuntu VM ran out of disk space a couple of weeks ago. I was able to expand the virtual disk and get past that, but it appears that behind the scenes this caused…
David M. Karr
  • 14,317
  • 20
  • 94
  • 199
4
votes
2 answers

Can derived attributes be persisted and derivation disabled in Ecore and OCL?

I want to port a legacy data format, which consists of concepts similar to Eclipse Modeling Framework (EMF) Ecore: Elements with Parameters which have different datatypes and default values. A custom-made tool lets you edit such model instances by a…
Hauke
  • 134
  • 10
4
votes
1 answer

How can I load a papyrus uml model by using Java?

I created a class diagram using papyrus and I got a *.uml model. Now I want to iterate through the *.uml elements by writing some Java Code. I tried this code: URI uri = URI.createURI("*.uml"); ResourceSet set = new…
Ahmadkt
  • 91
  • 6
4
votes
5 answers

Why use a factory instead of 'new'?

I am reading the book EMF: Eclipse Modeling Framework where its stated: The EMF programming model strongly encourages, but doesn’t require, the use of factories for creating objects. Instead of simply using the new operator to create [an…
Pétur Ingi Egilsson
  • 4,368
  • 5
  • 44
  • 72
4
votes
0 answers

EMF Validation: What is the proper way?

We are currently using EMF Validation to provide direct feedback to the user in case of model constraint violation. The system is set up as follows: An EContentAdapter records all modifications done on the model A CommandStackListener pushes these…
parasietje
  • 1,529
  • 8
  • 36
3
votes
1 answer

Transform java.net.URI to org.eclipse.emf.common.util.URI

There are at least two types of URIs in Java: java.net.URI org.eclipse.emf.common.util.URI I have java.net.URI and need to use the EMF URI. How can I convert the former to the latter? If I try new URI uri = profileUrl.toURI() I will get a message…
Martin
  • 65
  • 2
  • 4
3
votes
3 answers

How can I set an EList as an input in JFace TableViewer?

This is my first SO question. I hope i provide enough details. I have an EMF Model with a class called ScopeContainer, which has two containment References as ELists of Different Types. I have generated the model model.edit and model.editor…
Fuhry
  • 43
  • 7
3
votes
0 answers

Acceleo Builder error since eclipse 2018-12 update

since Eclipse update to 2018-12 I can't build any Acceleo project with Query. I use Acceleo 3.7.7 and update EMF to nigthly version to solves this issue : https://bugs.eclipse.org/bugs/show_bug.cgi?id=543103 for example i get error like this :…
flagadajones
  • 329
  • 3
  • 12
3
votes
0 answers

Determine Eclipse Project Name from Maven pom.xml

I very much dislike IDE specific files in our code branches, so I want to get rid of all .project, .classpath, .settings, whatever files and folders. I have several Eclipse Ecore Modelling Projects that are named differently in the Eclipse .project…
KayleeTheMech
  • 489
  • 1
  • 4
  • 17
3
votes
2 answers

Get EClass from EMF model instance class

Given any Class clazz object, is there an API to get the EClass whose model instances implement clazz? (i.e. the eClass for which eClass.getInstanceClass().equals(clazz) is true) If I had an eObject, I could simply call eObject.eClass() to get…
kapex
  • 28,903
  • 6
  • 107
  • 121
3
votes
1 answer

Generate EMF Model via Gradle

I am currently evaluating EMF. Therefore, I created a few toy models inside Eclipse and generated the corresponding code. Since my workflow does not contain any Eclipse related tools I would like to stick to my gradle-based workflow for non-toy…
miho
  • 833
  • 7
  • 11
1
2
3
28 29