Improvement Properties-Editor


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/.

13 thoughts on “Improvement Properties-Editor

    • Tom Schindl January 5, 2011 / 7:41 am

      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

  1. Laurent Muller January 6, 2011 / 1:24 pm

    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

    • Tom Schindl January 6, 2011 / 1:40 pm

      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

    • Tom Schindl January 6, 2011 / 2:00 pm

      or simply upload your source code to EclipseLabs.

  2. Laurent Muller January 6, 2011 / 3:47 pm

    I do a lot of changes. Maybe is more simple to send You a zip file.

  3. Laurent Muller January 7, 2011 / 6:34 am

    I have uploaded the source code to EclipseLabs.

    • Tom Schindl January 8, 2011 / 7:25 am

      Uncheck the group by category

  4. reda January 8, 2011 / 3:27 pm

    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

    • Tom Schindl January 8, 2011 / 3:32 pm

      You need to right click on the file because currently I’ve subclassed the default editor.

  5. reda January 8, 2011 / 4:13 pm

    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?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s