Exemplo n.º 1
0
 @Override
 protected void onDetach() {
   super.onDetach();
   if (eventPreview != null) {
     eventPreview.remove();
   }
 }
Exemplo n.º 2
0
 /** {@inheritDoc} */
 @Override
 protected void onDetach() {
   super.onDetach();
   if (focusPreview != null) {
     focusPreview.remove();
   }
 }
Exemplo n.º 3
0
 /** {@inheritDoc} */
 @Override
 protected void onBlur(ComponentEvent ce) {
   final Rectangle rec = button.el().getBounds();
   if (rec.contains(BaseEventPreview.getLastXY())) {
     ce.stopEvent();
     return;
   }
   super.onBlur(ce);
   focusPreview.remove();
 }
Exemplo n.º 4
0
  /**
   * Hides the window.
   *
   * @param buttonPressed the button that was pressed or null
   */
  public void hide(Button buttonPressed) {
    if (hidden || !fireEvent(Events.BeforeHide, new WindowEvent(this, buttonPressed))) {
      return;
    }

    if (dragger != null) {
      dragger.cancelDrag();
    }

    hidden = true;

    if (!maximized) {
      restoreSize = getSize();
      restorePos = getPosition(true);
    }

    if (modalPreview != null) {
      modalPreview.removeHandler();
      modalPreview = null;
    }

    onHide();
    manager.unregister(this);
    if (removeFromParentOnHide) {
      removeFromParent();
    }

    if (modalPanel != null) {
      ModalPanel.push(modalPanel);
      modalPanel = null;
    }

    eventPreview.remove();
    notifyHide();

    if (restoreWindowScrolling != null) {
      com.google.gwt.dom.client.Document.get()
          .enableScrolling(restoreWindowScrolling.booleanValue());
    }

    fireEvent(Events.Hide, new WindowEvent(this, buttonPressed));
  }
Exemplo n.º 5
0
 /**
  * Hides this menu and optionally all parent menus
  *
  * @param deep true to close all parent menus
  * @return this
  */
 public Menu hide(boolean deep) {
   if (showing) {
     MenuEvent me = new MenuEvent(this);
     if (fireEvent(Events.BeforeHide, me)) {
       if (activeItem != null) {
         activeItem.deactivate();
         activeItem = null;
       }
       onHide();
       RootPanel.get().remove(this);
       eventPreview.remove();
       showing = false;
       hidden = true;
       fireEvent(Events.Hide, me);
       if (deep && parentItem != null) {
         parentItem.parentMenu.hide(true);
       }
     }
   }
   return this;
 }
Exemplo n.º 6
0
 @Override
 protected void onDetach() {
   super.onDetach();
   preview.remove();
 }