Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to get Output Folder? - Compiler Preferences(How to get values from Xtext Preferences/Properties)
How to get Output Folder? - Compiler Preferences [message #910633] Mon, 10 September 2012 06:13 Go to next message
Sandra Shklyaeva is currently offline Sandra ShklyaevaFriend
Messages: 16
Registered: July 2012
Junior Member
I need to get value "Directory" (output folder) from Compiler Preference/Property Page programmatically.

How can I do that?

And generally, how can I access to the preferences of Xtext Preferences/Properties pages such as Compiler, Refactoring etc.
Re: How to get Output Folder? - Compiler Preferences [message #910784 is a reply to message #910633] Mon, 10 September 2012 11:39 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Am 10.09.12 08:13, schrieb Sandra Shklyaeva:
> I need to get value "Directory" (output folder) from Compiler
> Preference/Property Page programmatically.
>
> How can I do that?
>
> And generally, how can I access to the preferences of Xtext
> Preferences/Properties pages such as Compiler, Refactoring etc.

You may want to use the IOutputConfigurationProvider to access the
values that can be configured by means of the output preference page.
The same applies for other settings, too: There is usually a service
available that provides their values.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: How to get Output Folder? - Compiler Preferences [message #910790 is a reply to message #910633] Mon, 10 September 2012 11:56 Go to previous messageGo to next message
Sandra Shklyaeva is currently offline Sandra ShklyaevaFriend
Messages: 16
Registered: July 2012
Junior Member
Dear Sebastian,

Thank you very much for your reply.

I found IOutputConfigurationProvider, but I still can't understand how can I get the value?

I also tried to inject EclipseOutputConfigurationProvider and OutputConfigurationProvider which implements the interface, but they are both null.

How can I get current IOutputConfigurationProvider? What service can I use to get the provider and values?

Regards,
Sandra

[Updated on: Mon, 10 September 2012 12:26]

Report message to a moderator

Re: How to get Output Folder? - Compiler Preferences [message #911060 is a reply to message #910790] Mon, 10 September 2012 22:39 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Am 10.09.12 13:56, schrieb Sandra Shklyaeva:
> Dear Sebastian,
>
> Thank you very much for your reply.
>
> I found IOutputConfigurationProvider and also found
> EclipseOutputConfigurationProvider and OutputConfigurationProvider which
> implements this interface, but I still can't understand how can I get
> the value?
>
> How can I get current IOutputConfigurationProvider? What service can I
> use to get the provider and values?
>
> Regards,
> Sandra
>

Services such as an instance of the IOutputConfigurationProvider are
obtained by means of dependency injection. It is usually sufficient to
declare a field with an @Inject annotation. Please refer to the
reference docs and the Google Guice documentation for details.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: How to get Output Folder? - Compiler Preferences [message #911156 is a reply to message #911060] Tue, 11 September 2012 05:06 Go to previous messageGo to next message
Sandra Shklyaeva is currently offline Sandra ShklyaevaFriend
Messages: 16
Registered: July 2012
Junior Member
As I mentioned in my previous post I already tried to inject:
@Inject
IOutputConfigurationProvider provider;


and:
@Inject
EclipseOutputConfigurationProvider provider;


and also:
@Inject
OutputConfigurationProvider provider;


But they are all NULL.
What am I doing wrong?

Regards,
Sandra
Re: How to get Output Folder? - Compiler Preferences [message #911228 is a reply to message #911156] Tue, 11 September 2012 07:56 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Hi Sandra,

sorry I do not see a single mention of the @Inject annotation in your
prev post. Somehow I missed that.

How do you obtain an instance of the class that has these injected fields?

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 11.09.12 07:06, schrieb Sandra Shklyaeva:
> As I mentioned in my previous post I already tried to inject:
> @Inject
> IOutputConfigurationProvider provider;
>
> and:
> @Inject
> EclipseOutputConfigurationProvider provider;
>
> and also: @Inject
> OutputConfigurationProvider provider;
>
> But they are all NULL.
> What am I doing wrong?
>
> Regards,
> Sandra
Re: How to get Output Folder? - Compiler Preferences [message #911238 is a reply to message #911228] Tue, 11 September 2012 08:21 Go to previous messageGo to next message
Sandra Shklyaeva is currently offline Sandra ShklyaevaFriend
Messages: 16
Registered: July 2012
Junior Member
Hello Sebastian,

I need to get the value in my Eclipse Wizard class (MyDslExport) that implements IExportWizard.
I define the wizard using extension point org.eclipse.ui.exportWizard.

So, I am trying to inject the provider in MyDslExport class.

Probably, the provider is null because my MyDslExport is not injected but defined using eclipse extension point.
In this case, how can I solve it?

Regards,
Sandra

[Updated on: Tue, 11 September 2012 08:22]

Report message to a moderator

Re: How to get Output Folder? - Compiler Preferences [message #911246 is a reply to message #911238] Tue, 11 September 2012 08:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13359
Registered: July 2009
Senior Member
Hi you need yourdslexecutableextensionfactory whrn specifying the
class in the plugin.XML (have a look at other extensions in the UI
projects plugin.XML)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
icon7.gif  Re: How to get Output Folder? - Compiler Preferences [message #911383 is a reply to message #910633] Tue, 11 September 2012 13:36 Go to previous message
Sandra Shklyaeva is currently offline Sandra ShklyaevaFriend
Messages: 16
Registered: July 2012
Junior Member
Thank you very much Sebastian and Christian, finally it works!
Previous Topic:cannot add XMemberFeatureCall to sealed type XExpression
Next Topic:How to access Xcore model from Xtext?
Goto Forum:
  


Current Time: Sun Feb 23 17:54:13 GMT 2020

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

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

Back to the top