Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Label on @PossibleValues
Label on @PossibleValues [message #1227703] Sun, 05 January 2014 04:39 Go to next message
Andreas Weise is currently offline Andreas Weise
Messages: 37
Registered: January 2014
Member
Hi,

what do you think about adding a label feature on the Possible Value Service?

The intention of that label is to use a different property for the display value, that is not necessarily the stored value. Or a display name consists of more than just the stored value.

So the idea would be to have something like this (or with use of EL) in the Contacts sample, more specifically on org.eclipse.sapphire.samples.contacts.Connection:
    // *** Name ***
    
    @Label( standard = "name" )
    @Required
    @NoDuplicates
    
    @PossibleValues
    ( 
        property = "/Contacts/Name",
        label = "/Contacts/Name (/Contacts/Category)", 
        caseSensitive = false, 
        invalidValueMessage = "Could not find contact name \"{0}\" in the repository." 
    )

    ValueProperty PROP_NAME = new ValueProperty( TYPE, "Name" );

    Value<String> getName();
    void setName( String name );


It would show '<name> (<category>)' in the selection input field and dialog.

What do you think about it?

Andreas
Re: Label on @PossibleValues [message #1228167 is a reply to message #1227703] Mon, 06 January 2014 10:10 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 940
Registered: July 2009
Senior Member
You can implement ValueLabelService to get the desired effect.
Re: Label on @PossibleValues [message #1229187 is a reply to message #1228167] Wed, 08 January 2014 17:25 Go to previous message
Andreas Weise is currently offline Andreas Weise
Messages: 37
Registered: January 2014
Member
Yup that works. Thank you. Still in learning mode Smile
Previous Topic:Sapphire 0.8 is now Sapphire 8
Next Topic:Approach for Attaching/Detaching Listeners
Goto Forum:
  


Current Time: Fri Aug 29 04:01:51 EDT 2014

Powered by FUDForum. Page generated in 0.15918 seconds