Register a {@link GeometryEditStartHandler} that catches events that signal the editing process has started.

@param handler
The {@link GeometryEditStartHandler} to add as listener.
@return The registration of the handler.
192210
public JsHandlerRegistration addGeometryEditStartHandler(final GeometryEditStartHandler handler) {
		org.geomajas.plugin.editing.client.event.GeometryEditStartHandler h;
		h = new org.geomajas.plugin.editing.client.event.GeometryEditStartHandler() {

			public void onGeometryEditStart(GeometryEditStartEvent event) {
				handler.onGeometryEditStart(new org.geomajas.plugin.editing.jsapi.client.event.GeometryEditStartEvent(
						event.getGeometry()));
			}
		};
		return new JsHandlerRegistration(new HandlerRegistration[] { delegate.addGeometryEditStartHandler(h) });
	}
583525
public void activate() {
		deactivate();

		registrations.add(service.getGeometryEditService().addGeometryEditStartHandler(new GeometryEditStartHandler() {

			public void onGeometryEditStart(GeometryEditStartEvent event) {
				cleanup();
			}
		}));
		registrations.add(service.getGeometryEditService().addGeometryEditStopHandler(new GeometryEditStopHandler() {

			public void onGeometryEditStop(GeometryEditStopEvent event) {
				cleanup();
			}
		}));
		registrations.add(service.getGeometryEditService().addGeometryEditShapeChangedHandler(
				new GeometryEditShapeChangedHandler() {

					public void onGeometryShapeChanged(GeometryEditShapeChangedEvent event) {
						fetchGeometries();
					}
				}));
		registrations.add(mapWidget.getMapModel().getMapView().addMapViewChangedHandler(new MapViewChangedHandler() {

			public void onMapViewChanged(MapViewChangedEvent event) {
				for (int i = 0; i < centroids.size(); i++) {
					Coordinate centroid = centroids.get(i);
					Coordinate position = mapWidget.getMapModel().getMapView().getWorldViewTransformer()
							.worldToView(centroid);
					int x = (int) (position.getX() - labelWidth / 2);
					int y = (int) (position.getY() - labelHeight / 2);

					Rectangle rectangle = labelBgs.get(i);
					rectangle.setBounds(new Bbox(x, y, labelWidth, labelHeight));
					mapWidget.render(rectangle, RenderGroup.SCREEN, RenderStatus.UPDATE);

					Text text = labelTxts.get(i);
					text.setPosition(new Coordinate(x + 4, y + 2));
					mapWidget.render(text, RenderGroup.SCREEN, RenderStatus.UPDATE);
				}
			}
		}));
	}
