use of org.jboss.hal.dmr.ModelDescriptionConstants.REMOVE in project console by hal.
the class PolicyElement method injectRemove.
private void injectRemove(Form<ModelNode> form, Callback callback) {
// hacky way to inject the remove link into the form tools, depends on FormLink internals!
String linksId = Ids.build(form.getId(), "links");
Element formLinks = form.element().querySelector(HASH + linksId);
if (formLinks != null) {
HTMLLIElement removeLink = li().add(a().css(clickable).on(click, event -> callback.execute()).add(i().css(pfIcon("remove"))).data(OPERATION, REMOVE).add(span().css(formLinkLabel).textContent(resources.constants().remove()))).element();
formLinks.insertBefore(removeLink, formLinks.lastElementChild);
}
}
Aggregations