Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] New topic in forum Sapphire, called Using ListProperty for attribute of an element, by Justin Albright

Title: Eclipse Community Forums
Subject: Using ListProperty for attribute of an element Author: Justin Albright Date: Wed, 16 September 2015 15:03
I am attempting to use a ListProperty to create a list of strings as an attribute of an xml element. The goal is to be able to create an xml that resembles the following

<Property Name="some string" ... Enums="one, two, three"/>


When I attempt to use the ListProperty it is expecting an element type for Property and I have been able to successfully create this...

<Property Name="thisisaprop">
            <Enum>one</Enum>
            <Enum>two</Enum>
            <Enum>three</Enum>
</Property>


but I somehow need to get the enums as a single string as an attribute of Property.

To get to what I have now my code is...

// *** Enums ***
@Type( base = PropertyEnum.class )
@XmlListBinding( mappings = @XmlListBinding.Mapping( element = "Enum", type = PropertyEnum.class ) )
@Label(standard = "Enums")
	
ListProperty PROP_ENUMS = new ListProperty( TYPE, "Enums" );

ElementList<PropertyEnum> getEnums();


If it is not possible to do it this way, is it possible to somehow use the ListProperty widget that gets generated to create a single string. I really would just like to use the widget because it is easier for the user, but need to adhere to the framework's xml schema for the Enums attribute.

Any help is much appreciated, thank you.
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top