use of org.jboss.hal.ballroom.form.Form in project console by hal.
the class DestinationPresenter method addJMSQueue.
// ------------------------------------------------------ jms queue
// the custom add resource dialog is necessary because the "durable" and "selector" attributes are read-only
// after created
void addJMSQueue() {
Metadata metadata = metadataRegistry.lookup(JMS_QUEUE_TEMPLATE);
NameItem nameItem = new NameItem();
Form<ModelNode> form = new ModelNodeForm.Builder<>(Ids.build(Ids.MESSAGING_JMS_QUEUE, ADD), metadata).fromRequestProperties().unboundFormItem(nameItem, 0).include(DURABLE, SELECTOR).unsorted().build();
new AddResourceDialog(resources.messages().addResourceTitle(Names.JMS_QUEUE), form, (name, model) -> {
AddressTemplate template = SELECTED_SERVER_TEMPLATE.append("jms-queue=" + nameItem.getValue());
ResourceAddress address = template.resolve(statementContext);
crud.add(Names.JMS_QUEUE, nameItem.getValue(), address, model, (name1, address1) -> reload());
}).show();
}
Aggregations