|Re: Storing formatter profile in plugin [message #1032889 is a reply to message #1005514]
||Wed, 03 April 2013 15:14
| Joseph Carroll
Registered: May 2012
Location: Milwaukee, WI
I was just asked if there was any update on this thread, so here is what I have learned since the original post:|
The clean-up, formatter, and other code style engines read their settings directly from the preferences files located under your.project.name -> .settings folder. Thus, specifying an outside file does not work.
The best way I have found to handle this is to just remove the profile names from the preferences file. This will cause the profile to be listed as 'Unmanaged Profile' and prevent someone from changing the settings directly.
For example: For the Formatter & Clean-Up engines, create your project specific settings and name the profile "Project Specific Settings". To open the preferences file, navigate to your.project.name -> .settings -> org.eclipse.jdt.ui.prefs. In this file there will be entries:
cleanup-profile=_Project Specific Settings
formatter_profile=_Project Specific Settings
Delete both of these entries from the file and you'll be all set. Then, for any project that you want to share the settings just copy the files org.eclipse.jdt.ui.prefs & org.eclipse.jdt.core.prefs into the respective .settings folders and you'll be all set.
I suppose at some point it would be possible to create a central profile somewhere and have the projects do a one time read at start-up from this location. But someone much more familiar with the code with have to implement that, if it is even desired.
Thats my update, happy formatting!
Powered by FUDForum
. Page generated in 0.01627 seconds