Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Invoking model constructors with arguments
Invoking model constructors with arguments [message #158999] Mon, 22 November 2004 05:41 Go to next message
Eclipse UserFriend
Originally posted by: ranjit.notMyId.com

Hi,

I am trying to modify Randy's flow example to an existing workflow model
I have. So far I have been able to take care of part creation for all my
model elements and I can successfully drag drop them on the main
container (MainWFContainer).
However one of the problems I am having is that all my contained model
classes refer to the base model class (MainWFContainer). In the
standalone version I passed it as an argument in the constructors and I
have these constructors in place. However I am unable to invoke these
constructors when adapting the flow example. Every time the empty
constructor is called.
If I am correct, the new model instances are get created in the
FlowElementFactory class. However every time a item is drag and dropped,
the FlowTemplateTransferDropTargetListener creates a new instance of the
FlowElementFactory.
How & where can I save a reference of the base model class and then pass
it as a parameter in the createInstance calls for all the model classes?

Thanks.
Re: Invoking model constructors with arguments [message #159049 is a reply to message #158999] Mon, 22 November 2004 15:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Ranjit wrote:
> Hi,
>
> I am trying to modify Randy's flow example to an existing workflow model
> I have. So far I have been able to take care of part creation for all my
> model elements and I can successfully drag drop them on the main
> container (MainWFContainer).
> However one of the problems I am having is that all my contained model
> classes refer to the base model class (MainWFContainer). In the
> standalone version I passed it as an argument in the constructors and I
> have these constructors in place. However I am unable to invoke these
> constructors when adapting the flow example. Every time the empty
> constructor is called.
> If I am correct, the new model instances are get created in the
> FlowElementFactory class. However every time a item is drag and dropped,
> the FlowTemplateTransferDropTargetListener creates a new instance of the
> FlowElementFactory.
> How & where can I save a reference of the base model class and then pass
> it as a parameter in the createInstance calls for all the model classes?
>
> Thanks.


You seem to be mixing the notion of container with that of being a base
class. A base class can be created and added within the factory. A
container class reference can be added when the class is dropped into
the container.

--
Respectfully,


CL Gilbert

"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber."

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D

For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
Re: Invoking model constructors with arguments [message #159065 is a reply to message #159049] Mon, 22 November 2004 17:23 Go to previous message
Eclipse UserFriend
Originally posted by: ranjit.notMyId.com

"CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
news:cnt2c4$omi$1@www.eclipse.org...
> Ranjit wrote:
>> Hi,
>>
>> I am trying to modify Randy's flow example to an existing workflow model
>> I have. So far I have been able to take care of part creation for all my
>> model elements and I can successfully drag drop them on the main
>> container (MainWFContainer).
>> However one of the problems I am having is that all my contained model
>> classes refer to the base model class (MainWFContainer). In the
>> standalone version I passed it as an argument in the constructors and I
>> have these constructors in place. However I am unable to invoke these
>> constructors when adapting the flow example. Every time the empty
>> constructor is called.
>> If I am correct, the new model instances are get created in the
>> FlowElementFactory class. However every time a item is drag and dropped,
>> the FlowTemplateTransferDropTargetListener creates a new instance of the
>> FlowElementFactory.
>> How & where can I save a reference of the base model class and then pass
>> it as a parameter in the createInstance calls for all the model classes?
>>
>> Thanks.
>
>
> You seem to be mixing the notion of container with that of being a base
> class. A base class can be created and added within the factory. A
> container class reference can be added when the class is dropped into the
> container.
>

Sorry if I sounded too confusing. You are right, I indeed meant container
reference to be passed in the constructor. Today morning on my way to school
I too thought that I should try out adding the container reference in the
addChild method of the container class. Will try it out today.

Thanks CL
Previous Topic:DirectedGraph with non-rectangles
Next Topic:Multipage editor with multiple palette
Goto Forum:
  


Current Time: Fri Apr 19 00:00:39 GMT 2024

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

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

Back to the top