code: private HandlerRegistration previewMouseUpHandler() {
  		return Event.addNativePreviewHandler(new NativePreviewHandler() {
  			public void onPreviewNativeEvent(NativePreviewEvent preview) {
  				int typeInt = preview.getTypeInt();
  				if (typeInt == Event.ONMOUSEUP) {
  					Event event = Event.as(preview.getNativeEvent());
  					// Can not retrieve the clicked widget from the Event, so here goes...
  					int clientX = event.getClientX();
  					int clientY = event.getClientY();
  					// Was the button clicked?
  					int left = button.getPageLeft();
  					int right = button.getPageRight();
  					int top = button.getPageTop();
  					int bottom = button.getPageBottom();
  					boolean mouseIsOutside = true;
  					if (clientX > left && clientX < right && clientY > top && clientY < bottom) {
  						mouseIsOutside = false;
  					}
  					if (mouseIsOutside) {
  						// Was this panel clicked?
  						right = getPageRight();
  						top = getPageTop();
  						bottom = getPageBottom();
  						if (clientX > left && clientX < right && clientY > top && clientY < bottom) {
  							mouseIsOutside = false;
  						}
  					}
  					if (mouseIsOutside) {
  						hide();
  					}
  				}
  			}
  		});
  	}
docs: Through a {@link NativePreviewHandler} and its {@link NativePreviewEvent}
  all mouse events are caught here before they are processed.
  If the event is of type {@link Event#ONMOUSEUP} and the click was outside
  the button or this drop-down panel, the panel is closed.
  
  @return handler registration