/** Sets whether it is disabled. */ public void setDisabled(boolean disabled) { if (_disabled != disabled) { _disabled = disabled; smartUpdate("disabled", _disabled); } }
/** Sets whether it is selectable. * * <p>If the listbox is in a checkmark mode, the selectable state will affect * the checkable icon to display or not.</p> * <p>Default: true.</p> * @param selectable */ public void setSelectable(boolean selectable) { if (_selectable != selectable) { _selectable = selectable; // non-checkable cannot be selected if (!_selectable) setSelected(false); smartUpdate("selectable", selectable); } }
/** Sets whether the content of this item is loaded; used if * the listbox owning this item is using a list model. */ /*package*/ void setLoaded(boolean loaded) { if (loaded != _loaded) { _loaded = loaded; final Listbox listbox = getListbox(); if (listbox != null && listbox.getModel() != null) smartUpdate("_loaded", _loaded); } }
/** Sets the value. * @param value the value. * <p>Note: the value is application dependent, you can place * whatever value you want. * <p>If you are using listitem with HTML Form (and with * the name attribute), it is better to specify a String-typed * value. */ public <T> void setValue(T value) { if (!Objects.equals(_value, value)) { _value = value; final Listbox listbox = getListbox(); if (listbox != null) if (listbox.inSelectMold()) smartUpdate("value", _value); else if (listbox.getName() != null) smartUpdate("value", _value); } }
public boolean setVisible(boolean visible) { if (isVisible() == visible) return visible; final boolean result = super.setVisible(visible); final Listbox listbox = (Listbox) getParent(); if (listbox != null) { if (listbox.inSelectMold()) listbox.invalidate(); final Listgroup g = listbox.getListgroupAt(getIndex()); if (g == null || g.isOpen()) listbox.addVisibleItemCount(visible ? 1 : -1); } // Bug ZK-485, send after invoking listbox.addVisibleItemCount() smartUpdate("visible", visible); return result; }