EditPartViewer.findObjectAt problem [message #210111] |
Wed, 22 February 2006 13:56  |
Eclipse User |
|
|
|
Hey all, I'm having a problem here and was wondering if anyone could
shine some light.
I'm trying to find out what EditPart/Figure is under the cursor at any
moment.
Using EditPartViewer.findObjectAt(<point>) gives me back the root edit
part but not the specific edit part.
I've tried using EditPartViewer.findObjectAtExcluding(Point position,
Collection exclusionList, Conditional condition) in both the following
ways to specify I don't want the root edit part:
1) Giving it a List containing the root edit part that I don't want.
2) Using the following Conditional
new EditPartViewer.Conditional() {
public boolean evaluate(EditPart part) {
return part instanceof <type of part I want>;
}
}
But both of them still give me back the root.
Anyone got any ideas? I was thinking of locating the IFigure instead and
working from there, but getLightWeightSystem() is a protected method
in EditPartViewer so I can't access it.
Regards,
Kevin.
|
|
|
|
Re: EditPartViewer.findObjectAt problem [message #210218 is a reply to message #210125] |
Thu, 23 February 2006 06:11  |
Eclipse User |
|
|
|
Ah found the problem. Forgot to convert the absolute cursor location
into one relevant to the Graphical viewer.
Thanks.
Randy Hudson wrote:
> findObjectAt(Point) works for me. Maybe your editpart is not registered with
> its figure? You should step into the find method and see where it is
> failing.
>
> "Kevin O'Riordan" <k.oriordan@ie.ibm.com> wrote in message
> news:dtic5j$3tl$1@utils.eclipse.org...
>> Hey all, I'm having a problem here and was wondering if anyone could shine
>> some light.
>>
>> I'm trying to find out what EditPart/Figure is under the cursor at any
>> moment.
>>
>> Using EditPartViewer.findObjectAt(<point>) gives me back the root edit
>> part but not the specific edit part.
>>
>> I've tried using EditPartViewer.findObjectAtExcluding(Point position,
>> Collection exclusionList, Conditional condition) in both the following
>> ways to specify I don't want the root edit part:
>>
>> 1) Giving it a List containing the root edit part that I don't want.
>> 2) Using the following Conditional
>> new EditPartViewer.Conditional() {
>> public boolean evaluate(EditPart part) {
>> return part instanceof <type of part I want>;
>> }
>> }
>>
>> But both of them still give me back the root.
>>
>> Anyone got any ideas? I was thinking of locating the IFigure instead and
>> working from there, but getLightWeightSystem() is a protected method in
>> EditPartViewer so I can't access it.
>>
>> Regards,
>> Kevin.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03290 seconds