WireEditPart & performRequest [message #240003] |
Fri, 30 November 2007 09:40 |
Eclipse User |
|
|
|
Originally posted by: manojm.blr.interrasystems.com
Hi! All,
I have created a wireEditPart and override the method
performRequest(Request req).
I wanted to select/deselect the wire (PolylineConnection), when mouse
left button is clicked.
The code is something like following -
public void performRequest(Request req) {
if (req.getType().equals(RequestConstants.REQ_DIRECT_EDIT)) {
if (toggle == 0) {
doHighlight();
toggle = 1;
}
else {
doUnHighlight();
toggle = 0;
}
}
}
It is working, but the problem is, I need to click it twice.
Could any provide some clue?
Thanks in advance.
Manoj
|
|
|
|
Re: WireEditPart & performRequest [message #240076 is a reply to message #240024] |
Tue, 04 December 2007 04:45 |
Eclipse User |
|
|
|
Originally posted by: manojm.blr.interrasystems.com
Thanks Alex,
You are right.
I did it, by implementing draw2d MouseListener.
Thanks again for the idea.
Regards,
Manoj
Alex Boyko wrote:
> Hi,
>
> I would rather modify the SelectionEditPolicy in this case. If a
> selection request is coming in for an edit part that is already selected
> you'll remove it from selection - set the selected state to none I think
> etc.
> Hope this helps.
>
> Cheers,
> Alex
>
|
|
|
Powered by
FUDForum. Page generated in 0.03294 seconds