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

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


    int count = container.getItemCount();

    // some columns can be percentages while others are fixed
    // so we need to make 2 passes
    for (int i = 0; i < count; i++) {
      Component c = container.getItem(i);
      // if(!c.isVisible(false)){
      // continue;
      // }
      c.el().makePositionable(true);
      c.el().setStyleAttribute("margin", "0px");

      RowData data = null;
      LayoutData d = getLayoutData(c);
      if (d != null && d instanceof RowData) {
        data = (RowData) d;
      } else {
        data = new RowData();
      }

      if (data.getWidth() > 1) {
        pw -= data.getWidth();
      } else if (data.getWidth() == -1) {
        callLayout(c, false);

        pw -= c.getOffsetWidth();
        if (data.getMargins() != null) {
          pw -= data.getMargins().left;
          pw -= data.getMargins().right;
        }
      }
    }

    pw = pw < 0 ? 0 : pw;

    int x = target.getPadding("l");
    int sTop = target.getPadding("t");

    for (int i = 0; i < count; i++) {
      Component c = container.getItem(i);
      // if(!c.isVisible(false)){
      // continue;
      // }
      RowData data = null;
      LayoutData d = getLayoutData(c);
      if (d != null && d instanceof RowData) {
        data = (RowData) d;
      } else {
        data = new RowData();
      }
      double height = data.getHeight();

      if (height > 0 && height <= 1) {
        height = height * h;
      } else if (height == -1) {
        height = c.getOffsetHeight();
      }

      double width = data.getWidth();
      if (width > 0 && width <= 1) {
        width = width * pw;
      } else if (width == -1) {
        width = c.getOffsetWidth();
      }

      int tx = x;
      int ty = sTop;
      int tw = (int) width;
View Full Code Here


    int count = container.getItemCount();

    // some columns can be percentages while others are fixed
    // so we need to make 2 passes
    for (int i = 0; i < count; i++) {
      Component c = container.getItem(i);
      // if(!c.isVisible(false)){
      // continue;
      // }
      RowData data = null;
      LayoutData d = getLayoutData(c);
      if (d != null && d instanceof RowData) {
        data = (RowData) d;
      } else {
        data = new RowData();
      }

      if (data.getHeight() > 1) {
        ph -= data.getHeight();
      } else if (data.getHeight() == -1) {
        callLayout(c, false);

        ph -= c.getOffsetHeight();
        ph -= c.el().getMargins("tb");
      }

    }

    ph = ph < 0 ? 0 : ph;

    for (int i = 0; i < count; i++) {
      Component c = container.getItem(i);
      // if(!c.isVisible(false)){
      // continue;
      // }
      RowData data = null;
      LayoutData d = getLayoutData(c);
      if (d != null && d instanceof RowData) {
        data = (RowData) d;
      } else {
        data = new RowData();
      }

      double width = data.getWidth();

      if (width > 0 && width <= 1) {
        width = width * w;
      }

      width -= getSideMargins(c);

      double height = data.getHeight();
      if (height > 0 && height <= 1) {
        height = height * ph;
      }

      height -= c.el().getMargins("tb");

      setSize(c, (int) width, (int) height);
    }
  }
View Full Code Here

  @Override
  protected void onLayout(Container<?> container, El target) {
    super.onLayout(container, target);
    for (int i = 0; i < container.getItemCount(); i++) {
      Component c = container.getItem(i);
      LayoutData data = ComponentHelper.getLayoutData(c);
      if (data != null && data instanceof AbsoluteData) {
        AbsoluteData ad = (AbsoluteData) data;
        setPosition(c, ad.getLeft(), ad.getTop());
      }
View Full Code Here

    y += XDOM.getBodyScrollTop();
    LayoutContainer con = getItem(col);
    int count = con.getItemCount();

    for (int i = 0; i < count; i++) {
      Component c = con.getItem(i);
      int b = c.getAbsoluteTop();
      int t = b + c.getOffsetHeight();

      if (y < t) {
        return i;
      }
    }
View Full Code Here

    LayoutContainer con = getItem(col);
    List<Component> list = new ArrayList<Component>(con.getItems());
    int count = list.size();

    for (int i = 0; i < count; i++) {
      Component c = list.get(i);

      int b = c.getAbsoluteTop();
      int t = b + c.getOffsetHeight();
      int m = b + (c.getOffsetHeight() / 2);
      if (y < t) {
        if (y < m) {
          return i;
        } else {
          return i + 1;
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

    int w = size.width;
    int h = size.height;

    int count = container.getItemCount();
    for (int i = 0; i < count; i++) {
      Component c = container.getItem(i);
      int width = (w / count) - getSideMargins(c);
      int height = h - c.el().getMargins("tb");
      setSize(c, width, height);
    }
  }
View Full Code Here

    int w = size.width;
    int h = size.height;

    int count = container.getItemCount();
    for (int i = 0; i < count; i++) {
      Component c = container.getItem(i);
      int width = w - getSideMargins(c);
      int height = (h / count) - c.el().getMargins("tb");
      setSize(c, width, height);
    }
  }
View Full Code Here

    int count = container.getItemCount();

    // some columns can be percentages while others are fixed
    // so we need to make 2 passes
    for (int i = 0; i < count; i++) {
      Component c = container.getItem(i);

      ColumnData layoutData = null;
      LayoutData d = getLayoutData(c);
      if (d != null && d instanceof ColumnData) {
        layoutData = (ColumnData) d;
      } else {
        layoutData = new ColumnData();
      }

      if (layoutData.getWidth() > 1) {
        pw -= layoutData.getWidth();
      }

      pw -= getSideMargins(c);
    }

    pw = pw < 0 ? 0 : pw;

    for (int i = 0; i < count; i++) {
      Component c = container.getItem(i);

      ColumnData layoutData = null;
      LayoutData d = getLayoutData(c);
      if (d != null && d instanceof ColumnData) {
        layoutData = (ColumnData) d;
View Full Code Here

      return;
    }
    FocusFrame.get().unframe();
    ce.stopEvent();
    for (int i = 0; i < getItemCount(); i++) {
      Component c = getItem(i);
      if (c.isEnabled() && !c.getFocusSupport().isIgnore()) {
        c.focus();
        break;
      }
    }
  }
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.