Exemplo n.º 1
0
  /**
   * Sets the value of the widget.
   *
   * <p>
   *
   * @param value the new value
   */
  @SuppressWarnings("unchecked")
  public void setFormValue(Object value) {

    if (value instanceof List<?>) {
      List<String> keys = (List<String>) value;
      Set<String> keySet = new HashSet<String>(keys);
      int i = 0;
      for (Map.Entry<String, String> entry : m_items.entrySet()) {
        String key = entry.getKey();
        CmsCheckBox checkbox = m_checkboxes.get(i);
        checkbox.setChecked(keySet.contains(key));
        i += 1;
      }
    }
  }
Exemplo n.º 2
0
  /** @see org.opencms.gwt.client.ui.input.I_CmsFormWidget#reset() */
  public void reset() {

    for (CmsCheckBox checkbox : m_checkboxes) {
      checkbox.setChecked(false);
    }
  }