Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Property view: overriding / dynamic grouping / expert settings
Property view: overriding / dynamic grouping / expert settings [message #1769105] Wed, 26 July 2017 14:52 Go to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 344
Registered: July 2009
Senior Member
Hi,

I am starting with addressing the means for specifying property views. Great stuff! After some first try-outs I collected three questions for actually getting started.

1. Overriding dynamic mappings

As I want to avoid defining many property rules for specific attributes for maintainability I want to start with some dynamic mappings.

As a first use case I want to customise how enums are represented. With the help of the Import Default Properties View function I could see how the default mappings are done and noticed that the sirius_default_rules_enum is responsible for that single-valued enum attributes are rendered using radio buttons.

Given I want to use select elements instead for all single-valued enums in a first step. How should this be done? I tried Extend Default Properties View and added an New Override > Radio Override element. In the Overrides tab of this element I can select sirius_default_rules_enum but then I still have radio representation. If I add a Select Override then I can not select the sirius_default_rules_enum rule for overriding. Am I overseeing something obvious?

If I want to do this override only for those attributes whose enumerations have more than let's say 3 entries in a second step, how would I do this? So enums with > 3 elements should use a dropdown list, while enums with <= 3 elements should still be rendered using radio buttons. Could the Candidates Expression be utitilised for that?

2. Dynamic grouping

I like the concept of pages and groups which allow me to divide properties into different tabs and sections. But would that require defining rules for all attributes statically? Or are there possibilities to do some kind of dynamic assignment? Particularly I am thinking about whether the property category from EMF could be (re-)used for that somehow. So in a first step I imagine one section for each EMF property category. In a second step maybe multiple pages each containing some sections based on prefixing the property categories?

3. Expert settings

EMF allows to define properties as "expert option" using property filter flags (org.eclipse.ui.views.properties.expert). It would be great to consider this in Sirius properties views, too. I saw that Sirius 5 introduced a possibility to define toolbar actions for pages and groups. Maybe this could be used to realise a similar behaviour programmatically? Another approach could be collecting all expert settings into a dedicated page/section, but this way wouldn't be that comfortable.


Thanks in advance,

Axel
Re: Property view: overriding / dynamic grouping / expert settings [message #1769246 is a reply to message #1769105] Fri, 28 July 2017 08:13 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 454
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

1. There are two ways to do this each with its advantages and drawbacks.

The first way would be to create a page with a group and a for dynamic mapping, then extend the dynamic mapping for from the default rules. In your for dynamic mapping, use a filter expression to filter the if dynamic mapping for the enumeration. It is the most efficient way to do this but if we modify the default rules, your result will be modified too (which would give you the new behavior of the default rules but that may not be what you want)

The other way would be to directly import the default rules and change the default rules directly (but if we change the behavior of the default rules, you would not see any changes)

I would not recommend using the override here. The override is an advanced mechanism created for those who want to "patch" the Properties view definition in an odesign that they do not maintain by themselves (for example if you wanted to customize the odesign of ecore tools or capella).

2. You can somewhat do that but it is quite an advanced situation. Since everything in a group and a page can be configured dynamically, you can have only one definition of a page and one of a group which can be configured to create multiple pages and groups as necessary depending on the situation. It would require playing with the semantic candidate expressions of both the page and the group along with an advanced usage of the dynamic mapping.

3. With dynamic mappings and semantic candidate expressions and preconditions you could create a basic/expert user interface, you could have preconditions in your dynamic mappings, groups and pages to show/hide widgets depending on the value of some preference (I think someone already did it depending on the current perspective). Unfortunately you cannot show/hide toolbar actions conditionally.

Regards,

Stephane Begaudeau, Obeo
Re: Property view: overriding / dynamic grouping / expert settings [message #1769251 is a reply to message #1769246] Fri, 28 July 2017 08:59 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 344
Registered: July 2009
Senior Member
Hi Stephane,

many thanks for your advice!

1. I am going to start with what you suggested and see how far I can go.

2. Very interesting. This is something I am going to play with later I guess.

3. My idea was hiding all expert settings by default and only showing them (or hiding them again) when a toolbar action has been executed. Similar like the toggle button provided by the default (tabular) properties view.

Regards,

Axel
Re: Property view: overriding / dynamic grouping / expert settings [message #1769331 is a reply to message #1769251] Sat, 29 July 2017 18:37 Go to previous message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 344
Registered: July 2009
Senior Member
Hi again,

I gave up the demand for doing everything with dynamic mappings, since it just became too complex and frustrating. Nevertheless I got properties working like desired. Thank you very much again for this fantastic feature.

By the way: for simulating expert settings I just added dedicated groups which are collapsed by default and positioned at the bottom of the corresponding pages.

Regards,

Axel
Previous Topic:[RESOLVED] Variable label icons
Next Topic:[RESOLVED] Conditional label
Goto Forum:
  


Current Time: Thu Apr 02 23:28:53 GMT 2020

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

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

Back to the top