Currently the properties are all collapsed and you can only see the top-most level.
Ultimately users should be able to set the “expand to level” in esv just like you can do for the outline view, or have other means to control which properties should be expanded.

Supporting this in Eclipse is not easy. All I found out so far is that you possibly need to invoke org.eclipse.swt.widgets.TreeItem.setExpanded(boolean expanded) or assign categories to properties and invoke org.eclipse.ui.views.properties.PropertySheetCategory.setAutoExpand(boolean autoExpand).

Submitted by Oskar van Rest on 14 March 2014 at 00:31

On 14 March 2014 at 11:14 Guido Wachsmuth commented:

Can you have a generic category such as SpoofaxPropertyCategory, assign every property to this category, and auto-expand this always?


On 14 March 2014 at 17:10 Oskar van Rest commented:

I just had a look at this but PropertySheetCategory has no modifier and is therefore only visible from within package org.eclipse.ui.views.properties. There is only a single call to its constructor and this one instantiates the category with a fixed name "misc". It seems like this category story is a dead end… I don’t know why Eclipse has to make it this hard.

Possibly we’re better of if we replace the default properties view with a tabbed properties view (with a single tab), because that one seems to be more customizable. But this would require some refactoring.


On 14 March 2014 at 18:16 Oskar van Rest commented:

I finally get Eclipse now. There was actually another call to the PropertySheetCategory constructor that I missed.

But not to get into too much detail: the default properties view allows you to have multiple categories at the top level and these categories can be expanded by default.
This means we can make the properties expand to level 2 instead of 1, which I think is fine for now. But it will be a bit hacky because the top level properties will be converted to categories while the contained properties will be converted to actual “Eclipse” properties. For example if we have the model [("p1", [("child1", "someValue"), ("child2", "someOtherValue")])] then "p1" will be a category and "child1" and "child1" will be actual properties.

There is really no way to do this in a nicer way, or we would have to change to the tabbed properties view.

Log in to post comments