form.setFields(send, consume, manage);
form.setFieldsInGroup(Console.CONSTANTS.common_label_advanced(), new DisclosureGroupRenderer(), createDQ, deleteDQ, createNDQ, deleteNDQ);
FormHelpPanel helpPanel = new FormHelpPanel(new FormHelpPanel.AddressCallback(){
@Override
public ModelNode getAddress() {
ModelNode address = Baseadress.get();
address.add("subsystem", "messaging");
address.add("hornetq-server", "*");
address.add("security-setting", "*");
address.add("role", "*");
return address;
}
}, form);
FormToolStrip<SecurityPattern> formTools = new FormToolStrip<SecurityPattern>(
form,
new FormToolStrip.FormCallback<SecurityPattern>() {
@Override
public void onSave(Map<String, Object> changeset) {
presenter.onSaveSecDetails(form.getEditedEntity(), changeset);
}
@Override
public void onDelete(SecurityPattern entity) {
}
}
);
ToolStrip tableTools = new ToolStrip();
ToolButton addBtn = new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.launchNewSecDialogue();
}
});
addBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_securityDetails());
tableTools.addToolButtonRight(addBtn);
ToolButton removeBtn = new ToolButton(Console.CONSTANTS.common_label_delete(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Feedback.confirm(
Console.MESSAGES.deleteTitle("Security Config"),
Console.MESSAGES.deleteConfirm("Security Config"),
new Feedback.ConfirmationHandler() {
@Override
public void onConfirmation(boolean isConfirmed) {
if (isConfirmed)
presenter.onDeleteSecDetails(form.getEditedEntity());
}
});
}
});
tableTools.addToolButtonRight(removeBtn);
// ----
VerticalPanel formPanel = new VerticalPanel();
formPanel.addStyleName("fill-layout-width");
formPanel.add(helpPanel.asWidget());
formPanel.add(formTools.asWidget());
formPanel.add(form.asWidget());
serverName = new ContentHeaderLabel();