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

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

Introduction

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

Prototype

public void setCellVerticalAlignment(IsWidget w, VerticalAlignmentConstant align) 

Source Link

Document

Overloaded version for IsWidget.

Usage

From source file:com.google.gwt.maps.testing.client.maps.AutocompletePlacesMapWidget.java

License:Apache License

private void draw() {

    pWidget.clear();/*from ww w .  j a  v  a 2 s .  c om*/

    HTML html = new HTML("<br><br>Map with autocomplete places &nbsp;&nbsp;");
    tbPlaces = new TextBox();
    tbPlaces.setWidth("350px");

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(html);
    hp.add(tbPlaces);

    pWidget.add(hp);

    hp.setCellVerticalAlignment(tbPlaces, HorizontalPanel.ALIGN_BOTTOM);

    drawMap();

    drawAutoComplete();
}

From source file:com.google.gwt.maps.testing.client.maps.BasicMapWidget.java

License:Apache License

private void draw() {
    Button addBounceMarkerButton = new Button("Add Marker with Bounce");
    addBounceMarkerButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            if (markerBouncing != null) {
                markerBouncing.clear();/*from w w  w.  j ava  2 s.  c o m*/
            }
            drawMarkerWithBounceAnimation();
        }
    });

    Button addDropMarkerButton = new Button("Add Marker with Drop");
    addDropMarkerButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            if (markerDrop != null) {
                markerDrop.clear();
            }
            drawMarkerWithDropAnimation();
        }
    });

    Button stopAnimationsButton = new Button("Stop Animations");
    stopAnimationsButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            if (markerBasic != null) {
                markerBasic.setAnimation(Animation.STOPANIMATION);
            }
            if (markerBouncing != null) {
                markerBouncing.setAnimation(Animation.STOPANIMATION);
            }
            if (markerDrop != null) {
                markerDrop.setAnimation(Animation.STOPANIMATION);
            }
        }
    });

    Button startAnimationsButton = new Button("Start Animations");
    startAnimationsButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            if (markerBasic != null) {
                markerBasic.setAnimation(Animation.BOUNCE);
            }
            if (markerBouncing != null) {
                markerBouncing.setAnimation(Animation.BOUNCE);
            }
            if (markerDrop != null) {
                markerDrop.setAnimation(Animation.DROP);
            }
        }
    });

    // basic controls to test markers
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(new HTML("<br>Basic Map Example. With an AdUnit"));
    hp.add(addBounceMarkerButton);
    hp.add(new HTML("&nbsp;"));
    hp.add(addDropMarkerButton);
    hp.add(new HTML("&nbsp;"));
    hp.add(startAnimationsButton);
    hp.add(new HTML("&nbsp;"));
    hp.add(stopAnimationsButton);
    hp.setCellVerticalAlignment(addBounceMarkerButton, VerticalPanel.ALIGN_BOTTOM);
    hp.setCellVerticalAlignment(addDropMarkerButton, VerticalPanel.ALIGN_BOTTOM);
    hp.setCellVerticalAlignment(startAnimationsButton, VerticalPanel.ALIGN_BOTTOM);
    hp.setCellVerticalAlignment(stopAnimationsButton, VerticalPanel.ALIGN_BOTTOM);

    pWidget.clear();
    pWidget.add(hp);

    drawMap();
    drawMapAds();
    drawBasicMarker();
}

From source file:com.google.gwt.sample.stockwatcher.client.Footer.java

@SuppressWarnings("unused")
private void addLinkSeparator(HorizontalPanel _anchorPanel) {
    Label linkSeparator = new Label();

    linkSeparator.setText("|");
    linkSeparator.addStyleName("footer-link-separator");

    _anchorPanel.add(linkSeparator);/* w  w w  .  j  ava  2s .c  om*/
    _anchorPanel.setCellVerticalAlignment(linkSeparator, HasVerticalAlignment.ALIGN_MIDDLE);
}

From source file:com.google.gwt.sample.stockwatcher.client.Menu.java

