Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » How to use Environment variables in Context Settings
How to use Environment variables in Context Settings [message #1701925] Thu, 16 July 2015 18:00 Go to next message
Matias Pentreath is currently offline Matias PentreathFriend
Messages: 17
Registered: August 2013
Junior Member
I need to set some Preferences using a Context, and in the value of the preference I need to use a path which may change depending on the OS.

I need to use environment variables or java variables to create the relative path for the value.

Is possible to access env variables from a Context Setting?

Just to give an example, I'm trying to set the M2_REPO variable in the classpath settings in the preferences menu.
to user.home + /.m2/repository
How can I access the user.home from there?

Re: How to use Environment variables in Context Settings [message #1701957 is a reply to message #1701925] Fri, 17 July 2015 06:29 Go to previous messageGo to next message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Matias,

Sure, you can use substitute-variables command for this purpose.

See the example below:

concat [substitute-variables "${system_property:user.home}" | str] "/.m2/repository"]

Kind regards,
Ulyana.
Re: How to use Environment variables in Context Settings [message #1702219 is a reply to message #1701957] Mon, 20 July 2015 17:34 Go to previous messageGo to next message
Matias Pentreath is currently offline Matias PentreathFriend
Messages: 17
Registered: August 2013
Junior Member
Hi Ulyana

What you wrote is ECL but if I try to use in a Context Preference it doesn't work.
I'm using a context Preference.
If there is no way to do this in a preference I have to create particular methods instead of using what is provided by the framework
Re: How to use Environment variables in Context Settings [message #1709561 is a reply to message #1702219] Tue, 29 September 2015 10:12 Go to previous message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Matias,

I'm afraid it's impossible to do it in a Preference Context, but you could set a global variable for that property value in ECL Script context, so you could use this variable anyway you need in a script.

Kind regards,
Ulyana.
Previous Topic:Window 0xa00003 (Eclipse) sets an MWM hint indicating it isn't resizable
Next Topic:RCPTT Maven Test Runner failing
Goto Forum:
  


Current Time: Tue Sep 24 02:45:54 GMT 2024

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

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

Back to the top