Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.errai.ui.client.widget;
 
 import  com.google.gwt.event.logical.shared.ValueChangeEvent;
 import  com.google.gwt.event.logical.shared.ValueChangeHandler;
 import  com.google.gwt.event.shared.HandlerRegistration;
 import  com.google.gwt.safehtml.shared.UriUtils;
 import  com.google.gwt.user.client.ui.HasValue;
 import  com.google.gwt.user.client.ui.Image;

Author(s):
edewit@redhat.com
public class ValueImage extends Image implements HasValue<String> {
  public String getValue() {
    return getUrl();
  }
  public void setValue(String value) {
    setValue(valuefalse);
  }
  public void setValue(String valueboolean fireEvents) {
    String oldValue = getValue();
    setUrl(UriUtils.fromSafeConstant(value));
    if (fireEvents) {
      ValueChangeEvent.fireIfNotEqual(thisoldValuevalue);
    }
  }
  public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Stringhandler) {
    return addHandler(handler, ValueChangeEvent.getType());
  }
New to GrepCode? Check out our FAQ X