I’ve lately worked a lot with property files and what always bothered me was that there was no Outline-View shown for it like it is e.g. for the Java-Files.
Typically properties-File e.g. for translations are structured in a hierarchical way e.g. my files look like this:
ListView_FirstName=First Name ListView_LastName=Last Name DetailComposite_Title=Title DetailComposite_Name=Name
Which means we could group the items in the outline a bit by using the _ as a group indicator which makes the editor and outline look like this:
I’ve uploaded the Eclipse Plugin to EclipseLabs and you can install it by pointing your Eclipse Plug-in Installer to http://outlined-property-editor.googlecode.com/svn/trunk/updatesite/.
Hi Tom
There is an “Message Bundle Editor” available on the eclipse site: http://wiki.eclipse.org/Babel_/_Message_Bundle_Editor which also contains an outline view.
I use this editor in my eclipse rcp project to translate the strings. A modified (optimized) version and how to install it is described here:
http://mytourbook.sourceforge.net/mytourbook/index.php/development/translation/install-resource-editor
Wolfgang
Thanks for the pointer – there’s a bug open against JDT which requests better support for things I’ve implemented and your editor as well. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=4321. It would be nice to at least get outline support to the default editor provided by JDT
Hello Tom,
A very nice code !
I have copied your code and updated a bit. The result is that You don’t need any more to extend the Properties editor. In place, I have created an adapter factory with code like this:
@SuppressWarnings({ "rawtypes" })
public Object getAdapter(final Object adaptableObject, final Class adapterType) {
if (adapterType == IContentOutlinePage.class && adaptableObject instanceof PropertiesFileEditor) {
final PropertiesFileEditor editor = (PropertiesFileEditor) adaptableObject;
return new PropertyContentOutlinePage(editor);
}
return null;
}
If You want the source code, please send me a e-mail.
Best Regards
Laurent
Would you mind to create a patch and create a ticket at eclipselabs? I’m just working with JDT-Team to include the code into JDT so people get this feature by default in 3.7
or simply upload your source code to EclipseLabs.
I do a lot of changes. Maybe is more simple to send You a zip file.
sure. Can’t you upload it to EclipseLabs @ http://code.google.com/p/outlined-property-editor/issues/entry
I have uploaded the source code to EclipseLabs.
Hi
I’ve add the link to eclipse (helios) but I have : “there are no categorized items” message.
http://outlined-property-editor.googlecode.com/svn/trunk/updatesite/
thanx
Uncheck the group by category
Thank you Tom, I’ve successfully installed the plugin
But now, there is nothing in the outline view when I open properties file.
I’m using Eclipse helios on linux
You need to right click on the file because currently I’ve subclassed the default editor.
Hum, thanks. It is fine now.
You are using the _ as a group separator, what if I want to use a dot ?
Can we change this?