Skip to main content



      Home
Home » Eclipse Projects » GEF » Selecting connections
Selecting connections [message #167899] Fri, 11 February 2005 18:10 Go to next message
Eclipse UserFriend
I am writing a simple graphical editor based on the Workflow example. I
can create nodes and connections, but I can not select the connections
to (for example) delete them. I have a ConnectionEndpointEditPolicy
installed for the connection edit part (with the
CONNECTION_ENDPOINTS_ROLE) but its addSelectionHandles method is not
being called. I also have a SelectionHandlesEditPolicy but its
createSelectionHandles method isn't being called either. What else is
controlling the connection selection?

Thanks,
Barry
Re: Selecting connections [message #167934 is a reply to message #167899] Sat, 12 February 2005 07:08 Go to previous messageGo to next message
Eclipse UserFriend
Barry,

Install an EditPolicy extended from ConnectionEditPolicy.

Install the policy for the CONNECTION_ROLE and not the
CONNECTION_ENDPOINTS_ROLE.

Hope this helps,
Brian.
Barry Lay wrote:

> I am writing a simple graphical editor based on the Workflow example. I
> can create nodes and connections, but I can not select the connections
> to (for example) delete them. I have a ConnectionEndpointEditPolicy
> installed for the connection edit part (with the
> CONNECTION_ENDPOINTS_ROLE) but its addSelectionHandles method is not
> being called. I also have a SelectionHandlesEditPolicy but its
> createSelectionHandles method isn't being called either. What else is
> controlling the connection selection?

> Thanks,
> Barry
Re: Selecting connections [message #167974 is a reply to message #167899] Sun, 13 February 2005 16:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

>I am writing a simple graphical editor based on the Workflow example. I
>can create nodes and connections, but I can not select the connections to
>(for example) delete them. I have a ConnectionEndpointEditPolicy

Is the editpart#setSeleced called?

Find out if the connection is being targeted first. Put a breakpoint with a
counter of like 100 on it in updateTargetUnderMouse for selectiontool. Then
step into it and find out which editpart the selection tool is over.

> installed for the connection edit part (with the
> CONNECTION_ENDPOINTS_ROLE) but its addSelectionHandles method is not being
> called. I also have a SelectionHandlesEditPolicy but its
> createSelectionHandles method isn't being called either. What else is
> controlling the connection selection?
>
> Thanks,
> Barry
Re: Selecting connections [message #167981 is a reply to message #167934] Sun, 13 February 2005 17:24 Go to previous message
Eclipse UserFriend
Brian Fernandes wrote:
> Barry,
>
> Install an EditPolicy extended from ConnectionEditPolicy.
>
> Install the policy for the CONNECTION_ROLE and not the
> CONNECTION_ENDPOINTS_ROLE.
>
> Hope this helps,
> Brian.

Brian,

Thanks. As it happens I do have a ConnectionEditPolicy as well for the
CONNECTION_ROLE. It just implements the getDeleteCommand at present. I
had discounted it as the documentation suggests that it isn't used for
graphical selection.

It turns out that the problem was more subtle. Somehow I had managed to
create a null implementation of getDragTracker in my connection edit
part (beware Source->Override/Implement Methods...), which pretty
effectively stops the SelectionTool from selecting the part. I now have
a much better understanding of how the selection process works...

Barry
Re: Selecting connections [message #168098 is a reply to message #167899] Sat, 12 February 2005 02:30 Go to previous message
Eclipse UserFriend
How is your EditPart different from the ConnectionEditPart in the Shapes
example? You can set a breakpoint in ConnectionEndpointEditPolicy in the
Shapes example and see when its createSelectionHandles() method is being
called, and then you might be able to trace why it's not happening in your
case.

"Barry Lay" <blay@laysercomputing.com> wrote in message
news:cuje0d$hhf$1@www.eclipse.org...
> I am writing a simple graphical editor based on the Workflow example. I
> can create nodes and connections, but I can not select the connections
> to (for example) delete them. I have a ConnectionEndpointEditPolicy
> installed for the connection edit part (with the
> CONNECTION_ENDPOINTS_ROLE) but its addSelectionHandles method is not
> being called. I also have a SelectionHandlesEditPolicy but its
> createSelectionHandles method isn't being called either. What else is
> controlling the connection selection?
>
> Thanks,
> Barry
Previous Topic:2 different content panes
Next Topic:Moving Figure, SHIFT or CTRL key is down
Goto Forum:
  


Current Time: Sun Jun 01 03:50:47 EDT 2025

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

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

Back to the top