|
|
|
Re: deleting child in one class deletes this child in all classes [message #425540 is a reply to message #425534] |
Mon, 01 December 2008 11:19 |
Ed Merks Messages: 33133 Registered: July 2009 |
Senior Member |
|
|
Summer,
Comments below.
Summer wrote:
> No it doesnŽt work, but I think I got a solution to find out where I
> am in my tree and then specialize which object to be deleted.
>
> Something like this:
>
> TreeSelection selectT =
> (TreeSelection)this.selectionProvider.getSelection();
>
>
> int u = selectT.getPaths()[0].getSegmentCount();
>
> .... and so on
>
> but do you know how or where I can ask me key events?? In that way
> that my object canŽt be deleted by keyboard,too?
I don't think you should be hooking directly into the key events. If
you create wrappers, it should be possible to specialize the behavior of
the editing domain's creation of the DeleteCommand so if you delete a
wrapper, it doesn't delete the underlying object but simply removes it
from its "parent". Remember that things like getParent on the item
provider should return the proper parent in the tree, so if you set this
up properly, the specialized wrapper item provider will know where in
the tree its located.
>
> I hope I made myself passably understood.?
Yes, but interacting directly with the underlying widgets and key events
if far from ideal.
>
> Thanks in advance
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.01718 seconds