Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How can I pass drop target information to the CreateFactory?
How can I pass drop target information to the CreateFactory? [message #236403] Wed, 27 June 2007 14:16 Go to next message
Eclipse UserFriend
Originally posted by: jfolap.gmail.com

Hello,

I am new to GEF and am still discovering the framework. I hope that someone
can point me in the right direction on the following:

My visualization is container based. When a user drops an item on the
canvas the parent is the item the drop occurs on. Logic controlling which
items certain tools can be dropped on are controlled by my commands
(following the suggestion in a May 11th post titlel "Re: DND: How to get
dragged item before it is dropped?").

The problem involves my underlying model. The construction of my model
objects require the parent at construction time. I don't see how to pass
drop information (i.e. the editpart and hence the model object the drop
occurs on) to my CreationFactory. It seems that the EditPolicy knows a lot
about where the drop occured but I can't figure out how to provide that
knowledge back to my CreationFactory. I looked into adding the information
to the request (Request.setExtendedData) but don't know how to make that
available to my CreationFactory.


I assume I am going about this wrong and would be greatful if someone
straightened me out.


Thank you,
Re: How can I pass drop target information to the CreateFactory? [message #236519 is a reply to message #236403] Fri, 29 June 2007 21:29 Go to previous message
Eclipse UserFriend
Originally posted by: jfolap.gmail.com

I found time to study the framework and believe I know how to do this.
Please let me know if it is inappropriate:



1) Modified my CreationFactory to offer a setParent thus providing the
necessary information for my model object construction.

2) Extended CreationRequest exposing a method to set the parent on my
factory

3) Override createTargetRequest in my TemplateTransferDropTargetListener to
create my extended CreationRequest.

4) Override updateTargetEditPart in my TemplateTransferDropTargetListener to
set the parent on my request.





"john" <jfolap@gmail.com> wrote in message
news:f5trge$o4u$1@build.eclipse.org...
> Hello,
>
> I am new to GEF and am still discovering the framework. I hope that
> someone can point me in the right direction on the following:
>
> My visualization is container based. When a user drops an item on the
> canvas the parent is the item the drop occurs on. Logic controlling which
> items certain tools can be dropped on are controlled by my commands
> (following the suggestion in a May 11th post titlel "Re: DND: How to get
> dragged item before it is dropped?").
>
> The problem involves my underlying model. The construction of my model
> objects require the parent at construction time. I don't see how to pass
> drop information (i.e. the editpart and hence the model object the drop
> occurs on) to my CreationFactory. It seems that the EditPolicy knows a
> lot about where the drop occured but I can't figure out how to provide
> that knowledge back to my CreationFactory. I looked into adding the
> information to the request (Request.setExtendedData) but don't know how to
> make that available to my CreationFactory.
>
>
> I assume I am going about this wrong and would be greatful if someone
> straightened me out.
>
>
> Thank you,
>
>
Previous Topic:How can it be done.
Next Topic:TextFlow
Goto Forum:
  


Current Time: Tue Aug 09 14:52:49 GMT 2022

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

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

Back to the top