Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Populating palette via XML file
Populating palette via XML file [message #183345] Wed, 01 June 2005 18:00 Go to next message
Eclipse UserFriend
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 #183385 is a reply to message #183345] Thu, 02 June 2005 07:14 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
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 #183393 is a reply to message #183385] Thu, 02 June 2005 11:36 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:draw2d does not work in rcp
Next Topic:Underline
Goto Forum:
  


Current Time: Tue Dec 03 08:58:50 GMT 2024

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

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

Back to the top