toolstrip.addToolButtonRight(addBtn);
ToolButton removeBtn = new ToolButton(Console.CONSTANTS.common_label_delete(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final Path editedEntity = form.getEditedEntity();
Feedback.confirm(
Console.MESSAGES.deleteTitle("Path"),
Console.MESSAGES.deleteConfirm("Path " + editedEntity.getName()),
new Feedback.ConfirmationHandler() {
@Override
public void onConfirmation(boolean isConfirmed) {
if (isConfirmed)
presenter.onDeletePath(editedEntity);
}
});
}
});
toolstrip.addToolButtonRight(removeBtn);
// -----------
table = new DefaultCellTable<Path>(6, new ProvidesKey<Path>() {
@Override
public Object getKey(Path path) {
return path.getName();
}
});
dataProvider = new ListDataProvider<Path>();
dataProvider.addDataDisplay(table);
TextColumn<Path> nameCol = new TextColumn<Path>() {
@Override
public String getValue(Path record) {
return record.getName();
}
};
table.addColumn(nameCol, "Name");
// -----------
form = new Form<Path>(Path.class);
form.setNumColumns(2);
FormToolStrip<Path> detailToolStrip = new FormToolStrip<Path>(
form,
new FormToolStrip.FormCallback<Path>()
{
@Override
public void onSave(Map<String, Object> changeset) {
Path updatedEntity = form.getUpdatedEntity();
presenter.onSavePath(
updatedEntity.getName(),
form.getChangedValues()
);
}
@Override