Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using IContextualOutputConfigurationProvider(Using IContextualOutputConfigurationProvider instead of IOutputConfigurationProvider)
Using IContextualOutputConfigurationProvider [message #1782998] Tue, 06 March 2018 10:24 Go to next message
Juan Bavaresco is currently offline Juan BavarescoFriend
Messages: 4
Registered: March 2018
Junior Member
I have a project where I want to set the output directories according to information available using import org.eclipse.emf.ecore.resource.Resource.

Since the OutputConfigurationProvider uses the Set<OutputConfiguration> getOutputConfigurations() from IOutputConfigurationProvider, which has no Resource context argument, so I decided to try and use the Set<OutputConfiguration> getOutputConfigurations(Resource input) available at IContextualOutputConfigurationProvider but for some reason the last one never gets called.

I modified the RuntimeModule by adding
def Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
MyOutputConfigurationProvider
}

and used on the OutputConfigurationProvider,
class MyOutputConfigurationProvider implements IContextualOutputConfigurationProvider {

instead of

class MyOutputConfigurationProvider implements IOutputConfigurationProvider {

Any hints on what else should I modify to be able to use the IContextual?

Cheers!





Re: Using IContextualOutputConfigurationProvider [message #1783181 is a reply to message #1782998] Thu, 08 March 2018 20:54 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
can you be more specific on "where" your problem occurs?
which client api do you use that accesses the ioutputconfigurationprovider and not IContextualOutputConfigurationProvider?

and are you in eclipse or standalone?
e.g. org.eclipse.xtext.builder.EclipseOutputConfigurationProvider.getOutputConfigurations(IProject) is used in eclipse


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 08 March 2018 20:57]

Report message to a moderator

Re: Using IContextualOutputConfigurationProvider [message #1783593 is a reply to message #1783181] Wed, 14 March 2018 12:52 Go to previous messageGo to next message
Juan Bavaresco is currently offline Juan BavarescoFriend
Messages: 4
Registered: March 2018
Junior Member
Hey Christian,
I'm working in Eclipse.

My problem occurs currently on the outputConfigurationProvider file that I created on my project. There, I have this class:
class MyOutputConfigurationProvider implements IContextualOutputConfigurationProvider { }

And inside I have override Set<OutputConfiguration> getOutputConfigurations(Resource input) { }

Then, on the RuntimeModule of my file, I have added this code:
def Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
MyOutputConfigurationProvider
}

I have these because I want to be able to generate new OutputConfigurations according to data I have on the Resource. So inside my
override Set<OutputConfiguration> getOutputConfigurations(Resource input) { }

I have defined the following:
for(element : input.allContents.toIterable.filter(Element)) {}

And inside of it i generate new outputconfigurations depending on that information.

If instead of using IContextualOutputConfigurationProvider I do everything above using IOutputConfigurationProvider, then it works. But I need to be able to generate the new outputconfigurations according to the elements on the Resource, and for some reason it's not getting called the
override Set<OutputConfiguration> getOutputConfigurations(Resource input) { }

Cheers and thanks beforehand for the help!
Re: Using IContextualOutputConfigurationProvider [message #1783596 is a reply to message #1783593] Wed, 14 March 2018 13:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
I mean: which is the place your provider is not used

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Using IContextualOutputConfigurationProvider [message #1783597 is a reply to message #1783596] Wed, 14 March 2018 13:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
(In eclipse the eclipseoutputconfigprovider is bound and used )

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Using IContextualOutputConfigurationProvider [message #1783610 is a reply to message #1783597] Wed, 14 March 2018 15:03 Go to previous messageGo to next message
Juan Bavaresco is currently offline Juan BavarescoFriend
Messages: 4
Registered: March 2018
Junior Member
My provider is used, what is not getting called is the override Set<OutputConfiguration> getOutputConfigurations(Resource input) { }, but always this one override Set<OutputConfiguration> getOutputConfigurations() { }

So my main question is, is it possible to implement
override Set<OutputConfiguration> getOutputConfigurations(Resource input) { }

without implementing
override Set<OutputConfiguration> getOutputConfigurations() { }

Re: Using IContextualOutputConfigurationProvider [message #1783615 is a reply to message #1783610] Wed, 14 March 2018 15:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
please provide a stacktrace

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Using IContextualOutputConfigurationProvider [message #1783746 is a reply to message #1783615] Fri, 16 March 2018 14:22 Go to previous message
Juan Bavaresco is currently offline Juan BavarescoFriend
Messages: 4
Registered: March 2018
Junior Member
Hey Christian!

Thanks for your help!

After knowing that in Eclipse the org.eclipse.xtext.builder.EclipseOutputConfigurationProvider.getOutputConfigurations(IProject) is bound and used, I discovered that inside of it the getOutputConfigurations() that doesn't consider any context is always used.

After looking through the forums, I discovered a solution similar to what I needed in here: https://www.eclipse.org/forums/index.php?t=msg&th=1083997&goto=1752776& and was able to solve my problem.

Cheers!
Previous Topic:Unable to execute MWE2Runner with maven
Next Topic:[deleted]
Goto Forum:
  


Current Time: Mon Sep 24 03:40:56 GMT 2018

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

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

Back to the top