use of org.jboss.hal.meta.capabilitiy.Capabilities in project console by hal.
the class OperationFactoryTest method setUp.
@Before
public void setUp() {
AddressTemplate template = AddressTemplate.of("/{selected.profile}/subsystem=resource-adapters/resource-adapter=*/connection-definitions=*");
ModelNode rrd = ExternalModelNode.read(OperationFactoryTest.class.getResourceAsStream("connection-definition.dmr"));
metadata = new Metadata(template, () -> SecurityContext.RWX, new ResourceDescription(rrd), new Capabilities(null));
address = ResourceAddress.root();
operationFactory = new OperationFactory();
}
use of org.jboss.hal.meta.capabilitiy.Capabilities in project console by hal.
the class DefaultFormItemProvider method checkCapabilityReference.
private void checkCapabilityReference(ModelNode attributeDescription, FormItem<?> formItem) {
SuggestHandler suggestHandler = null;
if (attributeDescription.hasDefined(CAPABILITY_REFERENCE)) {
Dispatcher dispatcher = Core.INSTANCE.dispatcher();
StatementContext statementContext = Core.INSTANCE.statementContext();
String reference = attributeDescription.get(CAPABILITY_REFERENCE).asString();
Capabilities capabilities = metadata.getCapabilities();
if (capabilities.supportsSuggestions()) {
suggestHandler = new SuggestCapabilitiesAutoComplete(dispatcher, statementContext, reference, metadata.getTemplate());
} else if (capabilities.contains(reference)) {
suggestHandler = new ReadChildrenAutoComplete(dispatcher, statementContext, capabilities.lookup(reference));
}
}
if (suggestHandler != null) {
formItem.registerSuggestHandler(suggestHandler);
}
}
Aggregations