Example usage for com.vaadin.client.ui ImageIcon ImageIcon

List of usage examples for com.vaadin.client.ui ImageIcon ImageIcon

Introduction

In this page you can find the example usage for com.vaadin.client.ui ImageIcon ImageIcon.

Prototype

public ImageIcon() 

Source Link

Usage

From source file:com.wcs.wcslib.vaadin.widget.multifileupload.client.CustomUploadConnector.java

License:Apache License

@Override
protected void init() {
    super.init();
    addStateChangeHandler("resources", new StateChangeEvent.StateChangeHandler() {
        @Override/*  w  ww. j  ava2 s. c  o  m*/
        public void onStateChanged(StateChangeEvent stateChangeEvent) {
            if (getIcon() != null) {
                if (getWidget().icon == null) {
                    getWidget().icon = new ImageIcon();
                    Element iconElement = getWidget().icon.getElement();
                    getWidget().submitButton.wrapper.insertBefore(iconElement,
                            getWidget().submitButton.captionElement);
                }
                getWidget().icon.setUri(getIconUri());
            } else {
                if (getWidget().icon != null) {
                    getWidget().submitButton.wrapper.removeChild(getWidget().icon.getElement());
                    getWidget().icon = null;
                }
            }
        }
    });
}