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

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


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


      }
    }
  }

  protected CollapsePanel createCollapsePanel(ContentPanel panel, BorderLayoutData data, LayoutRegion region) {
    return new CollapsePanel(panel, data, region) {
      protected void onExpandButton() {
        super.onExpandButton();
        onExpandClick(this);
      }
    };
View Full Code Here

  protected void onCollapse(ContentPanel panel) {
    switchPanels(panel);

    doLayout();

    CollapsePanel cp = (CollapsePanel) panel.getData("collapse");
    SplitBar bar = cp.getSplitBar();
    if (bar != null) {
      bar.sync();
    }

    fireEvent(new CollapseItemEvent<ContentPanel>(panel));
View Full Code Here

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

  protected void onExpand(ContentPanel panel) {
    CollapsePanel cp = panel.getData("collapse");

    LayoutRegion region = getRegion(cp);

    switch (region) {
      case WEST:
View Full Code Here

    }

    final BorderLayoutData data = getLayoutData(c);

    if (c instanceof CollapsePanel) {
      final CollapsePanel collapse = (CollapsePanel) c;
      final BorderLayoutData panelData = (BorderLayoutData) collapse.getContentPanel().getLayoutData();
      SplitBar bar = collapse.getData("splitBar");
      if (bar == null || bar.getTargetWidget() != c) {
        bar = collapse.getSplitBar();
        bar.setCollapsible(panelData.isCollapseMini());

        c.setData("splitBar", bar);

        if (panelData.isCollapseHidden()) {
          collapse.collapseHidden();
        }

        bar.addSelectHandler(new SelectHandler() {
          @Override
          public void onSelect(SelectEvent event) {
View Full Code Here

    LayoutRegion region = getRegion(panel);

    BorderLayoutData data = (BorderLayoutData) getLayoutData(panel);
    remove(panel);

    CollapsePanel cp = (CollapsePanel) panel.getData("collapse");
    if (cp == null) {
      cp = createCollapsePanel(panel, data, region);

      BorderLayoutData collapseData = new BorderLayoutData();
      collapseData.setSize(data.isCollapseHidden() ? 0 : 24);

      Margins m = data.getMargins();
      if (m == null) {
        m = new Margins();
        data.setMargins(m);
      }
      collapseData.setMargins(new Margins(m.getTop(), m.getRight(), m.getBottom(), m.getLeft()));

      if (data.isCollapseHidden()) {
        cp.collapseHidden();
        collapseData.setSize(0);
        switch (region) {
          case WEST:
            collapseData.getMargins().setLeft(0);
            break;
          case EAST:
            collapseData.getMargins().setRight(0);
            break;
          case NORTH:
            collapseData.getMargins().setTop(0);
            break;
          case SOUTH:
            collapseData.getMargins().setBottom(0);
            break;
          case CENTER:
            // do nothing
        }
      }

      cp.setLayoutData(collapseData);
      cp.setData("panel", panel);
      panel.setData("collapse", cp);
    }

    cp.clearSizeCache();

    setCollapsed(panel, true);

    switch (region) {
      case WEST:
View Full Code Here

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

      }
    }
  }

  protected CollapsePanel createCollapsePanel(ContentPanel panel, BorderLayoutData data, LayoutRegion region) {
    CollapsePanel cp = new CollapsePanel(panel, data, region) {
      protected void onExpandButton() {
        super.onExpandButton();
        onExpandClick(this);
      }
    };

    BorderLayoutData collapseData = new BorderLayoutData();
    collapseData.setSize(data.isCollapseHidden() ? 0 : 24);

    Margins m = data.getMargins();
    if (m == null) {
      m = new Margins();
      data.setMargins(m);
    }
    collapseData.setMargins(new Margins(m.getTop(), m.getRight(), m.getBottom(), m.getLeft()));

    if (data.isCollapseHidden()) {
      cp.collapseHidden();
      collapseData.setSize(0);
      switch (region) {
        case WEST:
          collapseData.getMargins().setLeft(0);
          break;
        case EAST:
          collapseData.getMargins().setRight(0);
          break;
        case NORTH:
          collapseData.getMargins().setTop(0);
          break;
        case SOUTH:
          collapseData.getMargins().setBottom(0);
          break;
      }
    }

    cp.setLayoutData(collapseData);
    cp.setData("panel", panel);
    panel.setData("collapse", cp);

    return cp;
  }
View Full Code Here

  protected void onCollapse(ContentPanel panel) {
    BorderLayoutData data = (BorderLayoutData) panel.getLayoutData();

    LayoutRegion region = getRegion(panel);

    CollapsePanel cp = (CollapsePanel) panel.getData("collapse");
    if (cp == null) {
      cp = createCollapsePanel(panel, data, region);
    }

    cp.clearSizeCache();

    setCollapsed(panel, true);

    switch (region) {
      case WEST:
        setWestWidget(cp);
        break;
      case EAST:
        setEastWidget(cp);
        break;
      case NORTH:
        setNorthWidget(cp);
        break;
      case SOUTH:
        setSouthWidget(cp);
        break;
    }

    panel.clearSizeCache();

    doLayout();

    SplitBar bar = cp.getSplitBar();
    if (bar != null) {
      bar.sync();
    }

    fireEvent(new CollapseItemEvent<ContentPanel>(panel));
View Full Code Here

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

  protected void onExpand(ContentPanel panel) {
    CollapsePanel cp = panel.getData("collapse");

    LayoutRegion region = getRegion(cp);

    switch (region) {
      case WEST:
View Full Code Here

TOP

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

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.