Example usage for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE

List of usage examples for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE

Introduction

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

Prototype

VerticalAlignmentConstant ALIGN_MIDDLE

To view the source code for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE.

Click Source Link

Document

Specifies that the widget's contents should be aligned in the middle.

Usage

From source file:org.cruxframework.crux.widgets.client.grid.ColumnDefinition.java

License:Apache License

public ColumnDefinition(String label, String width, boolean visible, boolean frozen,
        HorizontalAlignmentConstant horizontalAlign, VerticalAlignmentConstant verticalAlign) {
    this.label = label;
    this.width = width;
    this.visible = visible;
    this.frozen = frozen;
    this.horizontalAlign = horizontalAlign == null ? HasHorizontalAlignment.ALIGN_CENTER : horizontalAlign;
    this.verticalAlign = verticalAlign == null ? HasVerticalAlignment.ALIGN_MIDDLE : verticalAlign;
}

From source file:org.cruxframework.crux.widgets.client.paging.RandomPager.java

License:Apache License

/**
 * Constructor//from  w w w .j a  va2  s  .  c  o m
 */
public RandomPager() {
    this.listBox = createListBox();

    this.panel = new HorizontalPanel();
    this.panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    this.panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    this.panel.setSpacing(2);

    this.panel.add(createFirstPageButton());
    this.panel.add(createPreviousButton());
    this.panel.add(listBox);
    this.panel.add(createNextButton());
    this.panel.add(createLastPageButton());

    this.panel.setStyleName("crux-RandomPager");
    initWidget(this.panel);
}

From source file:org.cruxframework.crux.widgets.client.paging.SequentialPager.java

License:Apache License

/**
 * Constructor//from w ww.  j  a  v a  2s. c om
 */
public SequentialPager() {
    this.panel = new HorizontalPanel();
    this.panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    this.panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    this.infoPanel = new SimplePanel();
    this.infoPanel.setWidget(createCurrentPageLabel("" + 0));

    this.panel.add(createPreviousButton());
    this.panel.add(infoPanel);
    this.panel.add(createNextButton());

    this.panel.setStyleName("crux-SequentialPager");

    initWidget(this.panel);
}

From source file:org.cruxframework.crux.widgets.client.scrollbanner.ScrollBanner.java

License:Apache License

/**
 * Default constructor//from   w w w. j a  va 2s  . c om
 */
public ScrollBanner() {
    HorizontalPanel basePanel = new HorizontalPanel();
    basePanel.setStyleName(DEFAULT_STYLE_NAME);
    basePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    messagesLabel = new Label(" ");
    messagesLabel.setStyleName("message");
    messagesLabel.getElement().getStyle().setProperty("overflow", "hidden");

    HorizontalPanel verticalCenteringPanel = createMessageVerticalCenteringPanel();
    SimplePanel overflowHiddenPanel = createMessageOverflowHiddenPanel(verticalCenteringPanel);

    basePanel.add(overflowHiddenPanel);
    basePanel.setCellHorizontalAlignment(overflowHiddenPanel, HasHorizontalAlignment.ALIGN_CENTER);
    basePanel.setCellVerticalAlignment(overflowHiddenPanel, HasVerticalAlignment.ALIGN_MIDDLE);

    VerticalPanel controllersPanel = createScrollingControlPanel();
    basePanel.add(controllersPanel);
    basePanel.setCellWidth(controllersPanel, "30");
    basePanel.setCellHorizontalAlignment(controllersPanel, HasHorizontalAlignment.ALIGN_RIGHT);
    basePanel.getElement().getStyle().setProperty("tableLayout", "fixed");

    initWidget(basePanel);
}

From source file:org.cruxframework.crux.widgets.client.scrollbanner.ScrollBanner.java

License:Apache License

/**
 * Creates a panel for vertical centering short texts.
 * @return//from w w w  .ja v a  2s  .  co  m
 */
private HorizontalPanel createMessageVerticalCenteringPanel() {
    HorizontalPanel verticalCenteringPanel = new HorizontalPanel();
    verticalCenteringPanel.setHeight("100%");
    verticalCenteringPanel.setWidth("100%");
    verticalCenteringPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    verticalCenteringPanel.add(messagesLabel);
    return verticalCenteringPanel;
}

