code: private void registerEventHandler() {
  
          clearEventHandler();
          m_previewRegistration = Event.addNativePreviewHandler(new NativePreviewHandler() {
  
              @SuppressWarnings("synthetic-access")
              public void onPreviewNativeEvent(NativePreviewEvent event) {
  
                  if (!(m_pointWidget.isAttached())) {
                      clearEventHandler();
                      return;
                  }
  
                  NativeEvent nativeEvent = event.getNativeEvent();
                  if (nativeEvent == null) {
                      return;
                  }
                  int eventType = event.getTypeInt();
                  switch (eventType) {
                      case Event.ONMOUSEUP:
                          clearEventHandler();
                          save();
                          break;
                      case Event.ONMOUSEMOVE:
                          handleMove(nativeEvent);
                          break;
                      default:
                          break;
                  }
              }
  
          });
      }
docs: Registers the preview event handler used for drag and drop.<p>