FlexCellFormatter cf = flexPanel.getFlexCellFormatter();
int row = 0;
cf.setColSpan(row, 0, 2);
flexPanel.setWidget(row, 0, new HTML("<a target=\"_blank\" href=\"" +uriResLink+ "\">" +uri+ "</a>"));
cf.setAlignment(row, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP);
row++;
List<PropValue> props = entity.getProps();
for ( PropValue pv : props ) {
String htmlStr;
HTML html;
// column 0
html = new HTML();
String propName = pv.getPropName();
String propUri = pv.getPropUri();
if ( propName == null ) {
propName = "?";
}
if ( propUri != null ) {
htmlStr = "<a target=\"_blank\" href=\"" +propUri+ "\">" +propName+ "</a>";
}
else {
htmlStr = propName;
}
html.setHTML("<b>" +htmlStr+ "</b>:");
if ( propUri != null ) {
html.setTitle(propUri);
}
flexPanel.setWidget(row, 0, html);
cf.setAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_TOP);
// column 1
html = new HTML();
String valueName = pv.getValueName();
String valueUri = pv.getValueUri();
if ( valueName == null ) {
valueName = "?";
}
if ( valueUri != null ) {
htmlStr = "<a target=\"_blank\" href=\"" +valueUri+ "\">" +valueName+ "</a>";
html.setHTML(htmlStr);
}
else {
htmlStr = valueName;
html.setText(htmlStr);
}
if ( valueUri != null ) {
html.setTitle(valueUri);
}
flexPanel.setWidget(row, 1, html);
cf.setAlignment(row, 1, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP);