use of org.jboss.hal.client.configuration.subsystem.messaging.AddressTemplates.ROLE_TEMPLATE in project console by hal.
the class DestinationView method init.
@PostConstruct
void init() {
Metadata roleMetadata = mbuiContext.metadataRegistry().lookup(ROLE_TEMPLATE);
roleTable = new ModelNodeTable.Builder<NamedNode>(Ids.MESSAGING_SECURITY_SETTING_ROLE_TABLE, roleMetadata).button(mbuiContext.tableButtonFactory().add(ROLE_TEMPLATE, table -> presenter.addSecuritySettingRole())).button(mbuiContext.tableButtonFactory().remove(ROLE_TEMPLATE, table -> presenter.removeSecuritySettingRole(table.selectedRow()))).column(SECURITY_SETTING, mbuiContext.resources().constants().pattern(), (cell, type, row, meta) -> row.get(SECURITY_SETTING).asString()).column(ROLE, mbuiContext.resources().constants().role(), (cell, type, row, meta) -> row.getName()).build();
roleForm = new ModelNodeForm.Builder<NamedNode>(Ids.MESSAGING_SECURITY_SETTING_ROLE_FORM, roleMetadata).onSave((form, changedValues) -> presenter.saveSecuritySettingRole(form, changedValues)).prepareReset(form -> presenter.resetSecuritySettingRole(form)).build();
registerAttachable(roleTable, roleForm);
HTMLElement roleSection = section().add(h(1).textContent(Names.SECURITY_SETTING)).add(p().textContent(roleMetadata.getDescription().getDescription())).add(roleTable).add(roleForm).element();
// noinspection HardCodedStringLiteral
navigation.insertPrimary(Ids.MESSAGING_SECURITY_SETTING_ROLE_ITEM, "messaging-address-setting-item", Names.SECURITY_SETTING, fontAwesome("lock"), roleSection);
}
Aggregations