Search in sources :

Example 51 with StatementContext

use of org.jboss.hal.meta.StatementContext 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();
}
Also used : AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) Provider(javax.inject.Provider) StatementContext(org.jboss.hal.meta.StatementContext) AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) TextBoxItem(org.jboss.hal.ballroom.form.TextBoxItem) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) Message(org.jboss.hal.spi.Message) FinishReset(org.jboss.hal.ballroom.form.Form.FinishReset) Metadata(org.jboss.hal.meta.Metadata) ResourceCheck(org.jboss.hal.dmr.ResourceCheck) Names(org.jboss.hal.resources.Names) ModelNodeHelper.asNamedNodes(org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes) CrudOperations(org.jboss.hal.core.CrudOperations) NameToken(com.gwtplatform.mvp.client.annotations.NameToken) FinderPath(org.jboss.hal.core.finder.FinderPath) List(java.util.List) MetadataRegistry(org.jboss.hal.meta.MetadataRegistry) ModelDescriptionConstants(org.jboss.hal.dmr.ModelDescriptionConstants) Flow.series(org.jboss.hal.flow.Flow.series) Finder(org.jboss.hal.core.finder.Finder) Footer(org.jboss.hal.spi.Footer) SupportsExpertMode(org.jboss.hal.core.mvp.SupportsExpertMode) ModelNode(org.jboss.hal.dmr.ModelNode) Completable(rx.Completable) MessageEvent(org.jboss.hal.spi.MessageEvent) ProxyPlace(com.gwtplatform.mvp.client.proxy.ProxyPlace) SuccessfulOutcome(org.jboss.hal.core.SuccessfulOutcome) FlowContext(org.jboss.hal.flow.FlowContext) Inject(javax.inject.Inject) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) Task(org.jboss.hal.flow.Task) Progress(org.jboss.hal.flow.Progress) AddressTemplate(org.jboss.hal.meta.AddressTemplate) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) Requires(org.jboss.hal.spi.Requires) ProxyCodeSplit(com.gwtplatform.mvp.client.annotations.ProxyCodeSplit) AddressTemplates(org.jboss.hal.client.configuration.subsystem.messaging.AddressTemplates) Operation(org.jboss.hal.dmr.Operation) Ids(org.jboss.hal.resources.Ids) FinderPathFactory(org.jboss.hal.core.finder.FinderPathFactory) EventBus(com.google.web.bindery.event.shared.EventBus) DialogFactory(org.jboss.hal.ballroom.dialog.DialogFactory) Composite(org.jboss.hal.dmr.Composite) Dispatcher(org.jboss.hal.dmr.dispatch.Dispatcher) NameTokens(org.jboss.hal.meta.token.NameTokens) Resources(org.jboss.hal.resources.Resources) MbuiView(org.jboss.hal.core.mbui.MbuiView) NamedNode(org.jboss.hal.dmr.NamedNode) Form(org.jboss.hal.ballroom.form.Form) AddressTemplate(org.jboss.hal.meta.AddressTemplate) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) Metadata(org.jboss.hal.meta.Metadata) ModelNode(org.jboss.hal.dmr.ModelNode) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm)

Aggregations

StatementContext (org.jboss.hal.meta.StatementContext)51 Dispatcher (org.jboss.hal.dmr.dispatch.Dispatcher)47 ModelDescriptionConstants (org.jboss.hal.dmr.ModelDescriptionConstants)46 ResourceAddress (org.jboss.hal.dmr.ResourceAddress)46 ModelNode (org.jboss.hal.dmr.ModelNode)44 Resources (org.jboss.hal.resources.Resources)44 Ids (org.jboss.hal.resources.Ids)43 EventBus (com.google.web.bindery.event.shared.EventBus)42 List (java.util.List)42 Names (org.jboss.hal.resources.Names)41 Inject (javax.inject.Inject)40 Metadata (org.jboss.hal.meta.Metadata)40 Finder (org.jboss.hal.core.finder.Finder)37 Operation (org.jboss.hal.dmr.Operation)37 Requires (org.jboss.hal.spi.Requires)37 AddressTemplate (org.jboss.hal.meta.AddressTemplate)36 Form (org.jboss.hal.ballroom.form.Form)35 FinderPath (org.jboss.hal.core.finder.FinderPath)35 FinderPathFactory (org.jboss.hal.core.finder.FinderPathFactory)34 ModelNodeForm (org.jboss.hal.core.mbui.form.ModelNodeForm)34