ToolStrip toolStrip = new ToolStrip();
toolStrip.getElement().setAttribute("style", "margin-bottom:10px;");
edit = new ToolButton("Edit", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if(edit.getText().equals("Edit"))
presenter.onEditVirtualServer();
else
presenter.onSaveVirtualServer(form.getEditedEntity().getName(), form.getChangedValues());
}
});
toolStrip.addToolButton(edit);
toolStrip.addToolButton(new ToolButton("Delete", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final String serverName = form.getEditedEntity().getName();
Feedback.confirm("Remove Virtual Server", "Really remove virtual server '" + serverName + "'?",
new Feedback.ConfirmationHandler() {
@Override
public void onConfirmation(boolean isConfirmed) {
if (isConfirmed) {
presenter.onDeleteVirtualServer(serverName);
}
}
});
}
}));
toolStrip.addToolButtonRight(new ToolButton("Add", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.launchVirtualServerDialogue();
}
}));