Example usage for com.google.gwt.user.client.ui CellPanel setCellVerticalAlignment

List of usage examples for com.google.gwt.user.client.ui CellPanel setCellVerticalAlignment

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui CellPanel setCellVerticalAlignment.

Prototype

protected void setCellVerticalAlignment(Element td, VerticalAlignmentConstant align) 

Source Link

Usage

From source file:com.mj.jqplot.sampling.client.utils.Utils.java

License:Open Source License

public static void alignMiddle(CellPanel table, Widget w) {
    table.setCellVerticalAlignment(w, HasAlignment.ALIGN_MIDDLE);
}

From source file:com.mj.jqplot.sampling.client.utils.Utils.java

License:Open Source License

public static void alignTop(CellPanel table, Widget w) {
    table.setCellVerticalAlignment(w, HasAlignment.ALIGN_TOP);
}

From source file:com.mj.jqplot.sampling.client.utils.Utils.java

License:Open Source License

public static void alignBottom(CellPanel table, Widget w) {
    table.setCellVerticalAlignment(w, HasAlignment.ALIGN_BOTTOM);
}

From source file:de.eckhartarnold.client.TiledLayout.java

License:Apache License

private int createTiles(CellPanel parent, ImageCollectionInfo info, String config, int i) {
    while (i < config.length()) {
        switch (config.charAt(i)) {
        case ('C'): {
            parent.add(caption);/*from   w  w w  .j  a  v a  2 s  .c  om*/
            caption.addStyleDependentName("tiled");
            parent.setCellVerticalAlignment(caption, HasVerticalAlignment.ALIGN_MIDDLE);
            parent.setCellHorizontalAlignment(caption, HasHorizontalAlignment.ALIGN_CENTER);
            parent.setCellWidth(caption, "100%");
            break;
        }
        case ('O'): {
            overlay = new CaptionOverlay(caption, imagePanel, slideshow,
                    info.getInfo().get(CaptionOverlay.KEY_CAPTION_POSITION));
        }
        case ('I'): {
            parent.add(imagePanel);
            parent.setCellVerticalAlignment(imagePanel, HasVerticalAlignment.ALIGN_MIDDLE);
            parent.setCellHorizontalAlignment(imagePanel, HasHorizontalAlignment.ALIGN_CENTER);
            parent.setCellWidth(imagePanel, "100%");
            parent.setCellHeight(imagePanel, "100%");
            break;
        }
        case ('P'):
        case ('F'): {
            assert control instanceof Widget;
            parent.add((Widget) control);
            ((Widget) control).addStyleDependentName("tiled");
            parent.setCellVerticalAlignment(((Widget) control), HasVerticalAlignment.ALIGN_MIDDLE);
            if (parent instanceof HorizontalPanel && parent.getWidgetCount() == 1) {
                parent.setCellHorizontalAlignment(((Widget) control), HasHorizontalAlignment.ALIGN_RIGHT);
            } else {
                parent.setCellHorizontalAlignment(((Widget) control), HasHorizontalAlignment.ALIGN_CENTER);
            }
            break;
        }
        case ('-'): {
            HTML horizLine = new HTML("<hr class=\"tiledSeparator\" />");
            panel.add(horizLine);
            break;
        }
        case (']'): {
            return i;
        }
        case ('['): {
            CellPanel panel;
            if (parent instanceof VerticalPanel) {
                panel = new HorizontalPanel();
                panel.setStyleName("tiled");
            } else {
                panel = new VerticalPanel();
                panel.setStyleName("tiled");
            }
            i = createTiles(panel, info, config, i + 1);
            parent.add(panel);
            break;
        }
        default:
            assert false : "Illegal token '" + config.charAt(i) + "' in config string";
        }
        i++;
    }
    return i;
}

From source file:org.pentaho.gwt.widgets.client.controls.DateTimePicker.java

License:Open Source License

public DateTimePicker(Layout layout) {
    super();/*from  w w w  . ja v a 2s .  com*/
    CellPanel p = (Layout.HORIZONTAL == layout) ? new HorizontalPanel() : new VerticalPanel();
    add(p);
    datePicker.getDatePicker().setWidth("12ex"); //$NON-NLS-1$
    p.add(datePicker.getDatePicker());
    p.setCellVerticalAlignment(datePicker.getDatePicker(), HasVerticalAlignment.ALIGN_MIDDLE);
    // timePicker.setWidth( "100%" );
    p.add(timePicker);
    p.setCellVerticalAlignment(timePicker, HasVerticalAlignment.ALIGN_MIDDLE);
    configureOnChangeHandler();
}