@Override public void onAttachOrDetach(AttachEvent event) { if (event.isAttached()) { textField .getElement() .getParentElement() .insertAfter(resetButtonElement, textField.getElement()); updateResetButtonVisibility(); addResetButtonClickListener(resetButtonElement); } else { Element parentElement = resetButtonElement.getParentElement(); if (parentElement != null) { parentElement.removeChild(resetButtonElement); } removeResetButtonClickListener(resetButtonElement); } }
@Override public void onAttachOrDetach(AttachEvent event) { if (!event.isAttached()) { hide(); } }