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

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


   *          target the PopupPanel or its children should be ignored
   */
  public LayoutPopupPanel(boolean autoHide, boolean modal) {
    super(autoHide, modal);

    layoutPanel = new LayoutPanel();
    layoutPanel.setPadding(0);
    super.setWidget(layoutPanel);
  }
View Full Code Here


   * @param beforeIndex the index before which it will be inserted
   * @throws IndexOutOfBoundsException if <code>beforeIndex</code> is out of
   *           range
   */
  public void insert(Widget w, int beforeIndex) {
    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.insert(w, new FillLayoutData(), beforeIndex);
    w.setVisible(false);
  }
View Full Code Here

  /**
   * Sets up the date picker.
   */
  protected void setup() {
    final LayoutPanel layoutPanel = new LayoutPanel(new BoxLayout(
        Orientation.VERTICAL));
    layoutPanel.setWidgetSpacing(0);
    initWidget(layoutPanel);

    layoutPanel.add(this.getMonthSelector(), new BoxLayoutData(
        FillStyle.HORIZONTAL));
    showDate(new Date());
    layoutPanel.add(this.getCalendarView(), new BoxLayoutData(FillStyle.BOTH));

    setStyleName(DEFAULT_STYLENAME);
  }
View Full Code Here

   *
   * @param datePicker the {@link DatePicker} to be used
   * @param timePicker the {@link TimePicker} to be used
   */
  public DateTimePicker(DatePicker datePicker, TimePicker timePicker) {
    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.setLayout(new BoxLayout(Orientation.VERTICAL));
    layoutPanel.setWidgetSpacing(1);
   
    this.datePicker = datePicker;
    this.timePicker = timePicker;
   
    layoutPanel.add(datePicker, new BoxLayoutData(FillStyle.BOTH));
    layoutPanel.add(new WidgetWrapper(timePicker), new BoxLayoutData(FillStyle.HORIZONTAL));
   
    timePicker.addChangeHandler(timePickerChangeHandler);
    datePicker.addChangeHandler(datePickerChangeHandler);
   
    setStyleName(DEFAULT_STYLENAME);
View Full Code Here

  protected TabLayoutPanel(TabBarPosition region, boolean decorate,
      boolean decorateBody) {
    super();

    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.setLayout(new BorderLayout());
    layoutPanel.setWidgetSpacing(0);

    if (decorate) {
      if (region == TabBarPosition.TOP) {
        tabBar = new DecoratedTabBar();
      } else {
        tabBar = new DecoratedBottomTabBar();
      }
    } else {
      tabBar = new TabBar();
    }

    deck.addStyleName(DEFAULT_STYLENAME + "Bottom");
    if (!decorateBody) {
      deck.addStyleName("gwt-TabPanelBottom"); // use GWT's TabPanel style
    }

    if (region == TabBarPosition.TOP) {
      layoutPanel.add(tabBar, new BorderLayoutData(Region.NORTH));
    } else {
      layoutPanel.add(tabBar, new BorderLayoutData(Region.SOUTH));
    }
    layoutPanel.add(deck, new BorderLayoutData(decorateBody));

    tabBar.addTabListener(this);

    setStyleName(DEFAULT_STYLENAME);
  }
View Full Code Here

    add(widget, false);
  }

  @Deprecated
  public void add(Widget w, boolean decorate) {
    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.clear();
    if (!(layoutPanel.getLayout() instanceof FillLayout)) {
      layoutPanel.setLayout(new FillLayout());
    }
    layoutPanel.add(w, new FillLayoutData(decorate));
  }
View Full Code Here

  /**
   * Default constructor.
   */
  protected LayoutComposite() {
    initWidget(new LayoutPanel());
  }
View Full Code Here

   * 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

  public CaptionLayoutPanel(final String text) {
    this(text, false);
  }

  public CaptionLayoutPanel(final String text, boolean asHTML) {
    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.setLayout(new BoxLayout(Orientation.VERTICAL));
    layoutPanel.setWidgetSpacing(0);

    caption = new Caption(text, asHTML);
    layoutPanel.add(caption, new BoxLayoutData(FillStyle.HORIZONTAL));

    body = new LayoutPanel();
    body.addStyleName("Body");
    layoutPanel.add(body, new BoxLayoutData(FillStyle.BOTH));

    setStyleName(DEFAULT_STYLENAME);
  }
View Full Code Here

   * @param headerTable the header table
   * @param images the images to use in the table
   */
  private void init(FixedWidthGrid dataTable, FixedWidthFlexTable headerTable,
      ScrollTableImages images) {
    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.setLayout(new BorderLayout());
    layoutPanel.setPadding(0);
    layoutPanel.setWidgetSpacing(0);

    this.dataTable = dataTable;
    this.headerTable = headerTable;
    this.images = images;
    resizeWorker.setColumnWidget(this);

    // Prepare the header and data tables
    prepareTable(dataTable, "dataTable");
    if (headerTable != null) {
      prepareTable(headerTable, "headerTable");
    }
    if (dataTable.getSelectionPolicy().hasInputColumn()) {
      headerTable.setColumnWidth(0, getInputColumnWidth());
    }

    setStylePrimaryName(DEFAULT_STYLENAME);

    // Create the table wrapper and spacer
    if (headerTable != null) {
      headerWrapper = createWrapper("headerWrapper");
      headerSpacer = createSpacer(headerWrapper.getElement());
    }
    dataWrapper = createWrapper("dataWrapper");

    // Create image to fill width
    fillWidthImage = new Image() {
      @Override
      public void onBrowserEvent(Event event) {
        super.onBrowserEvent(event);
        if (DOM.eventGetType(event) == Event.ONCLICK) {
          fillWidth();
        }
      }
    };

    // Adopt the header and the data tables into the panel
    if (headerTable != null) {
      adoptTable(headerTable, headerWrapper, Region.NORTH);
    }
    adoptTable(dataTable, dataWrapper, Region.CENTER);

    fillWidthImage.setTitle("Shrink/Expand to fill visible area");
    images.scrollTableFillWidth().applyTo(fillWidthImage);
    Element fillWidthImageElem = fillWidthImage.getElement();
    DOM.setStyleAttribute(fillWidthImageElem, "cursor", "pointer");
    DOM.setStyleAttribute(fillWidthImageElem, "position", "absolute");
    DOM.setStyleAttribute(fillWidthImageElem, "top", "0px");
    DOM.setStyleAttribute(fillWidthImageElem, "right", "0px");
    DOM.setStyleAttribute(fillWidthImageElem, "zIndex", "1");
    // Add after the dataTable, so that to be ignored by the layout manager!!!
    layoutPanel.add(fillWidthImage);

    // Create the sort indicator Image
    sortedColumnWrapper = DOM.createSpan();
    DOM.setInnerHTML(sortedColumnWrapper, "&nbsp;");
    DOM.appendChild(sortedColumnWrapper, sortedColumnIndicator.getElement());
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.