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

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


        if (collapsed != null && collapsed.contains(id)) {
          data.setCollapsed(true);
        }
      }

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

  }
View Full Code Here


  }

  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

      ComponentHelper.removeHandler(bar, SplitBarDragEvent.getType(), splitBarHandler);
    }
  }

  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) {
View Full Code Here

        if (collapsed != null && collapsed.contains(id)) {
          data.setCollapsed(true);
        }
      }

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

  }
View Full Code Here

  }

  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

      ComponentHelper.removeHandler(bar, SplitBarDragEvent.getType(), splitBarHandler);
    };
  }

  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) {
View Full Code Here

    };
  }

  protected SplitBar createSplitBar(Component component) {
    if (component == north) {
      return new SplitBar(LayoutRegion.SOUTH, component);
    } else if (component == south) {
      return new SplitBar(LayoutRegion.NORTH, component);
    } else if (component == west) {
      return new SplitBar(LayoutRegion.EAST, component);
    } else if (component == east) {
      return new SplitBar(LayoutRegion.WEST, component);
    }
    return null;
  }
View Full Code Here

    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

    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) {
            onExpandClick((CollapsePanel) c);
          }
        });
      }
    }

    if (data.isCollapsible() && c instanceof ContentPanel && !c.isRendered()) {
      final ContentPanel cp = (ContentPanel) c;
      cp.setCollapsible(true);
      cp.setHideCollapseTool(true);

      IconConfig config = ToolButton.DOUBLELEFT;

      switch (getRegion(cp)) {
        case NORTH:
          config = ToolButton.DOUBLEUP;
          break;
        case SOUTH:
          config = ToolButton.DOUBLEDOWN;
          break;
        case EAST:
          config = ToolButton.DOUBLERIGHT;
          break;
        case WEST:
        case CENTER:
          // do nothing
      }

      cp.getHeader().addTool(new ToolButton(config, new SelectHandler() {

        @Override
        public void onSelect(SelectEvent event) {
          cp.collapse();
        }
      }));
      cp.addBeforeCollapseHandler(collapseHandler);
      cp.addBeforeExpandHandler(collapseHandler);
    }

    if (data.isSplit()) {
      SplitBar bar = c.getData("splitBar");
      if (bar == null || bar.getTargetWidget() != c) {
        bar = createSplitBar(c);
        final SplitBar fbar = bar;
        bar.setCollapsible(data.isCollapseMini());
        if (data.isCollapseMini()) {
          switch (getRegion(c)) {
            case EAST:
              bar.updateMini(Direction.RIGHT);
              break;
            case WEST:
              bar.updateMini(Direction.LEFT);
              break;
            case NORTH:
              bar.updateMini(Direction.UP);
              break;
            case SOUTH:
              bar.updateMini(Direction.DOWN);
              break;
            case CENTER:
              // do nothing
          }
          bar.addSelectHandler(new SelectHandler() {
            @Override
            public void onSelect(SelectEvent event) {
              if (c instanceof Collapsible) {
                ((Collapsible) c).collapse();
              }
            }
          });
        }

        bar.addSplitBarDragHandler(new SplitBarDragHandler() {

          @Override
          public void onDragEvent(SplitBarDragEvent event) {
            LayoutRegion region = getRegion(c);
            if (event.isStart()) {
              boolean side = region == LayoutRegion.WEST || region == LayoutRegion.EAST;
              int size = side ? c.getOffsetWidth() : c.getOffsetHeight();
              int centerSize = side ? lastCenter.getWidth() : lastCenter.getHeight();

              fbar.setMinSize(data.getMinSize());
              fbar.setMaxSize(Math.min(size + centerSize, data.getMaxSize()));

            } else {
              if (event.getSize() < 1) {
                return;
              }
View Full Code Here

  @Override
  protected void applyLayout(Widget component, Rectangle box) {
    super.applyLayout(component, box);
    if (component instanceof Component) {
      final SplitBar bar = ((Component) component).getData("splitBar");
      if (bar != null) {
        Scheduler.get().scheduleDeferred(new ScheduledCommand() {
          @Override
          public void execute() {
            bar.getElement().getStyle().setVisibility(Visibility.VISIBLE);
          }
        });
      }
    }
  }
View Full Code Here

TOP

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

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.