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:com.risevision.ui.client.common.widgets.ActionsWidget.java

License:Open Source License

public ActionsWidget() {
    this.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
}

From source file:com.risevision.ui.client.common.widgets.background.BackgroundWidget.java

License:Open Source License

public BackgroundWidget() {
    HorizontalPanel panel = new HorizontalPanel();

    panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    styleLabel.addStyleName("rdn-OverflowElipsis");
    styleLabel.setWidth("175px");

    panel.add(styleLabel);/*from ww w. j ava 2 s.c o  m*/
    panel.add(new SpacerWidget());
    panel.add(editLink);

    editLink.addClickHandler(this);
    hideCommand = new Command() {
        @Override
        public void execute() {
            init(backgroundDialog.getStyle(), backgroundDialog.isScaleToFit());
        }
    };

    initWidget(panel);
}

From source file:com.risevision.ui.client.common.widgets.colorPicker.ColorPickerDialog.java

License:Open Source License

public ColorPickerDialog() {
    super(false, true); //set auto-hide and modal

    contentPanel.add(colorPalette);/*w ww .j a  va2s . c  om*/
    contentPanel.add(colorRGB);
    contentPanel.add(colorHSV);
    contentPanel.add(colorMap);

    contentBar.addTab("Palette");
    contentBar.addTab("RGB");
    contentBar.addTab("HSV");
    contentBar.addTab("Map");

    contentPanel.showWidget(PALETTE_PANEL);
    contentBar.selectTab(PALETTE_PANEL);

    // Define the panels
    HorizontalPanel colorPanel = new HorizontalPanel();
    colorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    colorPanel.add(new Label("Color:"));
    colorPanel.add(new SpacerWidget());
    colorPanel.add(colorTextBox);

    HorizontalPanel transparencyPanel = new HorizontalPanel();
    transparencyPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    transparencyPanel.add(new Label("None:"));
    transparencyPanel.add(new SpacerWidget());
    transparencySwab.setWidth("20px");
    transparencySwab.setHeight("20px");
    transparencySwab.getElement().getStyle().setProperty("border", "1px solid #666");
    //        DOM.setStyleAttribute(getElement(), "cursor", "default");
    transparencySwab.getElement().getStyle().setProperty("backgroundImage", "url(/images/preview-opacity.png)");
    transparencyPanel.add(transparencySwab);

    VerticalPanel previewPanel = new VerticalPanel();
    previewPanel.setHeight("100%");
    previewPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    previewPanel.add(previewWidget);
    previewPanel.add(historyWidget);

    HorizontalPanel alphaPanel = new HorizontalPanel();
    alphaPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    alphaPanel.setWidth("100%");
    alphaPanel.add(new Label("Alpha:"));
    HTML spacer3 = new HTML(" ");
    alphaPanel.add(spacer3);
    alphaPanel.setCellWidth(spacer3, "100%");
    alphaPanel.add(alphaSlider);

    buttonPanel.add(okButton);
    buttonPanel.add(new SpacerWidget());
    buttonPanel.add(cancelButton);

    // Put it together      
    FlexTable middleTable = new FlexTable();
    middleTable.setCellSpacing(0);
    middleTable.setCellPadding(0);

    middleTable.setWidget(0, 0, colorPanel);
    middleTable.getCellFormatter().setWidth(0, 1, "5px");
    middleTable.setWidget(0, 2, transparencyPanel);

    middleTable.getCellFormatter().setHeight(1, 0, "5px");

    middleTable.setWidget(2, 0, contentBar);

    middleTable.setWidget(3, 0, contentPanel);
    middleTable.getCellFormatter().setVerticalAlignment(3, 2, HasVerticalAlignment.ALIGN_MIDDLE);
    middleTable.getCellFormatter().setHorizontalAlignment(3, 2, HasHorizontalAlignment.ALIGN_CENTER);
    middleTable.setWidget(3, 2, previewPanel);

    middleTable.getCellFormatter().setHeight(4, 0, "5px");

    middleTable.setWidget(5, 0, alphaPanel);
    middleTable.setWidget(5, 2, alphaTextBox);

    middleTable.setWidget(6, 0, buttonPanel);

    setWidget(middleTable);

    styleControls();
    initButtons();
    initHandlers();
    initCommands();
}

From source file:com.risevision.ui.client.common.widgets.RiseMultiSelectWidget.java

License:Open Source License

public void addOther() {
    CheckBox itemCheckBox = new CheckBox();
    itemCheckBox.addValueChangeHandler(this);
    //      itemCheckBox.setStyleName("rdn-CheckBox");

    Label nameLabel = new Label("Other:");
    nameLabel.setStyleName("rva-ShortText");
    nameLabel.getElement().getStyle().setProperty("whiteSpace", "nowrap");

    otherTextBox = new TextBox();

    HorizontalPanel checkBoxPanel = new HorizontalPanel();
    checkBoxPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    checkBoxPanel.add(itemCheckBox);/*  ww  w .ja v  a 2 s .  c o  m*/
    checkBoxPanel.add(new SpacerWidget());
    checkBoxPanel.add(nameLabel);
    checkBoxPanel.add(new SpacerWidget());
    checkBoxPanel.add(otherTextBox);

    listPanel.add(checkBoxPanel);

    checkBoxList.add(itemCheckBox);
    valuesList.add(null);
}