203118
public void onGeometryEditMove(GeometryEditMoveEvent event) {
		
		// Find the elements that need updating:
		Map<GeometryIndex, Boolean> indicesToUpdate = new HashMap<GeometryIndex, Boolean>();
		for (GeometryIndex index : event.getIndices()) {
			if (!indicesToUpdate.containsKey(index)) {
				indicesToUpdate.put(index, false);
				if (!Geometry.POINT.equals(editingService.getGeometry().getGeometryType())
						&& !Geometry.MULTI_POINT.equals(editingService.getGeometry().getGeometryType())) {
					try {
						List<GeometryIndex> neighbors = null;
						switch (editingService.getIndexService().getType(index)) {
							case TYPE_VERTEX:
								// Move current vertex to the back. This helps the delete operation.
								indicesToUpdate.put(index, true);
								neighbors = editingService.getIndexService().getAdjacentEdges(event.getGeometry(),
										index);
								if (neighbors != null) {
									for (GeometryIndex neighborIndex : neighbors) {
										if (!indicesToUpdate.containsKey(neighborIndex)) {
											indicesToUpdate.put(neighborIndex, false);
										}
									}
								}

								neighbors = editingService.getIndexService().getAdjacentVertices(event.getGeometry(),
										index);
								if (neighbors != null) {
									for (GeometryIndex neighborIndex : neighbors) {
										if (!indicesToUpdate.containsKey(neighborIndex)) {
											indicesToUpdate.put(neighborIndex, false);
										}
									}
								}
								break;
							case TYPE_EDGE:
								neighbors = editingService.getIndexService().getAdjacentVertices(event.getGeometry(),
										index);
								if (neighbors != null) {
									for (GeometryIndex neighborIndex : neighbors) {
										if (!indicesToUpdate.containsKey(neighborIndex)) {
											indicesToUpdate.put(neighborIndex, false);
										}
									}
								}
								break;
							default:
						}
					} catch (GeometryIndexNotFoundException e) {
						throw new IllegalStateException(e);
					}
				}
			}
		}

		// Check if we need to draw the background (nice, but slows down):
		if (styleService.getBackgroundStyle() != null && styleService.getBackgroundStyle().getFillOpacity() > 0) {
			if (event.getGeometry().getGeometryType().equals(Geometry.POLYGON)) {
				org.geomajas.gwt.client.spatial.geometry.Geometry transformed = mapWidget.getMapModel()
						.getMapView().getWorldViewTransformer()
						.worldToPan(GeometryConverter.toGwt(event.getGeometry()));
				mapWidget.getVectorContext().drawPolygon(groups.get(baseName + ".background"), "background",
						(Polygon) transformed, styleService.getBackgroundStyle());
			} else if (event.getGeometry().getGeometryType().equals(Geometry.MULTI_POLYGON)
					&& event.getGeometry().getGeometries() != null) {
				for (int i = 0; i < event.getGeometry().getGeometries().length; i++) {
					Geometry polygon = event.getGeometry().getGeometries()[i];

					org.geomajas.gwt.client.spatial.geometry.Geometry transformed = mapWidget.getMapModel()
							.getMapView().getWorldViewTransformer().worldToPan(GeometryConverter.toGwt(polygon));
					mapWidget.getVectorContext().drawPolygon(
							groups.get(baseName + ".geometry" + i + ".background"), "background",
							(Polygon) transformed, styleService.getBackgroundStyle());
				}
			}
		}

		// Next, redraw the list:
		for (GeometryIndex index : indicesToUpdate.keySet()) {
			update(event.getGeometry(), index, indicesToUpdate.get(index));
		}

	}
938978
@Override
	public HandlerRegistration addGeometryIndexHighlightBeginHandler(GeometryIndexHighlightBeginHandler handler) {
		return editingService.getEventBus().addHandler(GeometryIndexHighlightBeginHandler.TYPE, handler);
	}
114135
protected <H extends EventHandler> HandlerRegistration addHandler(final H handler, GwtEvent.Type<H> type) {

        return ensureHandlers().addHandlerToSource(type, this, handler);
    }
1063057
public void onGeometryEditStop(GeometryEditStopEvent event) {
		// Remove the vector container from the map:
		mapPresenter.getContainerManager().removeVectorContainer(container);
		container = null;
		shapes.clear();
	}
172812
public synchronized void setHandler(Handler handler) {
        String handlerId = CollectorManagerUtils.getHandlerId(handler);
        HandlerManager hdlrMgr;
        if (!handlerMgrs.containsKey(handlerId)) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Adding handler to the list", handler.getClass());
            }
            hdlrMgr = new HandlerManager(handler);
            handlerMgrs.put(hdlrMgr.getHandlerId(), hdlrMgr);
            hdlrMgr.getHandler().init(this);
        }
    }
1322709
@Override
	public HandlerRegistration addGeometryIndexDisabledHandler(GeometryIndexDisabledHandler handler) {
		return editingService.getEventBus().addHandler(GeometryIndexDisabledHandler.TYPE, handler);
	}
1069454
public void handlerAppears( IMonitoringHandler handler ) {

		if( handler != null ) {
			this.logger.info( "Monitoring handler '" + handler.getName() + "' is now available." );
			this.handlers.add( handler );
			listHandlers( this.handlers, this.logger );
		}
	}
