Example usage for com.google.gwt.user.client.ui HorizontalPanel setVerticalAlignment

List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setVerticalAlignment

Introduction

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

Prototype

public void setVerticalAlignment(VerticalAlignmentConstant align) 

Source Link

Document

Sets the default vertical alignment to be used for widgets added to this panel.

Usage

From source file:uk.ac.ncl.openlab.intake24.client.ui.widgets.TimePicker.java

public TimePicker(Time initialTime) {
    /*boolean isAm = false;
            /*from   www . ja  v a2  s.  c  o m*/
    if (initialTime.hours < 12)
       isAm = true;
            
    int ampmHours;
            
    if (isAm) {
       ampmHours = initialTime.hours;
    } else {
       ampmHours = initialTime.hours - 12;
    }
            
    if (ampmHours == 0)
       ampmHours = 12;*/

    hourCounter = new Counter(0, 23, 1, initialTime.hours, "00");
    minuteCounter = new Counter(0, 45, 15, initialTime.minutes, "00");
    // ampm = new AmPmPicker(initialTime.am);

    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(5);
    panel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);

    Label label = new Label(":");

    if (LocaleInfo.getCurrentLocale().isRTL()) {
        panel.add(minuteCounter);
        panel.add(label);
        panel.add(hourCounter);
    } else {
        panel.add(hourCounter);
        panel.add(label);
        panel.add(minuteCounter);
    }

    //panel.add(ampm);

    initWidget(panel);

    addStyleName("time-picker");
}

From source file:us.asciiroth.editor.client.InstanceEditor.java

License:Apache License

private void createPanelContents(String template) {
    Grid grid = new Grid(1, 5);
    grid.setWidth("100%");
    grid.setCellPadding(0);//from w  w  w.jav  a  2s  . c om
    grid.setCellSpacing(0);
    grid.getCellFormatter().setWidth(0, 0, "25px");
    grid.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
    grid.getCellFormatter().setWidth(0, 1, "25px");
    grid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);
    grid.getCellFormatter().setWidth(0, 2, "25px");
    grid.getCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_CENTER);
    grid.getCellFormatter().setWidth(0, 4, "120px");
    grid.getCellFormatter().setHorizontalAlignment(0, 4, HasHorizontalAlignment.ALIGN_RIGHT);
    HorizontalPanel hpanel = new HorizontalPanel();
    hpanel.setWidth("100%");
    hpanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    hpanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    // panel.add(hpanel);
    panel.add(grid);

    // The symbol itself
    symbol = new HTML(EMPTY);
    // hpanel.add(symbol);
    grid.setWidget(0, 0, symbol);

    color = new HTML(EMPTY);
    // hpanel.add(color);
    grid.setWidget(0, 1, color);

    // status
    status = new Image("icons/bullet_delete.png");
    // hpanel.add(status);
    grid.setWidget(0, 2, status);

    field = new TextArea();
    field.setWidth("400px");
    field.setVisibleLines(1);
    field.setText(template);
    field.addFocusHandler(this);
    field.addKeyUpHandler(this);
    // hpanel.add(field);
    grid.setWidget(0, 3, field);

    final InstanceEditor that = this;
    Hyperlink hyperlink = new Hyperlink("Remove", "remove");
    hyperlink.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            BoardEditor boardEditor = Editor.get().getBoardEditor();
            boardEditor.removePiece(piece);
            Editor.get().getInstancePalette().remove(that);
        }
    });
    // hpanel.add(hyperlink);
    grid.setWidget(0, 4, hyperlink);
}

From source file:us.asciiroth.editor.client.ui.BrushPalette.java

License:Apache License

public BrushPalette() {
    super();/*from  ww w.  j a  v a  2s  .c o  m*/
    setTitle("Brush Options");

    position = new Label();

    HorizontalPanel hp = new HorizontalPanel();
    hp.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    createBrushOption(hp, "1");
    createBrushOption(hp, "2");
    createBrushOption(hp, "5");
    createBrushOption(hp, "10");
    createBrushOption(hp, "20");

    setAttribute("X/Y:", position);
    setAttributeAlignMiddle("Brush:", hp);

    RootPanel.get("sideViews").add(this);
}