double-click and changing selection programmatically [message #196233] |
Fri, 16 September 2005 20:02  |
Eclipse User |
|
|
|
Originally posted by: no.yes.maybe
I'll try to rephrase a problem I already posted earlier to make it more
understandable.
I have a diagram editor. When the user double-clicks on a node I want to
programmatically select a different node (I know it sounds weird, but it
makes sense in my app).
I implemented performRequest(Request r) so that if the request is of
type REQ_OPEN I call viewer.setSelection(new
StructuredSelection(otherEditPart));
What happens is that after otherEditPart is selected, the selection
returns on the original node the used double-clicked on. I believe
that's because a selection event is posted due to the clicking on such
node.
Any suggestions on how to achieve the desired functionality?
Thanks,
Roberto
|
|
|
|
|
|
Re: double-click and changing selection programmatically [message #198446 is a reply to message #196233] |
Tue, 11 October 2005 23:38  |
Eclipse User |
|
|
|
Hi, roberto,
I'm developing a plugin with a graphic model viewer, very similiar to your
work.
The Outline view shows a hierarchycal model. Double-click on the diagram
nodes will "navigate" them
by showing the children of the nodes in main viewer.
I implimented hierarchycal view by modifying the famous Shape:
1. adding field "children" and getChildren() for Shape
2. adding GetModelChildren() for shapeTreeEditPart
The ouline view can show the tree.
My problem is that I can't catch double-click and selection message.
In the shapeTreeEditPart.performRequest(Request r),
I couldn't get the message of the type REQ_OPEN and REQ_SELECTION.
Do you by any chance know why is that?
Thanks!
Miaohua Xu
"roberto" <no@yes.maybe> wrote in message
news:dgfmcs$voo$1@news.eclipse.org...
> I'll try to rephrase a problem I already posted earlier to make it more
> understandable.
>
> I have a diagram editor. When the user double-clicks on a node I want to
> programmatically select a different node (I know it sounds weird, but it
> makes sense in my app).
>
> I implemented performRequest(Request r) so that if the request is of type
> REQ_OPEN I call viewer.setSelection(new
> StructuredSelection(otherEditPart));
>
> What happens is that after otherEditPart is selected, the selection
> returns on the original node the used double-clicked on. I believe that's
> because a selection event is posted due to the clicking on such node.
>
> Any suggestions on how to achieve the desired functionality?
>
> Thanks,
> Roberto
|
|
|
Powered by
FUDForum. Page generated in 0.03751 seconds