Possible types' labels [message #762615] |
Thu, 08 December 2011 11:52  |
Roded Bahat Messages: 152 Registered: August 2011 |
Senior Member |
|
|
Hi,
I have the following property defined:
// *** Value ***
@Required
@Label(standard = "Value")
@Type ( base = IValue.class,
possible = {
IXSDConstant.class,
IXSDChoice.class
}
)
@XmlElementBinding (
mappings = {
@XmlElementBinding.Mapping( element = "constant", type = IXSDConstant.class ),
@XmlElementBinding.Mapping( element = "choice", type = IXSDChoice.class )
}
)
ElementProperty PROP_VALUE = new ElementProperty(TYPE, "Value");
ModelElementHandle<IValue> getValue();
And a node factory under the parent element which contains a case for both possible type.
When running the application and right clicking the parent element in order to add a "Value" node under it, the possible types options show as the class names (i.e. "I X S D Constant" and "I X S D Choice").
Where exactly should I set the label so that the possible types will show as labels and not class names?
Thanks,
Roded
|
|
|
|
|
|
Re: Possible types' labels [message #765350 is a reply to message #765233] |
Tue, 13 December 2011 22:22   |
Konstantin Komissarchik Messages: 1077 Registered: July 2009 |
Senior Member |
|
|
Quote:Why not use the node factory case's label?
That label is for the instance of the node and typically uses an expr with references to properties in a given element instance. The add action label references the element type.
Quote:I have a case where I allow 2 children of type IValue under a node so I include the relevant node factory twice.
Problem is, that when adding the nodes, there's not telling the difference between them..
In cases where mixing multiple factories / list properties directly under a single node is confusing, intermediary nodes can be used to establish context...
Instead of...
use...
[Updated on: Tue, 13 December 2011 22:23] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01611 seconds