Selecting connections [message #167899] |
Fri, 11 February 2005 18:10  |
Eclipse User |
|
|
|
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 #167981 is a reply to message #167934] |
Sun, 13 February 2005 17:24  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03659 seconds