Search in sources :

Example 16 with FormItem

use of org.jboss.hal.ballroom.form.FormItem in project console by hal.

the class AbstractConfiguration method hideOrShow.

private void hideOrShow(String name, boolean show) {
    FormItem item = form.getFormItem(name);
    Form.State state = Form.State.READONLY;
    if (editMode) {
        state = Form.State.EDITING;
    }
    HTMLElement formItemElement = item.element(state);
    Elements.setVisible(formItemElement, show);
    if (!editMode) {
        // for read-only mode, there are the <hr> separators, we should hide it too
        Element separatorElement = formItemElement.nextElementSibling;
        if (separatorElement instanceof HTMLHRElement) {
            HTMLHRElement hre = (HTMLHRElement) separatorElement;
            Elements.setVisible(hre, show);
        }
    }
}
Also used : HTMLHRElement(elemental2.dom.HTMLHRElement) HTMLElement(elemental2.dom.HTMLElement) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) Form(org.jboss.hal.ballroom.form.Form) FormItem(org.jboss.hal.ballroom.form.FormItem) Element(elemental2.dom.Element) HTMLElement(elemental2.dom.HTMLElement) HTMLHRElement(elemental2.dom.HTMLHRElement)

Aggregations

FormItem (org.jboss.hal.ballroom.form.FormItem)16 ModelNode (org.jboss.hal.dmr.ModelNode)12 Form (org.jboss.hal.ballroom.form.Form)9 Map (java.util.Map)7 List (java.util.List)6 ModelDescriptionConstants (org.jboss.hal.dmr.ModelDescriptionConstants)6 Operation (org.jboss.hal.dmr.Operation)6 Collectors.toList (java.util.stream.Collectors.toList)5 NamedNode (org.jboss.hal.dmr.NamedNode)5 ResourceAddress (org.jboss.hal.dmr.ResourceAddress)5 EventBus (com.google.web.bindery.event.shared.EventBus)4 NameToken (com.gwtplatform.mvp.client.annotations.NameToken)4 ProxyCodeSplit (com.gwtplatform.mvp.client.annotations.ProxyCodeSplit)4 ProxyPlace (com.gwtplatform.mvp.client.proxy.ProxyPlace)4 HashMap (java.util.HashMap)4 Inject (javax.inject.Inject)4 Finder (org.jboss.hal.core.finder.Finder)4 FinderPath (org.jboss.hal.core.finder.FinderPath)4 FinderPathFactory (org.jboss.hal.core.finder.FinderPathFactory)4 ModelNodeForm (org.jboss.hal.core.mbui.form.ModelNodeForm)4