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

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


        map.addLayer(new Bing(new BingOptions("Bing Aerial", bingKey, BingType.AERIAL)));
    }

    public MapView(MapHandler mapHandler) {
        this.mapHandler = mapHandler;
        contentPanel = new ContentPanel();
        contentPanel.setHeadingText("Map");

        MapOptions defaultMapOptions = new MapOptions();

        mapWidget = new MapWidget("100%", "100%", defaultMapOptions);
View Full Code Here


  }

  protected void handleCollapse(CollapseItemEvent<ContentPanel> event) {
    if (!getObject().isStateful()) return;
    ContentPanel panel = event.getItem();
    Set<String> collapsed = getState().getCollapsed();
    if (collapsed == null) {
      collapsed = new HashSet<String>();
    }
    collapsed.add(panel.getId());

    getState().setCollapsed(collapsed);
    saveState();
  }
View Full Code Here

    saveState();
  }

  protected void handleExpand(ExpandItemEvent<ContentPanel> event) {
    if (!getObject().isStateful()) return;
    ContentPanel panel = event.getItem();
    Set<String> collapsed = getState().getCollapsed();
    if (collapsed != null) {
      collapsed.remove(panel.getId());
    }

    getState().setCollapsed(collapsed);
    saveState();
  }
View Full Code Here

  }

  protected void handleCollapse(CollapseItemEvent<ContentPanel> event) {
    if (!getObject().isStateful()) return;
    ContentPanel panel = event.getItem();
    Set<String> collapsed = getState().getCollapsed();
    if (collapsed == null) {
      collapsed = new HashSet<String>();
    }
    collapsed.add(panel.getId());

    getState().setCollapsed(collapsed);
    saveState();
  }
View Full Code Here

    saveState();
  }

  protected void handleExpand(ExpandItemEvent<ContentPanel> event) {
    if (!getObject().isStateful()) return;
    ContentPanel panel = event.getItem();
    Set<String> collapsed = getState().getCollapsed();
    if (collapsed != null) {
      collapsed.remove(panel.getId());
    }

    getState().setCollapsed(collapsed);
    saveState();
  }
View Full Code Here

      switch (expandMode) {
        case MULTI:
        case SINGLE:
          for (int i = 0, len = getWidgetCount(); i < len; i++) {
            ContentPanel c = (ContentPanel) getWidget(i);
            if (expandMode == ExpandMode.SINGLE && c != activeWidget) {
              c.collapse();
            }
            applyLayout(c, size.getWidth(), -1);
          }
          break;
        case SINGLE_FILL:
          if (activeWidget.isExpanded()) {
            int hh = 0;
            for (int i = 0, len = getWidgetCount(); i < len; i++) {
              ContentPanel c = (ContentPanel) getWidget(i);

              if (c != activeWidget) {
                c.collapse();
                hh += c.getAppearance().getHeaderSize(c.getElement()).getHeight();
                applyLayout(c, size.getWidth(), -1);
              }
            }
            activeWidget.setPixelSize(size.getWidth(), size.getHeight() - hh);
          } else {
            for (int i = 0, len = getWidgetCount(); i < len; i++) {
              ContentPanel c = (ContentPanel) getWidget(i);
              if (c != activeWidget) {
                c.collapse();
              }
              applyLayout(c, size.getWidth(), -1);
            }
          }

      }

    } else {
      for (int i = 0, len = getWidgetCount(); i < len; i++) {
        ContentPanel c = (ContentPanel) getWidget(i);
        if (c != activeWidget) {
          c.collapse();
        }
      }
    }
  }
View Full Code Here

  @Override
  protected void onInsert(int index, Widget child) {
    super.onInsert(index, child);
    assert child instanceof ContentPanel : "AccordionLayoutContainer must be ContentPanels";

    ContentPanel cp = (ContentPanel) child;
    cp.addBeforeExpandHandler(handler);
    cp.addExpandHandler(handler);
    cp.setCollapsible(true);
    cp.setHideCollapseTool(hideCollapseTool);
    cp.setAnimCollapse(false);
    cp.setTitleCollapse(titleCollapse);
  }
View Full Code Here

  }

  protected void onRemove(Widget child) {
    super.onRemove(child);

    ContentPanel cp = (ContentPanel) child;
    ComponentHelper.removeHandler(cp, BeforeExpandEvent.getType(), handler);
    ComponentHelper.removeHandler(cp, ExpandEvent.getType(), handler);
  }
View Full Code Here

      BorderLayoutData data = getLayoutData(w);
      if (data.isHidden()) {
        return;
      }
      CollapsePanel collapse = (CollapsePanel) w;
      ContentPanel cp = (ContentPanel) collapse.getData("panel");
      onExpand(cp);
    }
  }
View Full Code Here

    fireEvent(new ExpandItemEvent<ContentPanel>(panel));
  }

  protected void onExpandClick(CollapsePanel collapse) {
    ContentPanel panel = collapse.getContentPanel();
    onExpand(panel);
  }
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.ContentPanel

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.