Example usage for com.google.gwt.user.client.ui Image getAltText

List of usage examples for com.google.gwt.user.client.ui Image getAltText

Introduction

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

Prototype

public String getAltText() 

Source Link

Document

Gets the alternate text for the image.

Usage

From source file:com.edgenius.wiki.gwt.client.widgets.ImageSlider.java

License:Open Source License

/**
 * @param entry/*from  w  w  w  .  j a v  a 2  s  .  co m*/
 */
private void setImageToPanel(String key, Image img) {
    VerticalKeyPanel imgPanel = new VerticalKeyPanel(key);
    img.setWidth(imageWidth + "px");
    img.setHeight(imageHeight + "px");
    imgPanel.add(img);
    if (StringUtil.equals(selectedID, key)) {
        imgPanel.setStyleName(Css.SELECTED);
    } else {
        imgPanel.setStyleName(Css.DESELECTED);
    }

    if (this.showAltText) {
        Label alt = new Label(img.getAltText());
        alt.setStyleName(Css.TITLE);
        imgPanel.add(alt);
        imgPanel.setCellHorizontalAlignment(alt, HasHorizontalAlignment.ALIGN_CENTER);
    }
    rowPanel.add(imgPanel);
}

From source file:org.kie.uberfire.client.common.FormStyleLayout.java

License:Apache License

private void doHeader(Image image, Widget title) {
    if (image.getAltText() == null) {
        image.setAltText("");
    }/*from   w w w  . j  a  v  a2s . com*/
    layout.setWidget(0, 0, image);
    formatter.setAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE);
    layout.setWidget(0, 1, title);
    numInLayout++;
}