use of org.jboss.hal.core.ui.FileFormItem in project console by hal.
the class LoggingProfileView method addFileHandlerResource.
private void addFileHandlerResource(String templateSuffix, String id, String type, String... attributes) {
AddressTemplate metadataTemplate = LOGGING_PROFILE_TEMPLATE.append(templateSuffix);
Metadata metadata = mbuiContext.metadataRegistry().lookup(metadataTemplate);
AddressTemplate selectionTemplate = SELECTED_LOGGING_PROFILE_TEMPLATE.append(templateSuffix);
ModelNodeForm.Builder<ModelNode> builder = new ModelNodeForm.Builder<>(id, metadata).fromRequestProperties().unboundFormItem(new NameItem(), 0).customFormItem("file", (attributeDescription) -> new FileFormItem(FILE, true)).unsorted();
if (attributes != null) {
builder.include(asList(attributes));
}
AddResourceDialog dialog = new AddResourceDialog(mbuiContext.resources().messages().addResourceTitle(type), builder.build(), (name, modelNode) -> {
ResourceAddress address = selectionTemplate.resolve(selectionAwareStatementContext, name);
crud().add(type, name, address, modelNode, (n, a) -> presenter.reload());
});
dialog.show();
}
Aggregations