[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] EditPartViewer.findObjectAt problem

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.