Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Label on @PossibleValues
Label on @PossibleValues [message #1227703] Sun, 05 January 2014 09:39 Go to next message
Andreas Weise is currently offline Andreas WeiseFriend
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 15:10 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
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 22:25 Go to previous message
Andreas Weise is currently offline Andreas WeiseFriend
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: Sat Apr 20 03:09:37 GMT 2024

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

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

Back to the top