Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using ResourceFactory without depending in UI project
Using ResourceFactory without depending in UI project [message #1746669] Wed, 02 November 2016 17:09 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 644
Registered: July 2009
Location: Trondheim, Norway
Senior Member
I am running a headless application where I would like to use the ordinary EMF resource factory mechanism, so I can create Xtext resources for my language based on the file extension. However, it's the xtext.ui project that defines the resource factory in its plugin.xml, and I only want to depend on the xtext project.

I have extracted the necessary plugin.xml extensions and implemented my own ExecutableExtensibleFactory and Activator to make it work, but I'm surprised if this is the only way to do it? I also need to register the resource factory for xtextbin to make it work, as it tries to load the grammar model from an xtextbin file.

So, is there an easier way to use a language and load files with its extension in a headless application?
Re: Using ResourceFactory without depending in UI project [message #1746906 is a reply to message #1746669] Mon, 07 November 2016 14:30 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
Hi,

there is a StandaloneSetup generated next to your grammar file that should do the trick in a non eclipse scenario. Is that what you meant or do you want to activate the runtime plugin in a headless Eclipse? Then you need to do the stuff you already did.

[Updated on: Mon, 07 November 2016 14:32]

Report message to a moderator

Re: Using ResourceFactory without depending in UI project [message #1746996 is a reply to message #1746906] Tue, 08 November 2016 12:45 Go to previous message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 644
Registered: July 2009
Location: Trondheim, Norway
Senior Member
It's a headless Eclipse, so I cannot depend on the UI plugin. The current solution works, so I'll stick to that, thank you!
Previous Topic:EMF registries and guice injection
Next Topic:problem string concat operation OclUndefined ?
Goto Forum:
  


Current Time: Fri Mar 24 22:10:19 GMT 2017

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

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