Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Invoke a connection tool automatically
Invoke a connection tool automatically [message #212877] Thu, 30 March 2006 14:01 Go to next message
Eclipse UserFriend
Originally posted by: harsh.ti.com

All,

Here is my requirement: Given 2 Edit Parts, I need to connect them by
simply clicking on the source anchor (pin) and then the target anchor.
How can I do this?

I have already added the mouselistener interface to my edit parts figure
so I am receiving the mouse pressed events and have done the HitTest work
to make sure the user has clicked on a valid pin. Now the question is how
do I invoke the connection tool from the palette.

Thank you,
Harsh
Re: Invoke a connection tool automatically [message #212896 is a reply to message #212877] Thu, 30 March 2006 18:28 Go to previous messageGo to next message
Steven R. Shaw is currently offline Steven R. ShawFriend
Messages: 128
Registered: July 2009
Senior Member
There's no need to do this from first principles. There is a simple example
in the shapes example.

@see org.eclipse.gef.examples.shapes.parts.ShapeEditPart

Basically, the editpart needs to implement the NodeEditPart interface and
then provide an implementation of the GraphicalNodeEditPolicy on the
EditPolicy.GRAPHICAL_NODE_ROLE.

The tool entry on your palette should utilize the
ConnectionCreationToolEntry.

-Steve

"Harsh Sabikhi" <harsh@ti.com> wrote in message
news:4ed63a987dab32173d1efb6a040aee5a$1@www.eclipse.org...
> All,
>
> Here is my requirement: Given 2 Edit Parts, I need to connect them by
> simply clicking on the source anchor (pin) and then the target anchor.
> How can I do this?
>
> I have already added the mouselistener interface to my edit parts figure
> so I am receiving the mouse pressed events and have done the HitTest work
> to make sure the user has clicked on a valid pin. Now the question is how
> do I invoke the connection tool from the palette.
>
> Thank you,
> Harsh
>
Re: Invoke a connection tool automatically [message #212904 is a reply to message #212896] Thu, 30 March 2006 18:36 Go to previous message
Eclipse UserFriend
Originally posted by: harsh.ti.com

Steve,

Right now the code is doing what you have outlined. The problem is we
don't want to enable/disable the connection tool manually (I.e. by
selecting from the palette).

Harsh
Previous Topic:How to handle menus on IEditorPart
Next Topic:Zoom & different Models size
Goto Forum:
  


Current Time: Sat Jan 18 08:43:16 GMT 2025

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

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

Back to the top