Package com.extjs.gxt.ui.client.widget

Examples of com.extjs.gxt.ui.client.widget.Component


  }

  protected void onMouseOver(ComponentEvent ce) {
    EventTarget from = ce.getEvent().getRelatedEventTarget();
    if (from == null || (Element.is(from) && !DOM.isOrHasChild(getElement(), (Element) Element.as(from)))) {
      Component c = findItem(ce.getTarget());
      if (c != null && c instanceof Item) {
        Item item = (Item) c;
        if (activeItem != item && item.canActivate && item.isEnabled()) {
          setActiveItem(item, true);
        }
View Full Code Here


    ul.setScrollTop(ul.getScrollTop() + scrollIncrement * (top ? -1 : 1));
  }

  protected Item tryActivate(int start, int step) {
    for (int i = start, len = getItemCount(); i >= 0 && i < len; i += step) {
      Component c = getItem(i);
      if (c instanceof Item) {
        Item item = (Item) c;
        if (item.canActivate && item.isEnabled()) {
          setActiveItem(item, false);
          return item;
View Full Code Here

        while (w != null) {
          if (w instanceof RootPanel) {
            // do nothing leave app
            return;
          } else if (w instanceof Component){
            Component c = (Component)w;
            if (c.getFocusSupport().isIgnore()) {
              w = w.getParent();
            } else {
              w = null;
              pe.stopEvent();
            }
          }
        }
      }
    } else {
      if (focusNextWidget(component)) {
        pe.stopEvent();
      } else {
        if (!(component.getParent() instanceof RootPanel)) {
          Widget p = component.getParent();
          if (p instanceof Container) {
            Container c = (Container)p;
            if (c.getItemCount() == 1) {
              if (c .getParent() instanceof RootPanel) {
                pe.stopEvent();
                onStepOutApp();
                return;
              }
            }
View Full Code Here

  protected static boolean managed;

  @SuppressWarnings({"unchecked", "rawtypes"})
  public static boolean focusNextWidget(Widget c) {
    if (c instanceof Component) {
      Component comp = (Component) c;
      if (forwardIfOverride(comp)) {
        return true;
      }
    }
    Widget p = c.getParent();
View Full Code Here

    return false;
  }

  public static boolean focusPreviousWidget(Widget c) {
    if (c instanceof Component) {
      Component comp = (Component) c;
      if (previousIfOverride(comp)) {
        return true;
      }
    }
View Full Code Here

    return focusWidget(w, true);
  }

  public static boolean focusWidget(Widget w, boolean forward) {
    if (w instanceof Component) {
      Component c = (Component) w;
      if (c instanceof Field<?>) {
        c.focus();
        return true;
      }
      if (c.getFocusSupport().isIgnore()) {
        if (isContainer(c)) {
          stepInto(c, null, forward);
        } else {
          if (forward) {
            return focusNextWidget(c);
          } else {
            return focusPreviousWidget(c);
          }
        }
      } else {
        c.focus();
        return true;
      }
    } else {
      El.fly(w.getElement()).focus();
      return true;
View Full Code Here

  private FocusManager() {
    preview = new BaseEventPreview() {

      protected void onClick(PreviewEvent pe) {
        Component c = ComponentManager.get().find(pe.getTarget());
        if (c != null) {
          if (isWindow(c) == null && focusComponent == null) {
            focusComponent = c;
          }
        }

      };

      @Override
      protected void onPreviewKeyPress(PreviewEvent pe) {
        super.onPreviewKeyPress(pe);
        int key = pe.getKeyCode();

        Component c = ComponentManager.get().find(pe.getTarget());
        if (key == 117) {
          onToggle(c, pe);
        }
        Window w = null;
        if (c != null) {
View Full Code Here

  }

  @Override
  protected void onRender(Element target, int index) {
    if (widget instanceof Component) {
      Component c = (Component) widget;
      if (!c.isRendered()) {
        c.render(target, index);
      }
    }
    setElement(widget.getElement(), target, index);
    if (widget instanceof LayoutContainer) {
      ((LayoutContainer) widget).layout();
View Full Code Here

    if (showToolbar) {
      btnListener = new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
          Component item = ce.getComponent();
          if (item == bold) {
            getBasicFormatter().toggleBold();
          } else if (item == italic) {
            getBasicFormatter().toggleItalic();
          } else if (item == underline) {
View Full Code Here

   */
  public void setWidget(Widget widget) {
    this.widget = widget;
    if (rendered) {
      if (widget instanceof Component) {
        Component c = (Component) widget;
        if (!c.isRendered()) {
          c.render(getElement());
          setIcon(icon);
          return;
        }
      }
      getElement().appendChild(widget.getElement());
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.Component

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.