Search in sources :

Example 1 with ROLE_TEMPLATE

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);
}
Also used : ROLE(org.jboss.hal.dmr.ModelDescriptionConstants.ROLE) ModelNodeTable(org.jboss.hal.core.mbui.table.ModelNodeTable) MbuiViewImpl(org.jboss.hal.core.mbui.MbuiViewImpl) ArrayList(java.util.ArrayList) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) Elements.section(org.jboss.gwt.elemento.core.Elements.section) MbuiElement(org.jboss.hal.spi.MbuiElement) Elements.p(org.jboss.gwt.elemento.core.Elements.p) HTMLElement(elemental2.dom.HTMLElement) Metadata(org.jboss.hal.meta.Metadata) Names(org.jboss.hal.resources.Names) Elements.h(org.jboss.gwt.elemento.core.Elements.h) ModelNodeHelper.asNamedNodes(org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes) SECURITY_SETTING(org.jboss.hal.dmr.ModelDescriptionConstants.SECURITY_SETTING) Table(org.jboss.hal.ballroom.table.Table) Ids(org.jboss.hal.resources.Ids) VerticalNavigation(org.jboss.hal.ballroom.VerticalNavigation) ROLE_TEMPLATE(org.jboss.hal.client.configuration.subsystem.messaging.AddressTemplates.ROLE_TEMPLATE) ModelNodeHelper.failSafePropertyList(org.jboss.hal.dmr.ModelNodeHelper.failSafePropertyList) List(java.util.List) MbuiContext(org.jboss.hal.core.mbui.MbuiContext) PostConstruct(javax.annotation.PostConstruct) MbuiView(org.jboss.hal.spi.MbuiView) NamedNode(org.jboss.hal.dmr.NamedNode) CSS.fontAwesome(org.jboss.hal.resources.CSS.fontAwesome) Form(org.jboss.hal.ballroom.form.Form) HTMLElement(elemental2.dom.HTMLElement) Metadata(org.jboss.hal.meta.Metadata) PostConstruct(javax.annotation.PostConstruct)

Aggregations

HTMLElement (elemental2.dom.HTMLElement)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 PostConstruct (javax.annotation.PostConstruct)1 Elements.h (org.jboss.gwt.elemento.core.Elements.h)1 Elements.p (org.jboss.gwt.elemento.core.Elements.p)1 Elements.section (org.jboss.gwt.elemento.core.Elements.section)1 VerticalNavigation (org.jboss.hal.ballroom.VerticalNavigation)1 Form (org.jboss.hal.ballroom.form.Form)1 Table (org.jboss.hal.ballroom.table.Table)1 ROLE_TEMPLATE (org.jboss.hal.client.configuration.subsystem.messaging.AddressTemplates.ROLE_TEMPLATE)1 MbuiContext (org.jboss.hal.core.mbui.MbuiContext)1 MbuiViewImpl (org.jboss.hal.core.mbui.MbuiViewImpl)1 ModelNodeForm (org.jboss.hal.core.mbui.form.ModelNodeForm)1 ModelNodeTable (org.jboss.hal.core.mbui.table.ModelNodeTable)1 ROLE (org.jboss.hal.dmr.ModelDescriptionConstants.ROLE)1 SECURITY_SETTING (org.jboss.hal.dmr.ModelDescriptionConstants.SECURITY_SETTING)1 ModelNodeHelper.asNamedNodes (org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes)1 ModelNodeHelper.failSafePropertyList (org.jboss.hal.dmr.ModelNodeHelper.failSafePropertyList)1 NamedNode (org.jboss.hal.dmr.NamedNode)1