use of org.jboss.hal.spi.Callback in project console by hal.
the class ComplexAttributeOperations method remove.
// ------------------------------------------------------ (d)elete using address
/**
* Undefines the complex attribute at the specified index. After the attribute has been undefined a standard success message
* is fired and the specified callback is executed.
*
* @param complexAttribute the name of the complex attribute
* @param type the human readable name of the complex attribute
* @param index the index for the list-type complex attribute
* @param address the fq address for the operation
* @param callback the callback executed after the complex attribute has been undefined
*/
@JsIgnore
public void remove(String complexAttribute, String type, int index, ResourceAddress address, Callback callback) {
Operation operation = new Operation.Builder(address, LIST_REMOVE_OPERATION).param(NAME, complexAttribute).param(INDEX, index).build();
SafeHtml question = resources.messages().removeSingletonConfirmationQuestion();
DialogFactory.showConfirmation(resources.messages().removeConfirmationTitle(type), question, () -> dispatcher.execute(operation, result -> {
MessageEvent.fire(eventBus, Message.success(resources.messages().removeSingletonResourceSuccess(type)));
callback.execute();
}));
}
Aggregations