public Widget createWidget() {
final ToolStrip toolStrip = new ToolStrip();
ToolButton newServerGroupBtn = new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.launchNewGroupDialoge();
}
});
newServerGroupBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_serverGroupsView());
toolStrip.addToolButtonRight(newServerGroupBtn);
ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete());
deleteBtn.addClickHandler(new ClickHandler(){
@Override
public void onClick(ClickEvent clickEvent) {
final ServerGroupRecord serverGroup = getSelectionModel().getSelectedObject();
Feedback.confirm(
Console.MESSAGES.deleteServerGroup(),
Console.MESSAGES.deleteServerGroupConfirm(serverGroup.getName()),
new Feedback.ConfirmationHandler() {
@Override
public void onConfirmation(boolean isConfirmed) {
if (isConfirmed)
presenter.onDeleteGroup(serverGroup);
}
});
}
});
deleteBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_delete_serverGroupsView());
toolStrip.addToolButtonRight(deleteBtn);
ToolButton copyBtn = new ToolButton(Console.CONSTANTS.common_label_copy());
copyBtn.addClickHandler(new ClickHandler(){
@Override
public void onClick(ClickEvent clickEvent) {
final ServerGroupRecord serverGroup = getSelectionModel().getSelectedObject();
presenter.launchCopyWizard(serverGroup);
}