From source file:org.cruxframework.crux.widgets.client.scrollbanner.ScrollBanner.java

License:Apache License

/**
 * Creates a vertical panel containing the scrolling buttons and the message counter
 * @return/*  w w w. j  ava2 s . c o  m*/
 */
private VerticalPanel createScrollingControlPanel() {
    VerticalPanel controllersPanel = new VerticalPanel();
    controllersPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    controllersPanel.setHeight("100%");

    FocusPanel previousMsgButton = createScrollButton("previousMessageButton",
            createPreviousMessageClickHandler());
    controllersPanel.add(previousMsgButton);
    controllersPanel.setCellVerticalAlignment(previousMsgButton, HasVerticalAlignment.ALIGN_TOP);

    this.messageCountLabel = new Label(" ");
    this.messageCountLabel.setStyleName("messageCount");
    controllersPanel.add(this.messageCountLabel);
    controllersPanel.setCellVerticalAlignment(this.messageCountLabel, HasVerticalAlignment.ALIGN_MIDDLE);

    FocusPanel nextMsgButton = createScrollButton("nextMessageButton", createNextMessageClickHandler());
    controllersPanel.add(nextMsgButton);
    controllersPanel.setCellVerticalAlignment(nextMsgButton, HasVerticalAlignment.ALIGN_BOTTOM);
    return controllersPanel;
}

From source file:org.cruxframework.crux.widgets.client.slideshow.SlideshowKeyboardController.java

License:Apache License

@Override
public void configurePhotoPanel() {
    table.add(photoPanel, DockPanel.CENTER);
    setVerticalAlignment(photoPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    setHorizontalAlignment(photoPanel, HasHorizontalAlignment.ALIGN_CENTER);
}

From source file:org.cruxframework.crux.widgets.client.stackmenu.StackMenuItemCaption.java

License:Apache License

/**
 * Creates the label of the item//from w  w w.j  a v a2s .  c  o  m
 * @param label
 * @param clickHandler
 * @return
 */
private Label createBody(String label) {
    canvas.setHTML(1, 0, " ");
    canvas.getCellFormatter().setStyleName(1, 0, "item-border-w");

    Label menuItemLabel = new Label(label);
    menuItemLabel.setStyleName("itemLabel");
    TextSelectionUtils.makeUnselectable(menuItemLabel.getElement());
    canvas.setWidget(1, 1, menuItemLabel);
    canvas.getCellFormatter().setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    this.hasSubItemsIndicator = createSubItemsIndicator();
    canvas.setWidget(1, 2, this.hasSubItemsIndicator);
    canvas.getCellFormatter().setStyleName(1, 2, "item-border-e");
    canvas.getCellFormatter().setVerticalAlignment(1, 2, HasVerticalAlignment.ALIGN_MIDDLE);

    return menuItemLabel;
}

From source file:org.cruxframework.crux.widgets.client.styledpanel.StyledPanel.java

License:Apache License

@Override
public void setVerticalAlignment(VerticalAlignmentConstant align) {
    String verticalAlign = "";

    if (align != null) {
        this.verticalAlignment = align;

        if (this.verticalAlignment.equals(HasVerticalAlignment.ALIGN_MIDDLE)) {
            verticalAlign = "middle";
        } else if (this.verticalAlignment.equals(HasVerticalAlignment.ALIGN_BOTTOM)) {
            verticalAlign = "bottom";
        }//  w w w  .  j av  a 2 s  . c om
    }

    Style style = internalPanel.getElement().getStyle();
    style.setProperty("verticalAlign", verticalAlign);
}

From source file:org.cruxframework.crux.widgets.client.transferlist.TransferList.java

License:Apache License

/**
 * @param panel2/*from w  w w. jav  a  2 s .co  m*/
 */
protected HorizontalPanel createPanelCells() {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setStyleName(DEFAULT_STYLE_NAME);
    createLeftList(panel);
    VerticalPanel commandsPanel = createCommands();
    panel.add(commandsPanel);
    panel.setCellVerticalAlignment(commandsPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    createRightList(panel);
    return panel;
}