dataSnapshot.put("oldValue", item.getLabel().getText());
dataSnapshot.put("newValue", textBox.getValue());
bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
@Override
public void undoAction(UndoableEvent event) {
LabelFormItem myItem = (LabelFormItem) event.getData("item");
String value = (String) event.getData("oldValue");
myItem.getLabel().setText(value);
}
@Override
public void onEvent(UndoableEvent event) { }
@Override
public void doAction(UndoableEvent event) {
LabelFormItem myItem = (LabelFormItem) event.getData("item");
String value = (String) event.getData("newValue");
myItem.getLabel().setText(value);
}
}));
item.reset();
}
});