Skip to content
Snippets Groups Projects
Commit b0b08da9 authored by buczekp's avatar buczekp
Browse files

[LMS-1979] allow to change text of displayed entity links (default: identifier)

SVN: 20274
parent 69d3d8f2
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,8 @@ public class EntityTableCell implements ISerializableComparable
private String identifierOrNull; // 'null' when entity is missing
private String linkTextOrNull; // 'null' when link text wasn't redefined (use identifier)
public EntityTableCell(EntityKind entityKind, String permId)
{
this(entityKind, permId, permId);
......@@ -94,10 +96,26 @@ public class EntityTableCell implements ISerializableComparable
return entityKind.equals(otherCell.entityKind) && permId.equals(otherCell.permId);
}
private String createLinkText()
{
if (isMissing())
{
return (linkTextOrNull != null ? linkTextOrNull : permId) + MISSING_ENTITY_SUFFIX;
} else
{
return linkTextOrNull != null ? linkTextOrNull : identifierOrNull;
}
}
public void setLinkText(String linkText)
{
this.linkTextOrNull = linkText;
}
@Override
public String toString()
{
return isMissing() ? String.valueOf(permId) + MISSING_ENTITY_SUFFIX : identifierOrNull;
return createLinkText();
}
// ---------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment