code: public void onActivate() {
  		menu = new Menu();
  		menu.addItem(new CancelMeasuringAction(this));
  		Layer selectedLayer = mapWidget.getMapModel().getSelectedLayer();
  		if (selectedLayer instanceof VectorLayer) {
  			menu.addItem(new ToggleSnappingAction((VectorLayer) selectedLayer, this));
  		}
  		mapWidget.setContextMenu(menu);
  	}
docs: Create the context menu for this controller.