Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » initialize() method not propogating to child types reference via possible attribute in Type annotati
initialize() method not propogating to child types reference via possible attribute in Type annotati [message #1740007] Mon, 08 August 2016 05:11 Go to next message
Jason Pell is currently offline Jason PellFriend
Messages: 55
Registered: February 2011
Member
I have a model which basically models a xsd choice by using the following Type annotation:

@Type(base = TemplateData.class, possible = { FlatTemplateData.class, XmlTemplateData.class })
@XmlElementBinding(path = "templateData", mappings = {
@XmlElementBinding.Mapping(element = "flatTemplateData", type = FlatTemplateData.class),
@XmlElementBinding.Mapping(element = "xmlTemplateData", type = XmlTemplateData.class)
})
@Label(standard = "Template Data")
ElementProperty PROP_TEMPLATE_DATA = new ElementProperty(TYPE, "TemplateData");
ElementHandle<TemplateData> getTemplateData();

And this all works fine in the UI, except for when I call initialize() on the root type, this event is not being called on the FlatTemplateData or XmlTemplateData, so that InitialValues, etc are not being setup for an instance of FlatTemplateData or XmlTemplateData

I am working around this by explicitly calling the initialize() method on the getTemplateData().content()

Is this a bug or do I need to do something else to get the initialize process to correctly propogate to the correct child class?

[Updated on: Mon, 08 August 2016 05:11]

Report message to a moderator

Re: initialize() method not propogating to child types reference via possible attribute in Type anno [message #1740169 is a reply to message #1740007] Wed, 10 August 2016 00:45 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
The initialize() is called when a new element is added as a root or as child to an existing model. Initialization only traces down into implied element properties. Explicit element properties (like in your example) and list properties are ignored as they aren't expected to hold any content at that point.

Why do you need to call this method explicitly?
Previous Topic:Stop Column Sorter in a List Property Editor
Next Topic:Localization
Goto Forum:
  


Current Time: Sat Nov 17 23:11:21 GMT 2018

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

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

Back to the top