TemplateTransferDropTargetListener [message #53817] |
Sun, 12 January 2003 07:00  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02692 seconds