Search in sources :

Example 1 with CreateEmptyDialog

use of org.jboss.hal.client.deployment.dialog.CreateEmptyDialog in project console by hal.

the class ContentColumn method createEmpty.

private void createEmpty() {
    CreateEmptyDialog dialog = new CreateEmptyDialog(resources, name -> {
        ResourceAddress address = CONTENT_TEMPLATE.resolve(statementContext, name);
        ModelNode contentNode = new ModelNode();
        contentNode.get(EMPTY).set(true);
        Operation operation = new Operation.Builder(address, ADD).param(CONTENT, new ModelNode().add(contentNode)).build();
        dispatcher.execute(operation, result -> {
            refresh(Ids.deployment(name));
            MessageEvent.fire(eventBus, Message.success(resources.messages().deploymentEmptySuccess(name)));
        });
    });
    dialog.addValidationHandlerForNameItem(createUniqueValidation());
    dialog.show();
}
Also used : CreateEmptyDialog(org.jboss.hal.client.deployment.dialog.CreateEmptyDialog) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) Operation(org.jboss.hal.dmr.Operation) ModelNode(org.jboss.hal.dmr.ModelNode)

Example 2 with CreateEmptyDialog

use of org.jboss.hal.client.deployment.dialog.CreateEmptyDialog in project console by hal.

the class StandaloneDeploymentColumn method createEmpty.

private void createEmpty() {
    CreateEmptyDialog dialog = new CreateEmptyDialog(resources, name -> {
        ResourceAddress address = DEPLOYMENT_TEMPLATE.resolve(statementContext, name);
        ModelNode contentNode = new ModelNode();
        contentNode.get(EMPTY).set(true);
        Operation operation = new Operation.Builder(address, ADD).param(CONTENT, new ModelNode().add(contentNode)).build();
        dispatcher.execute(operation, result -> {
            refresh(Ids.deployment(name));
            MessageEvent.fire(eventBus, Message.success(resources.messages().deploymentEmptySuccess(name)));
        });
    });
    dialog.addValidationHandlerForNameItem(createUniqueValidation());
    dialog.show();
}
Also used : CreateEmptyDialog(org.jboss.hal.client.deployment.dialog.CreateEmptyDialog) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) Operation(org.jboss.hal.dmr.Operation) ModelNode(org.jboss.hal.dmr.ModelNode)

Aggregations

CreateEmptyDialog (org.jboss.hal.client.deployment.dialog.CreateEmptyDialog)2 ModelNode (org.jboss.hal.dmr.ModelNode)2 Operation (org.jboss.hal.dmr.Operation)2 ResourceAddress (org.jboss.hal.dmr.ResourceAddress)2