Skip to content

Commit

Permalink
Support for inlined properties, by displaying them as links. (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
jad-elkhoury committed Nov 11, 2021
1 parent 2380581 commit 812945d
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,25 @@ public static Preview getPreview(final AbstractResource aResource, List<String>
value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple, l);
} else {
Link link = (Link) getterMethod.invoke(aResource);
value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple,
constructLink(link));
value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple, constructLink(link));
}
} else {
value = constructPropertyValue(PropertyDefintion.RepresentationType.TEXT, multiple,
getterMethod.invoke(aResource));
if (!isNotInlinedRepresentation) {
if (multiple) {
Collection<AbstractResource> rs = (Collection<AbstractResource>) getterMethod.invoke(aResource);
List<org.eclipse.lyo.server.ui.model.Link> l = new ArrayList<>();
for (AbstractResource r: rs) {
l.add(constructLink(r.getAbout().toString(), r.toString()));
}
value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple, l);
} else {
AbstractResource r = (AbstractResource) getterMethod.invoke(aResource);
value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple, constructLink(r.getAbout().toString(), r.toString()));
}
}
else {
value = constructPropertyValue(PropertyDefintion.RepresentationType.TEXT, multiple, getterMethod.invoke(aResource));
}
}
previewItems.add(constructProperty(key, value));
}
Expand Down

0 comments on commit 812945d

Please sign in to comment.