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);
}
}
}
Aggregations