code: public void setLayer(VectorLayer layer) {
  		this.layer = layer;
  		if (layer == null) {
  			clear();
  		} else {
  			empty();
  			updateFields();
  		}
  	}
docs: Apply a new layer onto the grid. This means that the table header will immediately take on the attributes of this
  new layer.
  
  @param layer
  The layer from whom to display the features. If this is null, the table will be cleared.