use of org.eclipse.draw2d.ExclusionSearch in project tdi-studio-se by Talend.
the class MapperGraphicalViewer method findFigureAt.
public IFigure findFigureAt(int x, int y, Collection exclude, final Conditional condition) {
class ConditionalTreeSearch extends ExclusionSearch {
ConditionalTreeSearch(Collection coll) {
super(coll);
}
@Override
public boolean accept(IFigure figure) {
EditPart editpart = null;
while (editpart == null && figure != null) {
editpart = (EditPart) getVisualPartMap().get(figure);
figure = figure.getParent();
}
return editpart != null && (condition == null || condition.evaluate(editpart));
}
}
return getLightweightSystem().getRootFigure().findFigureAt(x, y, new ConditionalTreeSearch(exclude));
}
Aggregations