public void validate(ProcessResult response) {
super.validate(response);
for (Integer index : stateImageMap.values()) {
if (index < 0)
response.addMessage("stateImageMappings", new TranslatableMessage("validate.cannotBeNegative"));
}
if (defaultImage < 0)
response.addMessage("defaultImageIndex", new TranslatableMessage("validate.cannotBeNegative"));
if (imageSet != null) {
for (Integer index : stateImageMap.values()) {
if (index >= imageSet.getImageCount())
response.addMessage("stateImageMappings", new TranslatableMessage(
"emport.error.component.imageIndex", index, imageSet.getId(), imageSet.getImageCount() - 1));
}
if (defaultImage >= imageSet.getImageCount())
response.addMessage("defaultImageIndex", new TranslatableMessage("emport.error.component.imageIndex",
defaultImage, imageSet.getId(), imageSet.getImageCount() - 1));
}
}