if ((alt == null) || (alt.trim().length() == 0)) {
if (errors == null) {
return true;
}
result = true;
CheckErrorResult errorResult = createCheckErrorResult(
analysis, image.getBeginIndex(), image.getEndIndex());
// Action: add a description
StringBuilder prefixFull = new StringBuilder();
prefixFull.append("[[");
prefixFull.append(image.getNamespace());
prefixFull.append(":");
prefixFull.append(image.getImage());
StringBuilder prefixShort = new StringBuilder(prefixFull);
if (image.getParameters() != null) {
for (PageElementImage.Parameter param : image.getParameters()) {
prefixFull.append("|");
prefixFull.append(param.getContents());
if (!magicWordImgAlt.isPossibleAlias(param.getContents())) {
prefixShort.append("|");
prefixShort.append(param.getContents());
}
}
}
prefixFull.append("|");
prefixShort.append("|alt=");
errorResult.addPossibleAction(
GT._("Add a description..."),
new AddTextActionProvider(
prefixFull.toString(), "]]",
new TextProviderImageDescription(image),
GT._("What description would you like to use for the image ?"),
descriptionChecker));
errorResult.addPossibleAction(
GT._("Add an alternate description..."),
new AddTextActionProvider(
prefixShort.toString(), "]]",
new TextProviderImageDescription(image),
GT._("What alternate description would you like to use for the image ?"),
descriptionChecker));
// Action: view image
errorResult.addPossibleAction(new SimpleAction(
GT._("View image"),
new ActionExternalViewer(
wiki,
image.getNamespace() + ":" + image.getImage(),
true)));