Package org.gwt.mosaic.ui.client.layout

Examples of org.gwt.mosaic.ui.client.layout.LayoutPanel


    }
  };

  public StackLayoutPanel() {
    super(new BoxLayout(Orientation.VERTICAL));
    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.setWidgetSpacing(0);
    layoutPanel.setAnimationCallback(new AnimationCallback() {
      public void onAnimationComplete() {
        for (int i = 0, n = getLayoutPanel().getWidgetCount(); i < n; i++) {
          Widget w = getLayoutPanel().getWidget(i);
          if (w instanceof Caption)
            w.getElement().getStyle().setZIndex(0);
View Full Code Here


   * @param stackText the header text associated with this widget
   * @param asHTML <code>true</code> to treat the specified text as HTML
   */
  public void add(Widget w, String stackText, boolean asHTML) {
    final Caption caption = new Caption(stackText, asHTML);
    final LayoutPanel content = new LayoutPanel();
    final LayoutPanel layoutPanel = getLayoutPanel();
    caption.addStyleName(DEFAULT_ITEM_STYLENAME);
    caption.addClickHandler(clickHandler);
    content.addStyleName(DEFAULT_CONTENT_STYLENAME);
    content.add(w);
    panels.put(w, content);
    layoutPanel.add(caption, new BoxLayoutData(FillStyle.HORIZONTAL));
    layoutPanel.add(content, new BoxLayoutData(FillStyle.BOTH));
    if (visibleStack == -1) {
      showStack(0);
    } else {
      setStackVisible(visibleStack, false);
      visibleStack = getLayoutPanel().getWidgetCount() - 2;
View Full Code Here

    final int oldIndex = visibleStack;

    visibleStack = index;

    final Caption caption = (Caption) getLayoutPanel().getWidget(index);
    final LayoutPanel content = (LayoutPanel) getLayoutPanel().getWidget(
        index + 1);

    if (visible) {
      caption.addStyleName(DEFAULT_ITEM_STYLENAME + "-selected");
    } else {
      caption.removeStyleName(DEFAULT_ITEM_STYLENAME + "-selected");
    }

    content.setVisible(visible);

    if (visible && oldIndex >= 0) {
      Object layoutDataObject = content.getLayoutData();
      if (layoutDataObject instanceof LayoutData) {
        LayoutData layoutData = (LayoutData) layoutDataObject;
        if (index > oldIndex) {
          layoutData.setSourceTop(content.getOffsetHeight());
        } else {
          layoutData.setSourceTop(-content.getOffsetHeight());
        }
      }
    }
  }
View Full Code Here

   * to call this directly, as it is called as a side effect of a {@code
   * #setVisible(true)} call.
   */
  public void ensureWidget() {
    if (widget == null) {
      final LayoutPanel layoutPanel = getLayoutPanel();
      layoutPanel.add(widget = createWidget());
      layoutPanel.invalidate(widget);
      DeferredCommand.addCommand(new Command() {
        public void execute() {
          layoutPanel.layout();
        }
      });
    }
  }
View Full Code Here

   *
   * @param w the child widget to be added
   * @see com.google.gwt.user.client.ui.HasWidgets#add(com.google.gwt.user.client.ui.Widget)
   */
  public void add(Widget w) {
    final LayoutPanel layoutPanel = getLayoutPanel();
    if (widget != null) {
      layoutPanel.clear();
    }
    widget = w;
    getLayoutPanel().add(widget);
  }
View Full Code Here

  /**
   * Creates a new {@code LayoutComposite} with {@link FillLayout}.
   */
  protected LayoutComposite() {
    initWidget(new LayoutPanel());
  }
View Full Code Here

   * element. The element is presumed to be a &lt;div&gt;.
   *
   * @param elem the element to be used for this panel.
   */
  protected LayoutComposite(Element elem) {
    initWidget(new LayoutPanel(elem) {
    });
  }
View Full Code Here

   * Creates a new {@code LayoutCombosite} with the specified layout manager.
   *
   * @param layout the {@link LayoutManager} to use
   */
  protected LayoutComposite(LayoutManager layout) {
    initWidget(new LayoutPanel(layout));
  }
View Full Code Here

   *
   * @param elem the element to be used for this panel.
   * @param layout the {@link LayoutManager} to use
   */
  protected LayoutComposite(Element elem, LayoutManager layout) {
    initWidget(new LayoutPanel(elem, layout) {
    });
  }
View Full Code Here

   * Constructs a <code>DefaultFormBuilder</code> for the given layout.
   *
   * @param layout the <code>FormLayout</code> to be used
   */
  public DefaultFormBuilder(FormLayout layout) {
    this(layout, new LayoutPanel(new BoxLayout(Orientation.VERTICAL)));
  }
View Full Code Here

TOP

Related Classes of org.gwt.mosaic.ui.client.layout.LayoutPanel

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.