Example usage for com.google.gwt.resources.client ImageResource ImageResource

List of usage examples for com.google.gwt.resources.client ImageResource ImageResource

Introduction

In this page you can find the example usage for com.google.gwt.resources.client ImageResource ImageResource.

Prototype

ImageResource

Source Link

Usage

From source file:org.waveprotocol.wave.client.wavepanel.impl.toolbar.gadget.info.GadgetInfoWidget.java

License:Apache License

public void setGadgetInfo(final GadgetInfo gadgetInfo) {
    gadgetImagePanel.clear();/*w ww . ja  v  a  2s .  c  om*/
    String imageUrl = gadgetInfo.getImageUrl();
    if (false && imageUrl != null && !imageUrl.isEmpty()) {
        gadgetImage = new Image(new ImageResource() {

            @Override
            public String getName() {
                return gadgetInfo.getName();
            }

            @Override
            public boolean isAnimated() {
                return false;
            }

            @Override
            public int getWidth() {
                return 150;
            }

            @Override
            public String getURL() {
                return gadgetInfo.getImageUrl();
            }

            @Override
            public int getTop() {
                return 0;
            }

            @Override
            public int getLeft() {
                return 0;
            }

            @Override
            public int getHeight() {
                return 150;
            }
        });
        gadgetImagePanel.add(gadgetImage);
    }
    gadgetUrl.setText(gadgetInfo.getGadgetUrl());
    name.setText(gadgetInfo.getName());
    description.setText(gadgetInfo.getDescription());
    primaryCategory.setText(gadgetInfo.getPrimaryCategory().getValue());
    secondaryCategory.setText(gadgetInfo.getSecondaryCategory().getValue());
    author.setText(gadgetInfo.getAuthor());
    submittedby.setText(gadgetInfo.getSubmittedBy());
}