How to show a pop-up when a connection is made? [message #200555] |
Tue, 05 August 2008 14:49 |
Eclipse User |
|
|
|
Originally posted by: julan.gmail.com
Hello Guys,
Can someone please give me a brief idea how to go about this?
I want a pop-up when a connection is made from one component to another
component in my gmf diagram.
Any help will be much appreciated.
Thanks,
julan
|
|
|
|
Re: How to show a pop-up when a connection is made? [message #201030 is a reply to message #201022] |
Thu, 07 August 2008 12:23 |
Eclipse User |
|
|
|
Originally posted by: lunaris.bluemoon.gmail.com
Hi Julan,
I'm not sure how favourable this method is, but you could do this with
custom commands and edit policies.
I needed a connection that would do more than just connecting elements,
so I created a new subclass of CreateConnectionRequest detailing the
behaviour I wanted. Next I created an EditPolicy extending
GraphicalNodeEditPolicy and overrode the #getCommand(Request) method to
handle my new request type. I then installed the EditPolicy on my shape
of choice in the GRAPHICAL_NODE_ROLE.
Where your popup comes in is that #getCommand(Request) method in your
new EditPolicy. Simply create a new subclass of command whose #execute()
method throws up a dialog and does whatever you want with the results
and then return that as the result of the #getCommand(Request) call. Or,
if you want more than just that, chain it in a CompoundCommand for
similar effects.
I know I've been quite abstract, but I hope it helps.
Good luck,
Will
Julan wrote:
> Hello,
>
> Can someone please give me some hints regarding this?
>
> Thanks in advance.
>
> Julan
>
|
|
|
Powered by
FUDForum. Page generated in 0.03679 seconds