private void addCapabilities(Panel layout) {
ToolStrip toolStrip = new ToolStrip();
ToolButton editBtn = new ToolButton(Console.CONSTANTS.common_label_edit(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
OSGiCapability capability = capabilitiesTable.getSelection();
presenter.launchCapabilityWizard(capability);
}
});
editBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_edit_frameworkEditor());
toolStrip.addToolButton(editBtn);
ToolButton addBtn = new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.launchCapabilityWizard(null);
}
});
addBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_frameworkEditor());
toolStrip.addToolButtonRight(addBtn);
layout.add(toolStrip);
ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final OSGiCapability capability = capabilitiesTable.getSelection();
Feedback.confirm(Console.MESSAGES.subsys_osgi_removeCapability(),
Console.MESSAGES.subsys_osgi_removeCapabilityConfirm(capability.getIdentifier()),
new Feedback.ConfirmationHandler() {
@Override
public void onConfirmation(boolean isConfirmed) {
if (isConfirmed)
presenter.onDeleteCapability(capability.getIdentifier());
}
});
}
});
deleteBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_delete_frameworkEditor());