Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » WireEditPart & performRequest
WireEditPart & performRequest [message #240003] Fri, 30 November 2007 09:40 Go to next message
Eclipse UserFriend
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 #240024 is a reply to message #240003] Mon, 03 December 2007 17:06 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
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
Re: WireEditPart & performRequest [message #240076 is a reply to message #240024] Tue, 04 December 2007 04:45 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:Request Object
Next Topic:Hide/Unhide Circuit
Goto Forum:
  


Current Time: Fri Apr 26 22:53:33 GMT 2024

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

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

Back to the top