@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);
   }
 }
コード例 #2
0
 @Override
 public void onAttachOrDetach(AttachEvent event) {
   if (!event.isAttached()) {
     hide();
   }
 }