code: public void onLeafClick(LeafClickEvent event) {
  		LayerTreeTreeNode layerTreeNode = (LayerTreeTreeNode) event.getLeaf();
  		if (null != selectedLayerTreeNode
  				&& layerTreeNode.getLayer().getId().equals(selectedLayerTreeNode.getLayer().getId())) {
  			mapModel.selectLayer(null);
  		} else {
  			mapModel.selectLayer(layerTreeNode.getLayer());
  		}
  	}
docs: When the user clicks on a leaf the header text of the tree table is changed to the selected leaf and the toolbar
  buttons are updated to represent the correct state of the buttons.