final ILayerListener listener = new ILayerListener() {
public void handleLayerEvent(ILayerEvent event) {
if (event instanceof SearchEvent) {
// Check event, coordinate should be in composite layer
// coordinates
SearchEvent searchEvent = (SearchEvent) event;
if (expected != null) {
Assert.assertEquals(expected.columnPosition,
searchEvent.getCellCoordinate()
.getColumnPosition());
Assert.assertEquals(expected.rowPosition, searchEvent
.getCellCoordinate().getRowPosition());
} else {
Assert.assertNull(searchEvent.getCellCoordinate());
}
}
}
};
gridLayer.addLayerListener(listener);