How to select a shape programmatically? [message #225638] |
Mon, 13 April 2009 12:07 |
Eclipse User |
|
|
|
Originally posted by: cayla_sha.gmx.net
Hello!
You all know how to select a shape with the mouse: click on it in the
diagram and then it has this black border around.
Now I want to do the same in my program-code. How can I do it?
Best wishes
Julia
|
|
|
|
Re: How to select a shape programmatically? [message #225700 is a reply to message #225668] |
Mon, 13 April 2009 17:30 |
Eclipse User |
|
|
|
Originally posted by: cayla_sha.gmx.net
Thanks a lot! :)
The only thing, what I needed to call additionally, was
viewer.getControl().setFocus();
And to make it a bit saver, I call at the end:
viewer.flush();
Byre schrieb:
> Hi,
> If you have editpart and would like to focus on editor.
>
> Steps
> 1 . EditPart editPart obtain the graphical viewer
> IDiagramGraphicalViewer viewer = editPart .getViewer();
>
> 2 . viewer.reveal(parenteditPart);//this reveals the editpart in the viewer
>
> viewer.setSelection(new StructuredSelection(parenteditPart));
> //this sets the selection on the editpart
>
> Regards
> Byre
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03170 seconds