Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Enforce Rendering of Instance based PossibleValuesService like with Context Metamodel
Enforce Rendering of Instance based PossibleValuesService like with Context Metamodel [message #1238180] Fri, 31 January 2014 15:32 Go to next message
Andreas Weise is currently offline Andreas WeiseFriend
Messages: 37
Registered: January 2014
Member
There is some rendering magic happening in the background, and I would like to understand how it works.

@Service(impl = LanguagePossibleValueService.class, context = Service.Context.INSTANCE)
index.php/fa/17388/0/

@Service(impl = LanguagePossibleValueService.class, context = Service.Context.METAMODEL)
index.php/fa/17389/0/

Is there any hint available to enforce METAMODEL rendering? Or another way to use this rendering mode.

[Updated on: Fri, 31 January 2014 15:37]

Report message to a moderator

Re: Enforce Rendering of Instance based PossibleValuesService like with Context Metamodel [message #1238235 is a reply to message #1238180] Fri, 31 January 2014 19:12 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
When rendering the left side of the slush bucket, only the list property instance is available. So it must be able to access the PossibleValueService from either the list property's instance context or from the entry value property's metamodel context. In contrast, the standard table presentation has the list entry instance when you activate the cell editor and click on the browse button, so it is able to work in the case where PossibleValueService is attached at entry value property's instance level.

Typically, in cases like this, the PossibleValueService implementation needs to access the broader model, not the list entry instance, so moving @Service declaration from the entry value property to the list property would be fine for the implementation and allow you to benefit from slush bucket and checkbox list presentations.

Hope this made sense... Don't hesitate to ask for clarification.
Re: Enforce Rendering of Instance based PossibleValuesService like with Context Metamodel [message #1238277 is a reply to message #1238235] Fri, 31 January 2014 22:02 Go to previous messageGo to next message
Andreas Weise is currently offline Andreas WeiseFriend
Messages: 37
Registered: January 2014
Member
Yes sounds clear. Thanks. That was just hard to figure out with current samples/docu.

One follow up question: How does Sapphire derive whether to use slush bucket or checkbox presentation?

edit: adding the 'checkbox.layout' hint on neither list property nor value property within the list enables the checkbox presentation.

Or is the checkbox presentation only available for boolean values. Wouldn't it make sense to also provide it for properties having a PossibleValuesServices (with small amount of values).

[Updated on: Sun, 02 February 2014 10:33]

Report message to a moderator

Re: Enforce Rendering of Instance based PossibleValuesService like with Context Metamodel [message #1239210 is a reply to message #1238277] Mon, 03 February 2014 16:46 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Quote:
Yes sounds clear. Thanks. That was just hard to figure out with current samples/docu.


We could use a chapter in the documentation covering all the different property editor presentations along with their capabilities and restrictions. Could you open an enhancement request?

Quote:
How does Sapphire derive whether to use slush bucket or checkbox presentation?


The checkbox list layout does not activate based on a heuristic. You have to specify it using the factory hint.

<hint>
    <name>factory</name>
    <value>CheckBoxListPropertyEditorPresentation$Factory</value>
</hint>


There is an example in the Sapphire Gallery sample under List Properties -> Multi-Select

Quote:
Or is the checkbox presentation only available for boolean values. Wouldn't it make sense to also provide it for properties having a PossibleValuesServices (with small amount of values).


There is support for a checkbox list, but you are talking about a group of checkboxes. I can see such presentation being useful in some cases. Could you open an enhancement request?
Previous Topic:Sapphire 8 IP Log Deadline
Next Topic:Apply read.only to cells at runtime
Goto Forum:
  


Current Time: Sat Dec 07 14:58:20 GMT 2024

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

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

Back to the top