label = new Label(WICKET_ID, new Model<String>() {
@Override
public String getObject()
{
if (prettyHtml == null) {
final DiffMatchPatch diffMatchPatch = new DiffMatchPatch();
String newValue = newText.getObject();
if (newValue == null || "null".equals(newValue) == true) {
newValue = getString("label.null");
}
String oldValue = oldText.getObject();
if (oldValue == null || "null".equals(oldValue) == true) {
oldValue = getString("label.null");
}
final LinkedList<Diff> diffs = diffMatchPatch.diff_main(oldValue, newValue);
diffMatchPatch.diff_cleanupSemantic(diffs);
prettyHtml = getPrettyHtml(diffs);
}
return prettyHtml;
}
});