Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Custom DataType for my emf editor
Custom DataType for my emf editor [message #1746176] Mon, 24 October 2016 14:17 Go to next message
Dimg Cim is currently offline Dimg CimFriend
Messages: 59
Registered: December 2015
Member
Hello everyone,

I have a model for modelling controls like TableViewer. I include the PackageExplorer to my generated Editor so that I can create my custom Projects in there with the xmi file. When I discribe my TableViewer and want to add a LabelProvider or other CompilationUnits exist in the custom Projekt. How can I do this. The LabelProvider is defined as a DataType in the ecore model.

My first Idea is to enhanced the propertyview to add the LabelProvder to the xmi model. So how can I referenced the CompilationUnit in the custom Project to XMI?

Hope this is clear enough.

Greetzs
dim
Re: Custom DataType for my emf editor [message #1746177 is a reply to message #1746176] Mon, 24 October 2016 14:32 Go to previous messageGo to next message
Dimg Cim is currently offline Dimg CimFriend
Messages: 59
Registered: December 2015
Member
I added the LabelProvider programmatically by a custom command and save the xmi file.
The next Time I open this xmi file I got this exception. What should I do to handle with custom data types in xmi file?

Caused by: java.lang.IllegalArgumentException: The value 'org.eclipse.jface.viewers.LabelProvider@6c1cfa53' is invalid. 
	at org.eclipse.emf.ecore.impl.EFactoryImpl.createFromString(EFactoryImpl.java:470)
	
Caused by: java.lang.IllegalArgumentException: The value 'org.eclipse.jface.viewers.LabelProvider@6c1cfa53' is invalid. 
	at org.eclipse.emf.ecore.impl.EFactoryImpl.createFromString(EFactoryImpl.java:470)
		at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.createFromString(XMLHelperImpl.java:1615)
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1156)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2692)
	... 150 more

[Updated on: Mon, 24 October 2016 14:33]

Report message to a moderator

Re: Custom DataType for my emf editor [message #1746189 is a reply to message #1746177] Mon, 24 October 2016 19:55 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
It's right in front of your eyes: you must implement the factory method createFromString() so that EMF can deserialize instances of your custom type. That said, I have a hard time imagining a LabelProvider to be a data type. It's not clear what you are doing.
Previous Topic:EMF MetaModeling
Next Topic:Deserializing JSON to EMF
Goto Forum:
  


Current Time: Thu Apr 25 23:36:05 GMT 2024

Powered by FUDForum. Page generated in 0.02950 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top