Skip to main content



      Home
Home » Eclipse Projects » GEF » TemplateTransferDropTargetListener
TemplateTransferDropTargetListener [message #53817] Sun, 12 January 2003 07:00 Go to next message
Eclipse UserFriend
I want to be able to restrict what templates can be dropped on what targets,
but I'm not sure of the best way to do this.

GEF is implemented so that a drop is enabled if any EditPart is at the
current position, but I need to be able to change this behaviour.

One option would be to override
AbstractTransferDropTargetListener#isEnabled() and then check the edit
policy for the target.

Is this the best approach or are there a better methods.

Thanks,

John.
Re: TemplateTransferDropTargetListener [message #54026 is a reply to message #53817] Sun, 12 January 2003 14:51 Go to previous message
Eclipse UserFriend
You could override getTargetEditPart(Request) in your layout edit policy (i.e.
LogicXYLayoutEditPolicy). If the request type is REQ_CREATE, then you could look at the host and
the template and return null if they don't match up. Otherwise, delegate to
super.getTargetEditPart(Request).

Eric


John Howard wrote:
> I want to be able to restrict what templates can be dropped on what targets,
> but I'm not sure of the best way to do this.
>
> GEF is implemented so that a drop is enabled if any EditPart is at the
> current position, but I need to be able to change this behaviour.
>
> One option would be to override
> AbstractTransferDropTargetListener#isEnabled() and then check the edit
> policy for the target.
>
> Is this the best approach or are there a better methods.
>
> Thanks,
>
> John.
>
>
Previous Topic:How create a File extension in gef to GEF Editor
Next Topic:ConnectionLayer in GEF
Goto Forum:
  


Current Time: Mon Jun 09 08:03:48 EDT 2025

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

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

Back to the top