Package com.sencha.gxt.widget.core.client

Examples of com.sencha.gxt.widget.core.client.Component


    Object obj = w.getLayoutData();

    if (obj instanceof BorderLayoutData && w instanceof Component) {
      BorderLayoutData data = (BorderLayoutData) obj;
      Component c = (Component)w;
      String id = c.getId();
     
      Map<String, Double> sizes = getState().getSizes();
      if (sizes != null && sizes.containsKey(id)) {
        data.setSize(sizes.get(id));
      }

      if (c instanceof ContentPanel) {
        Set<String> collapsed = getState().getCollapsed();
        if (collapsed != null && collapsed.contains(id)) {
          data.setCollapsed(true);
        }
      }

      SplitBar bar = c.getData("splitBar");
      if (bar != null) {
        bar.addSplitBarDragHandler(splitBarHandler);
      }
    }
View Full Code Here


    saveState();
  }

  protected void handleRemove(RemoveEvent event) {
    if (!getObject().isStateful()) return;
    Component c = (Component) event.getWidget();
    SplitBar bar = c.getData("splitBar");
    if (bar != null) {
      ComponentHelper.removeHandler(bar, SplitBarDragEvent.getType(), splitBarHandler);
    }
  }
View Full Code Here

    }
  }

  protected void handleResize(SplitBarDragEvent event) {
    SplitBar bar = event.getSource();
    Component target = bar.getTargetWidget();

    BorderLayoutData data = (BorderLayoutData) target.getLayoutData();

    Map<String, Double> sizes = getState().getSizes();
    if (sizes == null) {
      sizes = new HashMap<String, Double>();
    }

    sizes.put(target.getId(), data.getSize());

    getState().setSizes(sizes);
    saveState();
  }
View Full Code Here

        || (child instanceof AdapterMenuItem && ((AdapterMenuItem) child).isNeedsIndent());
    XElement div = appearance.createItem(getElement(), child.getElement().getId(), needsIndent);

    div.appendChild(child.getElement());
    if (child instanceof Component) {
      Component c = (Component) child;
      if (!c.isEnabled()) {
        c.disable();
      }
    }
    getContainerTarget().insertChild(div, beforeIndex);

  }
View Full Code Here

        || (child instanceof AdapterMenuItem && ((AdapterMenuItem) child).isNeedsIndent());
    XElement div = appearance.createItem(getElement(), child.getElement().getId(), needsIndent);

    div.appendChild(child.getElement());
    if (child instanceof Component) {
      Component c = (Component) child;
      if (!c.isEnabled()) {
        c.disable();
      }
    }
    getContainerTarget().insertChild(div, beforeIndex);

  }
View Full Code Here

    }

    for (int i = 0; i < toolBar.getWidgetCount(); i++) {
      Widget w = toolBar.getWidget(i);
      if (w != sourceEdit && w instanceof Component) {
        Component c = (Component) w;
        if (c.getData("gxt-more") != null) {
          continue;
        }
        c.setEnabled(!sourceEdit.getValue());
      } else {
        if (w instanceof FocusWidget) {
          ((FocusWidget) w).setEnabled(!sourceEdit.getValue());
        }
      }
View Full Code Here

    Object obj = w.getLayoutData();

    if (obj instanceof BorderLayoutData && w instanceof Component) {
      BorderLayoutData data = (BorderLayoutData) obj;
      Component c = (Component)w;
      String id = c.getId();
     
      Map<String, Double> sizes = getState().getSizes();
      if (sizes != null && sizes.containsKey(id)) {
        data.setSize(sizes.get(id));
      }

      if (c instanceof ContentPanel) {
        Set<String> collapsed = getState().getCollapsed();
        if (collapsed != null && collapsed.contains(id)) {
          data.setCollapsed(true);
        }
      }

      SplitBar bar = c.getData("splitBar");
      if (bar != null) {
        bar.addSplitBarDragHandler(splitBarHandler);
      };
    }
View Full Code Here

    saveState();
  }

  protected void handleRemove(RemoveEvent event) {
    if (!getObject().isStateful()) return;
    Component c = (Component) event.getWidget();
    SplitBar bar = c.getData("splitBar");
    if (bar != null) {
      ComponentHelper.removeHandler(bar, SplitBarDragEvent.getType(), splitBarHandler);
    };
  }
View Full Code Here

    };
  }

  protected void handleResize(SplitBarDragEvent event) {
    SplitBar bar = event.getSource();
    Component target = bar.getTargetWidget();

    BorderLayoutData data = (BorderLayoutData) target.getLayoutData();

    Map<String, Double> sizes = getState().getSizes();
    if (sizes == null) {
      sizes = new HashMap<String, Double>();
    }

    sizes.put(target.getId(), data.getSize());

    getState().setSizes(sizes);
    saveState();
  }
View Full Code Here

          cl = pl + cm.getLeft();
        }
      }

      boolean component = widget instanceof Component;
      Component c = null;
      if (component) {
        c = (Component) widget;
      }

      int height = -1;
      if (component) {
        c.setPosition(cl, pt);
      } else {
        XElement.as(widget.getElement()).setLeftTop(cl, pt);
      }

      if (getPack().equals(BoxLayoutPack.START) && layoutData.getFlex() > 0) {
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.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.