Skip to main content



      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 02:13 Go to next message
Eclipse UserFriend
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 07:39 Go to previous messageGo to next message
Eclipse UserFriend
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 07:56 Go to previous messageGo to next message
Eclipse UserFriend
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 08:26] by Moderator

Re: How to get Output Folder? - Compiler Preferences [message #911060 is a reply to message #910790] Mon, 10 September 2012 18:39 Go to previous messageGo to next message
Eclipse UserFriend
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 01:06 Go to previous messageGo to next message
Eclipse UserFriend
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 03:56 Go to previous messageGo to next message
Eclipse UserFriend
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 04:21 Go to previous messageGo to next message
Eclipse UserFriend
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 04:22] by Moderator

Re: How to get Output Folder? - Compiler Preferences [message #911246 is a reply to message #911238] Tue, 11 September 2012 04:27 Go to previous messageGo to next message
Eclipse UserFriend
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
icon7.gif  Re: How to get Output Folder? - Compiler Preferences [message #911383 is a reply to message #910633] Tue, 11 September 2012 09:36 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 08:41:38 EDT 2025

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

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

Back to the top