Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » double-click and changing selection programmatically
double-click and changing selection programmatically [message #196233] Sat, 17 September 2005 00:02 Go to next message
Eclipse UserFriend
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 #196280 is a reply to message #196233] Sat, 17 September 2005 10:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mvsteenbergen.eljakim.scratch-this.nl

No idea if this works, but maybe you can wrap it in a runnable and run
it on the event thread so it gets executed later?

roberto wrote:
> 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 #196316 is a reply to message #196280] Sat, 17 September 2005 16:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Right. Display.asyncExec().

"Martijn van Steenbergen" <mvsteenbergen@eljakim.scratch-this.nl> wrote in
message news:dggsol$2op$1@news.eclipse.org...
> No idea if this works, but maybe you can wrap it in a runnable and run
> it on the event thread so it gets executed later?
>
> roberto wrote:
> > 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 #196356 is a reply to message #196233] Mon, 19 September 2005 04:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This should have been fixed in 3.1.0:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=46757

and then again in 3.1.1
https://bugs.eclipse.org/bugs/show_bug.cgi?id=107752


"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
Re: double-click and changing selection programmatically [message #198446 is a reply to message #196233] Wed, 12 October 2005 03:38 Go to previous message
victor fiu is currently offline victor fiuFriend
Messages: 37
Registered: July 2009
Member
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
Previous Topic:GEF Example + Memory Usage
Next Topic:What is SelectionSynchronizer for?
Goto Forum:
  


Current Time: Wed Nov 13 14:18:35 GMT 2024

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

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

Back to the top