Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » SelectionTool - something like a "selection changed" event/request?
SelectionTool - something like a "selection changed" event/request? [message #158154] Tue, 16 November 2004 20:32 Go to next message
Eclipse UserFriend
Originally posted by: iwan.global.co.za

Hello,

Supposing a user clicks on something with the selection tool active - does
it generate a request? I need somehow to intercept such an event.

I am struggling to find some sort of definitive document describing what
events the SelectionTool reacts on, and what Requests it generates for
each. Is there something like this out there?

-i
Re: SelectionTool - something like a "selection changed" event/request? [message #158195 is a reply to message #158154] Wed, 17 November 2004 00:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: caniszc.us.ibm.com

Iwan Vosloo wrote:
> Hello,
>
> Supposing a user clicks on something with the selection tool active -
> does it generate a request? I need somehow to intercept such an event.
>
> I am struggling to find some sort of definitive document describing what
> events the SelectionTool reacts on, and what Requests it generates for
> each. Is there something like this out there?
>
> -i
>

/**
* @see org.eclipse.gef.EditPart#setSelected(int)
*/
public void setSelected(int value) {
super.setSelected(value);
}

To deal with object specific selections I override that method. I
specifically use it to add highlights to my editparts when they are
selected. Is this the best way to do it? Not sure, so if any GEF
developers want to give a better idea how to deal with this, go for it!

Peace,

~ Chris
Re: SelectionTool - something like a "selection changed" event/request? [message #158219 is a reply to message #158154] Wed, 17 November 2004 02:43 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
No, it selects that editpart (and invokes setSelected(SELECTED_PRIMARY) on
that EditPart), unless it was already selected (in which case you get a
DIRECT_EDIT request). What do you want to do instead?

"Iwan Vosloo" <iwan@global.co.za> wrote in message
news:cndo4r$it0$1@www.eclipse.org...
> Hello,
>
> Supposing a user clicks on something with the selection tool active - does
> it generate a request? I need somehow to intercept such an event.
>
> I am struggling to find some sort of definitive document describing what
> events the SelectionTool reacts on, and what Requests it generates for
> each. Is there something like this out there?
>
> -i
>
Re: SelectionTool - something like a "selection changed" event/request? [message #158227 is a reply to message #158195] Wed, 17 November 2004 02:50 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
"Chris Aniszczyk" <caniszc@us.ibm.com> wrote in message
news:cne738$9hq$1@www.eclipse.org...
> Iwan Vosloo wrote:
> > Hello,
> >
> > Supposing a user clicks on something with the selection tool active -
> > does it generate a request? I need somehow to intercept such an event.
> >
> > I am struggling to find some sort of definitive document describing what
> > events the SelectionTool reacts on, and what Requests it generates for
> > each. Is there something like this out there?
> >
> > -i
> >
>
> /**
> * @see org.eclipse.gef.EditPart#setSelected(int)
> */
> public void setSelected(int value) {
> super.setSelected(value);
> }
>
> To deal with object specific selections I override that method. I
> specifically use it to add highlights to my editparts when they are
> selected. Is this the best way to do it? Not sure, so if any GEF
> developers want to give a better idea how to deal with this, go for it!
>


You should have a SelectionEditPolicy installed on the EditPart (which you
probably already have) and should override its showSelection() and
hideSelection() methods.

> Peace,
>
> ~ Chris
Re: SelectionTool - something like a "selection changed" event/request? [message #158349 is a reply to message #158154] Wed, 17 November 2004 18:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

See the earlier post
"Iwan Vosloo" <iwan@global.co.za> wrote in message
news:cndo4r$it0$1@www.eclipse.org...
> Hello,
>
> Supposing a user clicks on something with the selection tool active - does
> it generate a request? I need somehow to intercept such an event.
>
> I am struggling to find some sort of definitive document describing what
> events the SelectionTool reacts on, and what Requests it generates for
> each. Is there something like this out there?
>
> -i
>
Re: SelectionTool - something like a "selection changed" event/request? [message #158449 is a reply to message #158227] Thu, 18 November 2004 11:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: iwan.global.co.za

Hi,

thanks to all (and Randy's reply on my earlier post). I have also found
setSelected and proceeded to use it, although I was a bit uncomfortable
with the idea. A SelectionEditPolicy seems to be the proper answer then -
I have looked for it and could not find it though :-), so I will revisit
the issue.

-i

Pratik Shah wrote:
> You should have a SelectionEditPolicy installed on the EditPart (which you
> probably already have) and should override its showSelection() and
> hideSelection() methods.
Re: SelectionTool - something like a "selection changed" event/request? [message #158455 is a reply to message #158227] Thu, 18 November 2004 13:06 Go to previous message
Eclipse UserFriend
Originally posted by: jojo.virtutech.se

"Pratik Shah" <ppshah@us.ibm.com> writes:

> You should have a SelectionEditPolicy installed on the EditPart (which you
> probably already have) and should override its showSelection() and
> hideSelection() methods.

What role should I use when installing it?

--
/Jesper
Previous Topic:Lines disappearing on grid
Next Topic:export GEF diagram as jpg
Goto Forum:
  


Current Time: Sat Apr 27 01:28:52 GMT 2024

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

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

Back to the top