}
};
mainmap.getContextModel().eAdapters().add(contextListener);
//add a deep listener to listen to layer hide/show events
Adapter layerVisibilityAdapter = new AdapterImpl(){
@SuppressWarnings("unchecked")
public void notifyChanged( final Notification msg ) {
if (msg.getNotifier() instanceof Layer && msg.getFeatureID(Layer.class) == ProjectPackage.LAYER__VISIBLE) {
if (msg.getNewBooleanValue() != msg.getOldBooleanValue()){
// mapviewer needs refreshing