Populating palette via XML file [message #183345] |
Wed, 01 June 2005 18:00 |
Eclipse User |
|
|
|
Originally posted by: harsh.ti.com
All,
I have the component that I want displayed in the palette defined in an
XML somewhere. I want to utilize CombinedTemplateCreationEntry to create
instances of the object and act as Drag sources. However, he is the
catch, each Component tag that I have in the XML file contains additional
information such as the icon to use, the Figure class to instanciate, the
initial dimensions of the figure object in the edit part viewer, and the
model object class. So I have parsed this information into XMLObject types
The question is in the CombinedTemplateCreationEntry, it asks for a
template object and a creation factory (which is suppose to instantiate
the model object). In all the examples I have seen, the template object
and the object passed into the creation factory is the same (I.e the model
object). However, what shall I do in my case? Do I set the template
object to be the XMLObject and then pass in XMLObject.ModelObject.class to
the creation factory?
Thank you in advance.
|
|
|
|
Re: Populating palette via XML file [message #183393 is a reply to message #183385] |
Thu, 02 June 2005 11:36 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
It should have been "can be used by the CreationFactory in whatever
way you like", not "cannot ...". Sorry.
On Thu, 02 Jun 2005 09:14:09 +0200, Hallvard Trætteberg
<hal@idi.ntnu.no> wrote:
>The template (type) and object cannot be used by the CreationFactory
>in whatever way you like, typically to control and delay the actual
>instantiation, in cooperation with the edit policy and the command
>that handles the create request. I have an application where the
>template objects are read from a library/template file (EMF XMI) file.
>The type handed to CreationFactory is just the name of the part of the
>library to looup in and the object is the name of the prototype
>object. My command finally clones this object at the latest possible
>time.
>
>On Wed, 1 Jun 2005 18:00:44 +0000 (UTC), harsh@ti.com (Harsh Sabikhi)
>wrote:
>
>>The question is in the CombinedTemplateCreationEntry, it asks for a
>>template object and a creation factory (which is suppose to instantiate
>>the model object). In all the examples I have seen, the template object
>>and the object passed into the creation factory is the same (I.e the model
>>object). However, what shall I do in my case? Do I set the template
>>object to be the XMLObject and then pass in XMLObject.ModelObject.class to
>>the creation factory?
>>
>>Thank you in advance.
|
|
|
Re: Populating palette via XML file [message #183401 is a reply to message #183393] |
Thu, 02 June 2005 13:46 |
Eclipse User |
|
|
|
Originally posted by: harsh.ti.com
Thank you for your response.
So what you are saying is since I have already all the information I need
in my XMLObject, for the time being, just pass in any dummy/unique ID to
the CreationFactory and then actually instantiate the object myself in the
Command?
As for the other attributes I need for the Edit Part viewer, just use them
directly from the XMLObject as needed.
Harsh
|
|
|
Powered by
FUDForum. Page generated in 0.03808 seconds