Resources resources = new Resources(getClass().getName());
WTKXSerializer wtkxSerializer = new WTKXSerializer(resources);
window = (Window)wtkxSerializer.readObject(this, "demo.wtkx");
tableView = (TableView)wtkxSerializer.get("tableView");
TableViewRowEditor tableViewRowEditor = new TableViewRowEditor();
tableViewRowEditor.setEditEffect(CardPaneSkin.SelectionChangeEffect.HORIZONTAL_SLIDE);
tableView.setRowEditor(tableViewRowEditor);
// Date uses a Spinner with a CalendarDateSpinnerData model
Spinner dateSpinner = new Spinner(new CalendarDateSpinnerData());
dateSpinner.setSelectedItemKey("date");
tableViewRowEditor.getCellEditors().put("date", dateSpinner);
// Expense type uses a ListButton that presents the expense types
ListButton typeListButton = new ListButton(new EnumList<ExpenseType>(ExpenseType.class));
typeListButton.setSelectedItemKey("type");
tableViewRowEditor.getCellEditors().put("type", typeListButton);
// Amount uses a TextInput with strict currency validation
TextInput amountTextInput = new TextInput();
amountTextInput.setValidator(new CurrencyValidator());
amountTextInput.setStrictValidation(true);
amountTextInput.setTextKey("amount");
tableViewRowEditor.getCellEditors().put("amount", amountTextInput);
window.open(display);
}