public Menu() {
    // Set up menu items
    setupAnchors();/* w  w  w  .j  a  v a 2  s  .  c  o m*/
    // Render the main menu and its sub menus
    selectionPanel.clear();
    selectionPanel.add(new HTML(verticalLine));
    renderHomeAnchor();
    renderMonitoringMenu("Monitoring/Reporting");
    renderPlanningMenu("Control Module");
    renderSettingsMenu("Device Setting");
    renderOptionsMenu(Images.getImage(Images.GEAR_ICON, Menu.HEIGHT));
    renderNotificationAnchor();

    // Set up logo and title
    fsktmLogo.setHTML(Images.getImage(Images.FSKTM_LOGO, Menu.HEIGHT));
    systemTitleLabel.setText(SYSTEM_TITLE);
    systemTitleLabel.addStyleName("gwt-MainMenuTitle");

    HorizontalPanel leftMenuContainerPanel = new HorizontalPanel();
    leftMenuContainerPanel.add(new HTML(Images.getImage(Images.LOADING_EPIC2, Menu.HEIGHT)));
    leftMenuContainerPanel.add(fsktmLogo);
    leftMenuContainerPanel.add(systemTitleLabel);
    leftMenuContainerPanel.add(selectionPanel);
    leftMenuContainerPanel.add(arrowAnchor);
    leftMenuContainerPanel.setCellVerticalAlignment(fsktmLogo, HasVerticalAlignment.ALIGN_MIDDLE);
    leftMenuContainerPanel.setCellVerticalAlignment(systemTitleLabel, HasVerticalAlignment.ALIGN_MIDDLE);
    leftMenuContainerPanel.setCellVerticalAlignment(selectionPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    leftMenuContainerPanel.setCellVerticalAlignment(arrowAnchor, HasVerticalAlignment.ALIGN_MIDDLE);

    HorizontalPanel rightMenuContainerPanel = new HorizontalPanel();
    rightMenuContainerPanel.add(cNotificationAnchor);
    rightMenuContainerPanel.add(sNotificationAnchor);
    rightMenuContainerPanel.add(aNotificationAnchor);
    rightMenuContainerPanel.add(optionsPanel);
    rightMenuContainerPanel.setWidth("100%");
    rightMenuContainerPanel.setCellHorizontalAlignment(cNotificationAnchor, HasHorizontalAlignment.ALIGN_RIGHT);
    rightMenuContainerPanel.setCellHorizontalAlignment(sNotificationAnchor, HasHorizontalAlignment.ALIGN_RIGHT);
    rightMenuContainerPanel.setCellHorizontalAlignment(aNotificationAnchor, HasHorizontalAlignment.ALIGN_RIGHT);
    rightMenuContainerPanel.setCellHorizontalAlignment(optionsPanel, HasHorizontalAlignment.ALIGN_RIGHT);

    // Container Panel for Main Menu Panel
    HorizontalPanel menuContainerPanel = new HorizontalPanel();
    menuContainerPanel.add(leftMenuContainerPanel);
    menuContainerPanel.add(rightMenuContainerPanel);
    menuContainerPanel.setCellVerticalAlignment(leftMenuContainerPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    menuContainerPanel.setCellVerticalAlignment(rightMenuContainerPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    menuContainerPanel.setCellHorizontalAlignment(rightMenuContainerPanel, HasHorizontalAlignment.ALIGN_RIGHT);
    menuContainerPanel.setWidth("100%");

    // Set up main menu panel
    mainMenuPanel.clear();
    mainMenuPanel.setWidth("100%");
    mainMenuPanel.getElement().getStyle().setHeight(HEIGHT, Unit.PX);
    mainMenuPanel.addStyleName("gwt-MainMenuPanel");
    mainMenuPanel.add(menuContainerPanel);
    mainMenuPanel.setCellVerticalAlignment(menuContainerPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    mainMenuPanel.setCellHeight(menuContainerPanel, "100%");

    initWidget(mainMenuPanel);
}

From source file:com.google.gwt.sample.userwatcher.client.FileUploaderWidget_v2.java

/**
 * constructor/* www  . j a va 2  s . c  om*/
 * 
 * @param cp
 */
public FileUploaderWidget_v2(ClientPersistence cp) {
    this.cp = cp;

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(pUpload);
    pUpload.setWidth("100%");
    hp.setCellWidth(pUpload, "100%");
    hp.setCellHorizontalAlignment(pUpload, HasHorizontalAlignment.ALIGN_CENTER);
    hp.setCellVerticalAlignment(pUpload, HasVerticalAlignment.ALIGN_MIDDLE);
    hp.add(bCancel);
    hp.setCellHorizontalAlignment(bCancel, HasHorizontalAlignment.ALIGN_RIGHT);
    hp.setCellVerticalAlignment(bCancel, HasVerticalAlignment.ALIGN_MIDDLE);

    pWidget.add(hp);
    hp.setWidth("100%");
    pWidget.setCellWidth(hp, "100%");
    pWidget.add(pFullSize);
    pWidget.add(pThumb);

    initWidget(pWidget);

    pWidget.setWidth("100%");

    //pWidget.addStyleName("test2");
    //hp.addStyleName("test3");
    //pFullSize.addStyleName("test3");

    setup();
}

From source file:com.google.sampling.experiential.client.ExperimentRow.java

License:Open Source License

public ExperimentRow(Images resources, ExperimentDAO experiment, ExperimentListener listener, boolean joined,
        boolean findView) {
    this.images = resources;
    this.myConstants = GWT.create(MyConstants.class);
    this.experiment = experiment;
    this.joined = joined;
    this.findView = findView;
    this.listeners = new ArrayList<ExperimentListener>();
    if (listener != null) {
        listeners.add(listener);/*from   w w w . j a  va 2s  .co m*/
    }
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setStyleName("paco-experimentRow");
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel.setSpacing(1);
    horizontalPanel.setHeight("42px");
    initWidget(horizontalPanel);

    Image experimentIcon = new Image(resources.question());
    experimentIcon.setAltText(myConstants.experimentIcon());
    horizontalPanel.add(experimentIcon);
    horizontalPanel.setCellHeight(experimentIcon, "42");
    horizontalPanel.setCellWidth(experimentIcon, "42");
    horizontalPanel.setCellHorizontalAlignment(experimentIcon, HasHorizontalAlignment.ALIGN_CENTER);
    horizontalPanel.setCellVerticalAlignment(experimentIcon, HasVerticalAlignment.ALIGN_BOTTOM);
    experimentIcon.setSize("42px", "42px");

    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.setHeight("39px");
    horizontalPanel.add(verticalPanel);

    HorizontalPanel horizontalPanel_2 = new HorizontalPanel();
    horizontalPanel_2.setHeight("19px");
    verticalPanel.add(horizontalPanel_2);

    Label experimentTitleLabel = new Label(experiment.getTitle());
    if (experiment.getDeleted() != null && experiment.getDeleted()) {
        experimentTitleLabel.setStyleName("gwt-Link-underline-strikethrough");
    } else {
        experimentTitleLabel.setStyleName("gwt-Link-underline");
    }
    horizontalPanel_2.add(experimentTitleLabel);
    horizontalPanel_2.setCellWidth(experimentTitleLabel, "22px");
    horizontalPanel_2.setCellHeight(experimentTitleLabel, "18px");
    experimentTitleLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    horizontalPanel.setCellVerticalAlignment(experimentTitleLabel, HasVerticalAlignment.ALIGN_MIDDLE);
    experimentTitleLabel.setWidth("180px");
    ClickHandler titleHandler = new ClickHandler() {
        public void onClick(ClickEvent event) {
            showExperimentDetails();
        }
    };
    if (!isExperimentPurged()) {
        experimentTitleLabel.addClickHandler(titleHandler);
        experimentIcon.addClickHandler(titleHandler);
    }

    HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
    horizontalPanel_1.setSpacing(1);
    verticalPanel.add(horizontalPanel_1);

    createButtonPanel(experiment, joined, horizontalPanel, horizontalPanel_1, findView);

}

From source file:com.google.sampling.experiential.client.ExperimentRow.java

License:Open Source License

private void createDetailsButton(HorizontalPanel horizontalPanel, HorizontalPanel horizontalPanel_1) {
    Button copyButton = new Button(myConstants.copy());
    copyButton.setStyleName("paco-ExperimentRow-Button");
    copyButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            showExperimentDetails();// w  w w. ja v  a2 s.c  o m
        }
    });
    horizontalPanel_1.add(copyButton);
    horizontalPanel.setCellVerticalAlignment(copyButton, HasVerticalAlignment.ALIGN_MIDDLE);
}

From source file:com.google.sampling.experiential.client.ExperimentRow.java

License:Open Source License

private void createEodRefButton(HorizontalPanel horizontalPanel, HorizontalPanel horizontalPanel_1) {
    Button refButton = new Button(myConstants.eodRef());
    refButton.setStyleName("paco-ExperimentRow-Button");
    refButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            showRefDialog();/*w  w w.j a  v a  2  s  .  co  m*/
        }
    });
    horizontalPanel_1.add(refButton);
    horizontalPanel.setCellVerticalAlignment(refButton, HasVerticalAlignment.ALIGN_MIDDLE);
}

From source file:com.google.sampling.experiential.client.ExperimentRow.java

License:Open Source License

private void createQRCodeButton(HorizontalPanel horizontalPanel, HorizontalPanel horizontalPanel_1) {
    Button qrCodeButton = new Button(myConstants.qrCode());
    qrCodeButton.setStyleName("paco-ExperimentRow-Button");
    qrCodeButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            showQRCode();// w  w  w .j a v a 2 s .  c  o  m
        }
    });
    horizontalPanel_1.add(qrCodeButton);
    horizontalPanel.setCellVerticalAlignment(qrCodeButton, HasVerticalAlignment.ALIGN_MIDDLE);
}

From source file:com.google.sampling.experiential.client.ExperimentRow.java

License:Open Source License

private void createPurgeButton(HorizontalPanel horizontalPanel, HorizontalPanel horizontalPanel_1) {
    Button deleteButton = new Button(myConstants.purge());
    deleteButton.setStyleName("paco-ExperimentRow-Button");
    deleteButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            deleteExperiment();//from   ww w. jav  a 2s  .c o m
        }
    });
    horizontalPanel_1.add(deleteButton);
    horizontalPanel.setCellVerticalAlignment(deleteButton, HasVerticalAlignment.ALIGN_MIDDLE);
}