Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » EditPartViewer.findObjectAt problem
EditPartViewer.findObjectAt problem [message #210111] Wed, 22 February 2006 18:56 Go to next message
Kevin O'Riordan is currently offline Kevin O'RiordanFriend
Messages: 7
Registered: July 2009
Junior Member
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 #210125 is a reply to message #210111] Wed, 22 February 2006 20:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

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.
Re: EditPartViewer.findObjectAt problem [message #210218 is a reply to message #210125] Thu, 23 February 2006 11:11 Go to previous message
Kevin O'Riordan is currently offline Kevin O'RiordanFriend
Messages: 7
Registered: July 2009
Junior Member
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.
>
>
Previous Topic:help regarding adding attributes to class using properties
Next Topic:ComboBoxDescriptor
Goto Forum:
  


Current Time: Fri Jan 17 09:18:06 GMT 2025

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

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

Back to the top