How to edit a element by double-clicking the shape in the diagram editor [message #22988] |
Fri, 18 August 2006 06:23  |
Eclipse User |
|
|
|
Originally posted by: netsrujana.rediffmail.com
Hi,
I am creating shape and the subsequent element by prompting the user with a
dialog window (with attributes & references) in the diagram editor. Now I
want to invoke the dialog window to edit properties by double-clicking on a
shape.
I could see from the article "Introducing the GMF runtime", that by
double-clicking connection handles of the shapes, a pop-up window shows up
with related elements, can we override this to achieve the desired behavior.
Could some body help me out how this can be done.
regards,
Phani Kumar K.
|
|
|
Re: How to edit a element by double-clicking the shape in the diagram editor [message #23472 is a reply to message #22988] |
Fri, 18 August 2006 12:29  |
Eclipse User |
|
|
|
Phani Kumar Kotaprolu wrote:
> Hi,
>
> I am creating shape and the subsequent element by prompting the user with a
> dialog window (with attributes & references) in the diagram editor. Now I
> want to invoke the dialog window to edit properties by double-clicking on a
> shape.
>
> I could see from the article "Introducing the GMF runtime", that by
> double-clicking connection handles of the shapes, a pop-up window shows up
> with related elements, can we override this to achieve the desired behavior.
>
> Could some body help me out how this can be done.
>
> regards,
> Phani Kumar K.
>
>
Double click on shapes can be handled by using OpenEditPolicy, to add
double click handling to one of your shapes you will need to create an
edit policy that subclass OpenEditPolicy and install it on your shape
edit part like this
installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenStateEditPolicy())
then you can return the command you like by overriding the
getOpenCommand method in your edit policy
|
|
|
Powered by
FUDForum. Page generated in 0.02906 seconds