click-to-select [message #89659] |
Tue, 05 August 2003 14:13  |
Eclipse User |
|
|
|
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 #89679 is a reply to message #89672] |
Tue, 05 August 2003 16:53   |
Eclipse User |
|
|
|
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 #89724 is a reply to message #89679] |
Tue, 05 August 2003 20:09  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03084 seconds