@Override public String getName() { // NOSONAR override needed for @Api return super.getName(); }
@Override public void setName(String name) { // NOSONAR override needed for @Api super.setName(name); }
private AbstractReadOnlyAttributeInfo getAttributeByName(String name) { if (name != null) { for (AbstractAttributeInfo attributeInfo : layer.getLayerInfo().getFeatureInfo().getAttributes()) { if (attributeInfo instanceof AbstractReadOnlyAttributeInfo && attributeInfo.getName().equals(name)) { return (AbstractReadOnlyAttributeInfo) attributeInfo; } } } return null; }
private String getEntryLabel(String key, Layer layer) { ClientVectorLayerInfo c = (ClientVectorLayerInfo) layer.getLayerInfo(); for (AbstractAttributeInfo a : c.getFeatureInfo().getAttributes()) { if (a.getName().equalsIgnoreCase(key)) { return ((PrimitiveAttributeInfo) a).getLabel(); } } return null; }
private boolean isIdentifying(String key, Layer layer) { if (layer instanceof VectorLayer) { ClientVectorLayerInfo c = (ClientVectorLayerInfo) layer.getLayerInfo(); for (AbstractAttributeInfo a : c.getFeatureInfo().getAttributes()) { if (a.getName().equalsIgnoreCase(key)) { return a instanceof AbstractReadOnlyAttributeInfo && ((AbstractReadOnlyAttributeInfo) a).isIdentifying(); } } } return false; }
public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) { String fId = record.getAttribute(FEATURE_ID); Feature feat = vectorFeatures.get(fId); StringBuilder tooltip = new StringBuilder(); if (feat != null) { for (AbstractAttributeInfo a : feat.getLayer().getLayerInfo().getFeatureInfo().getAttributes()) { if (a instanceof AbstractReadOnlyAttributeInfo && ((AbstractReadOnlyAttributeInfo) a).isIdentifying()) { tooltip.append("<b>"); tooltip.append(((AbstractReadOnlyAttributeInfo) a).getLabel()); tooltip.append("</b>: "); tooltip.append(feat.getAttributeValue(a.getName())); tooltip.append("<br/>"); } } tooltip.append(MESSAGES.nearbyFeaturesListTooltip()); } return tooltip.toString(); } });