code: private boolean addFeature(Feature feature, Layer<?> layer) {
  		// Basic checks:
  		if (feature == null || layer == null ) {
  			return false;
  		}
  		// Feature checks out, add it to the grid:
  		ListGridRecord record = new ListGridRecord();
  		if (layer instanceof VectorLayer) {
  			record.setAttribute(LABEL, getLabel(feature));
  		} else if (layer instanceof RasterLayer) {
  			record.setAttribute(LABEL, feature.getId());
  		}
  		record.setAttribute(FEATURE_ID, getFullFeatureId(feature, layer));
  		record.setAttribute(LAYER_ID, layer.getId());
  		record.setAttribute(LAYER_LABEL, layer.getLabel());
  		addData(record);
  		return true;
  	}
docs: Adds a new feature to the grid list. A {@link VectorLayer} must have been
  set first, and the feature must belong to that VectorLayer.
  
  @param feature
  The feature to be added to the grid list.
  @return Returns true in case of success, and false if the feature is null
  or if the feature does not belong to the correct layer or if the
  layer has not yet been set.