public ApplicationAdvice appliesTo(final IModel<?> model) {
if (!(model instanceof EntityCollectionModel)) {
return ApplicationAdvice.DOES_NOT_APPLY;
}
final EntityCollectionModel entityCollectionModel = (EntityCollectionModel) model;
if (entityCollectionModel.hasSelectionHandler()) {
return ApplicationAdvice.DOES_NOT_APPLY;
}
final ObjectSpecification typeOfSpec = entityCollectionModel.getTypeOfSpecification();
if (typeOfSpec.getFacet(IconFacet.class) == null) {
return ApplicationAdvice.DOES_NOT_APPLY;
}
return ApplicationAdvice.APPLIES;
}