Package com.extjs.gxt.ui.client.event

Examples of com.extjs.gxt.ui.client.event.ComponentEvent


   */
  protected boolean insert(T item, int index) {
    ContainerEvent<?, ?> containerEvent = createContainerEvent(item);
    containerEvent.setIndex(index);
    if (fireEvent(Events.BeforeAdd, containerEvent)) {
      ComponentEvent componentEvent = item.createComponentEvent(null);
      if (item.fireEvent(Events.BeforeAdopt, componentEvent)) {
        index = adjustIndex(item, index);
        item.removeFromParent();
        if (item.isRendered()) {
          // make sure to detach it from the dom first
View Full Code Here


  protected boolean remove(T component, boolean force) {
    ContainerEvent containerEvent = createContainerEvent(component);
    containerEvent.setItem(component);
    containerEvent.setIndex(indexOf(component));
    if (fireEvent(Events.BeforeRemove, containerEvent) || force) {
      ComponentEvent componentEvent = component.createComponentEvent(null);
      if (component.fireEvent(Events.BeforeOrphan, componentEvent) || force) {
        onRemove(component);

        if (attachChildren) {
          assert component.getParent() == this :"component is not a child of this container";
View Full Code Here

   * @param type the event type
   * @return <code>false</code> if any listeners return <code>false</code>
   */
  public boolean fireEvent(EventType type) {
    if (disableEvents) return true;
    ComponentEvent be = createComponentEvent(null);
    be.setType(type);
    return fireEvent(type, be);
  }
View Full Code Here

      if ("input".equalsIgnoreCase(getElement().getTagName()) || eventTarget.getPropertyString("__eventBits") == null) {
        focus();
      }
    }

    ComponentEvent ce = createComponentEvent(event);
    ce.setEvent(event);

    // browser event listeners can cancel event
    if (!fireEvent(Events.BrowserEvent, ce)) {
      return;
    }

    EventType eventType = Events.lookupBrowserEvent(type);
    ce.setType(eventType);

    if (type == Event.ONCONTEXTMENU) {
      if (disableContextMenu) {
        event.preventDefault();
      }
      onRightClick(ce);
    }

    // specialized support for mouse overs
    if (overElements != null && (type == Event.ONMOUSEOVER || type == Event.ONMOUSEOUT)) {
      Element target = ce.getTarget();
      if (target != null) {
        String style = overElements.get(target.getId());
        if (style != null) {
          fly(target).setStyleName(style, type == Event.ONMOUSEOVER);
        }
View Full Code Here

   * <code>StateManager</code> and saving it using the state id or component id
   * as the key.
   */
  public void saveState() {
    if (stateful && state != null) {
      ComponentEvent ce = createComponentEvent(null);
      ce.setState(state);
      if (fireEvent(Events.BeforeStateSave, ce)) {
        String sid = stateId != null ? stateId : getId();
        StateManager.get().set(sid, state);
        fireEvent(Events.StateSave, ce);
      }
View Full Code Here

    }
    fireEvent(Events.Blur);
  }

  protected ComponentEvent createComponentEvent(Event event) {
    return new ComponentEvent(this, event);
  }
View Full Code Here

    if (stateful) {
      String sid = stateId != null ? stateId : getId();
      Map<String, Object> st = StateManager.get().getMap(sid);
      if (st != null) {
        state = st;
        ComponentEvent ce = createComponentEvent(null);
        ce.setState(state);
        if (fireEvent(Events.BeforeStateRestore, ce)) {
          applyState(state);
          fireEvent(Events.StateRestore, ce);
        }
      }
View Full Code Here

  /**
   * Hides the popup.
   */
  public void hide() {
    if (!fireEvent(Events.BeforeHide, new ComponentEvent(this))) {
      return;
    }
    if (eventPreview) {
      preview.remove();
    }
View Full Code Here

  /**
   * Displays the popup.
   */
  public void show() {
    if (!fireEvent(Events.BeforeShow, new ComponentEvent(this))) return;
    Point p = new Point((int) Window.getClientWidth() / 2,
        (int) Window.getClientHeight() / 2);
    showAt(p.x, p.y);
  }
View Full Code Here

   * control of popup position see {@link #show(Element, String, int[])}.
   *
   * @param widget the widget to use for alignment
   */
  public void show(Component widget) {
    if (!fireEvent(Events.BeforeShow, new ComponentEvent(this))) {
      return;
    }
    setItem(widget);
    alignElem = widget.getElement();
    onShowPopup();
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.event.ComponentEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.