Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
public class ItemWidget extends Composite {
  @Inject private @Bound @DataField Label name;
  @Inject private @Bound @DataField Label comment;
  private @Bound(converter=RelativeTimeConverter.class) @DataField Element addedOn = DOM.createSpan();
  private @Bound(converter=UsernameConverter.class) @DataField Element addedBy = DOM.createSpan();
  @Inject private @DataField Label department;
  void init() {
    // need to switch the databinder's model when the item's department reference changes
      public void onPropertyChange(PropertyChangeEvent<Departmentevent) {
    // TODO (ERRAI-382) convert these to a method with @EventHandler("this")
      public void onMouseOver(MouseOverEvent event) {
        ..println("MouseOver " + .getModel().getName());
    }, MouseOverEvent.getType());
      public void onMouseOut(MouseOutEvent event) {
        ..println("MouseOut " + .getModel().getName());
    }, MouseOutEvent.getType());

Changes the model object visualized by this class to the given one.

item The item that should become the model of this class. Must not be null.
The proxied version of the given item object, for purposes of data binding. If you intend to make any changes to the state of the item after adding it to this widget, you must do so via this returned proxy. If you modify the item directly (rather than via the proxy) then this UI widget will not update.
  public Item setItem(Item item) {
    ..println("ItemWidget: adopting model object " + System.identityHashCode(item));
    if (item.getDepartment() == null) {
      item.setDepartment(new Department());
    return .setModel(item.);
New to GrepCode? Check out our FAQ X