Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to set EMF Model validation preferences through pluginCustomization ini file(How to set EMF Model validation preferences through pluginCustomization option to control preference state from Eclipse startup)
How to set EMF Model validation preferences through pluginCustomization ini file [message #922479] Tue, 25 September 2012 03:41 Go to next message
Santosh Kumar is currently offline Santosh KumarFriend
Messages: 6
Registered: July 2009
Junior Member
I am looking for help as how to set EMF Model validation preferences through pluginCustomization option to control preference state from Eclipse startup. EMF Validation contributes Model validation preferences and these appear in Eclipse -Preferences - Model Validation. The requirement is to disable specific validation preferences at Eclipse startup.

The issue is that even after setting the model validation constraint property in pluginCustomization.ini file, it does not work.

To reproduce the issue in Eclipse and EMF, Installed EMF validation samples plugins which contributes two validation constraints. Typically the eclipse pluginCustomization requires .ini properties file having the pluginID/preferenceID , which will set the eclipse preferences.

When the EMF Model validation preferences are exported as .epf file, it shows the properties as /instance/org.eclipse.emf.validation//con.disabled/org.eclipse.emf.validation.examples.general.org.eclipse.emf.validation.pde.example.general.ui.NameNotEmpty=true

For adding into pluginCustomization.ini file,have added following in.ini file org.eclipse.emf.validation//con.disabled/org.eclipse.emf.validation.examples.general.org.eclipse.emf.validation.pde.example.general.ui.NameNotEmpty=true and expected the preference to get disabled. But this does not work and it shows the preference to be enabled. The other eclipse UI properties like org.eclipse.ui/SHOW_MEMORY_MONITOR= true works fine.

It would be great to get insights on this issue as why this is not working correctly with Validation preferences. How to make this work properly?
Re: How to set EMF Model validation preferences through pluginCustomization ini file [message #924248 is a reply to message #922479] Wed, 26 September 2012 16:54 Go to previous message
Santosh Kumar is currently offline Santosh KumarFriend
Messages: 6
Registered: July 2009
Junior Member
Found possible reason why EMF model validation is not working.

This looks to be an eclipse issue why the EMF model validation preferences are not being set with plugincustomization argument.

The following eclipse issue is tracking this issue as well https://bugs.eclipse.org/bugs/show_bug.cgi?id=380859


As noted in the issue, the preferences key value pairs can be of three forms.
1) abcd=efgh (here abcd is a simple string key with out any path separators like /).
2) abcd/efgh/ijkl=mnop (here abcd/efgh is the path of the child node and ijkl is the actual key)
3) abcd//efgh/ijkl=mnop (here abcd is the path of the child node and efgh/ijkl is the key)

In case of model validation constraints, the validation preference is an example of case 3. ( abcd//efgh/ijkl=mnop).
The class Default preferences having applyCommandLineDefaults() which applies defaults is not computing the key properly.

The key computed is as lastSegment and which returns the <constraintid> in org.eclipse.emf.validation//con.disabled/<constraintid>=true case.

IPath childPath = new Path(fullKey);
String key = childPath.lastSegment();

The key should had been computed as con.disabled/<constraintid> which will then being read while setting the value.

It looks that because of above reason, EMF model validation preferences is not working with emf validation preferences.

Appreciate any help on any information or confirmation about this or any workarounds ..
Previous Topic:Problem serializing EDataType
Next Topic:[CDO] Could not activate TCPClientConnector on CDO Hibernate
Goto Forum:
  


Current Time: Sat Apr 20 00:37:54 GMT 2024

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

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

Back to the top