299175
public HandlerRegistration addInputHandler(JQMInputHandler handler) {
	    if (handler == null) return null;
	    return JQMHandlerRegistration.registerJQueryHandler(new WidgetHandlerCounter() {
            @Override
            public int getHandlerCountForWidget(GwtEvent.Type<?> type) {
                return getHandlerCount(type);
            }
        }, this, handler, JQMComponentEvents.INPUT,
        JQMEventFactory.getType(JQMComponentEvents.INPUT, JQMInputHandler.class));
	}
70667
@VisibleForTesting
  static void register(final SpanExporter spanExporter, final SpanExporter.Handler handler) {
    spanExporter.registerHandler(REGISTER_NAME, handler);
  }
533453
public void addHandler(AbstractHandler handler) {
    HandlerList handlers = new HandlerList();
    handlers.addHandler(handler);
    for (Handler h : mServer.getHandlers()) {
      handlers.addHandler(h);
    }
    mServer.setHandler(handlers);
  }
544909
public void addHandler(final Handler handler, final boolean wait) throws InterruptedException, CouldNotPerformException {
        try {
            listener.addHandler(handler, wait);
        } catch (CouldNotPerformException ex) {
            throw new CouldNotPerformException("Could not register Handler!", ex);
        }
    }
100408
public JsHandlerRegistration addGeometrySplitStopHandler(final GeometrySplitStopHandler handler) {
		org.geomajas.plugin.editing.client.split.event.GeometrySplitStopHandler h;
		h = new org.geomajas.plugin.editing.client.split.event.GeometrySplitStopHandler() {

			public void onGeometrySplitStop(GeometrySplitStopEvent event) {
				Geometry geometry = event.getGeometry();
				org.geomajas.plugin.editing.jsapi.client.split.event.GeometrySplitStopEvent e;
				e = new org.geomajas.plugin.editing.jsapi.client.split.event.GeometrySplitStopEvent(geometry);
				handler.onGeometrySplitStop(e);
			}
		};
		HandlerRegistration registration = delegate.addGeometrySplitStopHandler(h);
		return new JsHandlerRegistration(new HandlerRegistration[] { registration });
	}
464412
@Nonnull
  public final HandlerRegistration addOpenHandler( @Nonnull final OpenEvent.Handler handler )
  {
    return _eventBus.addHandler( OpenEvent.getType(), handler );
  }
117663
private JsHandlerRegistration addFeatureSelectionHandler2(final FeatureSelectedHandler selectedHandler,
			final FeatureDeselectedHandler deselectedHandler) {

		final List<VectorLayer> layers = ((MapImpl) map).getMapWidget().getMapModel().getVectorLayers();
		final HandlerRegistration[] registrations = new HandlerRegistration[layers.size()];

		for (int i = 0; i < layers.size(); i++) {
			final FeaturesSupported fs = (FeaturesSupported) map.getLayersModel().getLayer(layers.get(i).getId());

			registrations[i] = layers.get(i).addFeatureSelectionHandler(new FeatureSelectionHandler() {

				public void onFeatureSelected(FeatureSelectedEvent event) {
					Feature feature = new FeatureImpl(event.getFeature().toDto(), fs);
					selectedHandler.onFeatureSelected(new org.geomajas.plugin.jsapi.client.event.FeatureSelectedEvent(
							feature));
				}

				public void onFeatureDeselected(FeatureDeselectedEvent event) {
					Feature feature = new FeatureImpl(event.getFeature().toDto(), fs);
					deselectedHandler
							.onFeatureDeselected(new org.geomajas.plugin.jsapi.client.event.FeatureDeselectedEvent(
									feature));
				}
			});
		}

		return new JsHandlerRegistration(registrations);
	}
661322
public HandlerRegistration setSelectAlternativeHandler(SelectAlternativeHandler handler) {
		if (handlerManager.getHandlerCount(SelectAlternativeHandler.TYPE) > 0) {
			SelectAlternativeHandler previous = handlerManager.getHandler(SelectAlternativeHandler.TYPE, 0);
			handlerManager.removeHandler(SelectAlternativeHandler.TYPE, previous);
		}
		return handlerManager.addHandler(SelectAlternativeHandler.TYPE, handler);
	}