Skip to main content



      Home
Home » Eclipse Projects » GEF » click-to-select
click-to-select [message #89659] Tue, 05 August 2003 14:13 Go to next message
Eclipse UserFriend
Originally posted by: rahul.dhar.intel.com

I noticed that the logic editor allows components to be selected simply by
clicking on them. This is after they have been placed on the drawing
area. I am trying to duplicate this functionality, as the I currently
need to drag a selection box around the component I want to select. Which
GEF class provides this? Alternately, which section of the logic editor
takes care of this?

Thanks,
-Rahul
Re: click-to-select [message #89672 is a reply to message #89659] Tue, 05 August 2003 15:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: delee.ATus.DOTibm.com

You have to install an EditPolicy on your EditPart that extends
SelectionEditPolicy. Take a look at NonResizableEditPolicy. This EditPolicy
shows selection by drawing four square handles at each corner of the edit
part's Figure, and drawing a 1-pixel line border around it. (In the Logic
Example, this EditPolicy is added to LEDEditPart, OutputEditPart, and
LogicLabelEditPart in createChildEditPolicy of LogicXYLayoutEditPolicy).

Rahul Dhar wrote:

> I noticed that the logic editor allows components to be selected simply by
> clicking on them. This is after they have been placed on the drawing
> area. I am trying to duplicate this functionality, as the I currently
> need to drag a selection box around the component I want to select. Which
> GEF class provides this? Alternately, which section of the logic editor
> takes care of this?

> Thanks,
> -Rahul
Re: click-to-select [message #89679 is a reply to message #89672] Tue, 05 August 2003 16:53 Go to previous messageGo to next message
Eclipse UserFriend
As long as you have a LayoutEditPolicy installed on the container edit part, you
should get the appropriate child edit policy that Dan mentioned. If your
container edit part has a subclass of OrderedLayoutEditPolicy installed, its
child edit parts will get a NonResizableEditPolicy by default. If your
container edit part has a subclass of ConstrainedLayoutEditPolicy installed, its
child edit parts will get a ResizableEditPolicy by default.

You also want to be sure you have the SelectionTool active. Try putting a
breakpoint in SelectEditPartTracker.performSelection() (the SelectionTool should
have a subclass of SelectEditPartTracker as its DragTracker) and see if it gets
hit.

Eric


Dan Lee wrote:
> You have to install an EditPolicy on your EditPart that extends
> SelectionEditPolicy. Take a look at NonResizableEditPolicy. This EditPolicy
> shows selection by drawing four square handles at each corner of the edit
> part's Figure, and drawing a 1-pixel line border around it. (In the Logic
> Example, this EditPolicy is added to LEDEditPart, OutputEditPart, and
> LogicLabelEditPart in createChildEditPolicy of LogicXYLayoutEditPolicy).
>
> Rahul Dhar wrote:
>
>
>>I noticed that the logic editor allows components to be selected simply by
>>clicking on them. This is after they have been placed on the drawing
>>area. I am trying to duplicate this functionality, as the I currently
>>need to drag a selection box around the component I want to select. Which
>>GEF class provides this? Alternately, which section of the logic editor
>>takes care of this?
>
>
>>Thanks,
>>-Rahul
>
>
>
Re: click-to-select [message #89694 is a reply to message #89659] Tue, 05 August 2003 17:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The class is SelectEditPartTracker, which is returned when
getDragTracker(Request req) is called, and the request type is
REQ_SELECTION.

"Rahul Dhar" <rahul.dhar@intel.com> wrote in message
news:bgos57$tgp$1@eclipse.org...
> I noticed that the logic editor allows components to be selected simply by
> clicking on them. This is after they have been placed on the drawing
> area. I am trying to duplicate this functionality, as the I currently
> need to drag a selection box around the component I want to select. Which
> GEF class provides this? Alternately, which section of the logic editor
> takes care of this?
>
> Thanks,
> -Rahul
>
Re: click-to-select [message #89724 is a reply to message #89679] Tue, 05 August 2003 20:09 Go to previous message
Eclipse UserFriend
Originally posted by: rahul.dhar.intel.com

Eric Bordeau wrote:
>
> You also want to be sure you have the SelectionTool active. Try putting a
> breakpoint in SelectEditPartTracker.performSelection() (the SelectionTool
should
> have a subclass of SelectEditPartTracker as its DragTracker) and see if it
gets
> hit.

It seems that SelectionTool isn't active. In my palette, I have a
SelectionToolEntry, which I though would activate the SelectionTool when I
select it. This doesn't seem to be the case, or perhaps I'm overriding
this behaviour somewhere. Do I need to explicity work with SelectionTool,
or should SelectionToolEntry take care of it for me?

-Rahul
Previous Topic:EMF+GEF integration documentation/examples/redbook
Next Topic:What's the recommended method for deleting child edit parts?
Goto Forum:
  


Current Time: Thu Jun 05 15:35:18 EDT 2025

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

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

Back to the top