From source file:com.risevision.ui.client.common.widgets.textStyle.TextStyleDialog.java

License:Open Source License

public TextStyleDialog() {
    super(false, true); //set auto-hide and modal

    buttonPanel.add(okButton);//from   w w  w . j a v a 2 s .c  o m
    buttonPanel.add(new SpacerWidget());
    buttonPanel.add(cancelButton);

    HorizontalPanel stylePanel = new HorizontalPanel();
    stylePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    stylePanel.add(boldCheckBox);
    stylePanel.add(new Label("Bold"));
    stylePanel.add(new SpacerWidget());
    stylePanel.add(italicCheckBox);
    stylePanel.add(new Label("Italic"));

    HorizontalPanel cssPanel = new HorizontalPanel();
    cssPanel.add(cssLabel);
    cssPanel.add(cssTextBox);
    cssPanel.add(new SpacerWidget());
    cssPanel.add(showCssLink);

    gridAdd("Use URL Font:", useUrlCheckBox, "rdn-CheckBox");
    gridAdd("Font URL:", fontUrlTextBox, "rdn-TextBoxMedium");
    mainGrid.getRowFormatter().setVisible(1, false);
    gridAdd("Font Family:", familyListBox, "rdn-ListBoxMedium");
    gridAdd("Font Color:", colorTextBox, "rdn-TextBoxMedium");
    gridAdd("Font Size:", sizeListBox, "rdn-ListBoxShort");
    gridAdd("", stylePanel, "");
    gridAdd("CSS Style:", cssPanel, "");

    mainGrid.getFlexCellFormatter().setColSpan(6, 1, 2);
    mainGrid.getFlexCellFormatter().setRowSpan(0, 2, 6);
    mainGrid.getCellFormatter().setWidth(0, 2, "100%");
    mainGrid.getCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_CENTER);
    mainGrid.setWidget(0, 2, previewWidget);

    VerticalPanel mainPanel = new VerticalPanel();
    mainPanel.add(mainGrid);
    mainPanel.add(buttonPanel);

    setWidget(mainPanel);

    updateTextBoxes();
    styleControls();
    initButtons();
    initHandlers();
}

From source file:com.risevision.ui.client.common.widgets.textStyle.TextStyleWidget.java

License:Open Source License

public TextStyleWidget(String propertyId) {
    this.propertyId = propertyId;

    HorizontalPanel panel = new HorizontalPanel();

    panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    editStyleButton.getElement().getStyle().setProperty("backgroundImage", "url(/images/font.png)");
    editStyleButton.getElement().getStyle().setProperty("cursor", "hand");
    editStyleButton.setHeight("16px");
    editStyleButton.setWidth("16px");

    styleLabel.addStyleName("rdn-OverflowElipsis");
    styleLabel.setWidth("400px");

    panel.add(styleLabel);//from  w  ww .j  a v a 2 s .c om
    panel.add(new SpacerWidget());
    panel.add(editStyleButton);

    editStyleButton.addClickHandler(this);
    hideCommand = new Command() {
        @Override
        public void execute() {
            setText(styleDialog.getStyle());
        }
    };

    initWidget(panel);
}

From source file:com.risevision.ui.client.display.RestartWidget.java

License:Open Source License

public RestartWidget() {
    setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    //      add(cbRestartEnabled);
    //      add(lbRestartTime);
    add(lstRestartTime);//from   w ww.j av  a 2 s . com

    styleControls();

    lstRestartTime.addItem("None", "none");

    //      cbRestartEnabled.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
    //         public void onValueChange(ValueChangeEvent<Boolean> event) {
    //            lstRestartTime.setEnabled(cbRestartEnabled.getValue());
    //         }
    //      });
}

From source file:com.risevision.viewer.client.widgets.ViewerNotificationsWidget.java

License:Open Source License

public ViewerNotificationsWidget() {
    add(errorIcon);//from   www .  jav a 2  s. co  m
    setCellHorizontalAlignment(errorIcon, HasHorizontalAlignment.ALIGN_CENTER);
    setCellVerticalAlignment(errorIcon, HasVerticalAlignment.ALIGN_MIDDLE);
    add(messageContainer);

    messageCounterLabel = new MessageCounterLabel() {

        @Override
        void run() {
            hide();
        }
    };

    styleControls();
}

From source file:com.scurab.web.drifmaps.client.form.VerySimpleForm.java

License:Apache License

protected Widget hp(Widget first, Widget... others) {
    if (others.length == 0) {
        return first;
    }// w  ww  .  j  a v a  2s. com

    HorizontalPanel p = new HorizontalPanel();
    p.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    p.add(first);
    for (Widget other : others) {
        // mmmm.. hacky.
        p.add(new HTML("&nbsp;&nbsp;"));
        p.add(other);
    }
    return p;
}

From source file:com.scurab.web.drifmaps.client.form.VerySimpleForm.java

License:Apache License

protected Widget hpWithNoGap(Widget first, Widget... others) {
    if (others.length == 0) {
        return first;
    }//from w w w .  j  a va2  s.co  m

    HorizontalPanel p = new HorizontalPanel();
    p.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    p.add(first);
    for (Widget other : others) {
        p.add(other);
    }
    return p;
}