super(FormBuilderGlobals.getInstance().getI18n().InternationalizeEffectLabel(), true);
}
@Override
public void createStyles() {
I18NFormItem item = (I18NFormItem) getItem();
Map<String, Object> dataSnapshot = new HashMap<String, Object>();
dataSnapshot.put("item", item);
dataSnapshot.put("oldI18nMap", item.getI18nMap());
dataSnapshot.put("newI18nMap", savedMap);
bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
@Override @SuppressWarnings("unchecked")
public void undoAction(UndoableEvent event) {
I18NFormItem item = (I18NFormItem) event.getData("item");
Map<String, String> i18nMap = (Map<String, String>) event.getData("oldI18nMap");
item.saveI18nMap(i18nMap);
}
@Override
public void onEvent(UndoableEvent event) { }
@Override @SuppressWarnings("unchecked")
public void doAction(UndoableEvent event) {
I18NFormItem item = (I18NFormItem) event.getData("item");
Map<String, String> i18nMap = (Map<String, String>) event.getData("newI18nMap");
item.saveI18nMap(i18nMap);
}
}));
}