Exemplo n.º 1
0
  /** @see org.opencms.gwt.client.ui.input.I_CmsFormWidget#isEnabled() */
  public boolean isEnabled() {

    boolean result = true;
    for (CmsCheckBox checkbox : m_checkboxes) {
      if (!checkbox.isEnabled()) {
        result = false;
      }
    }
    return result;
  }
Exemplo n.º 2
0
  /**
   * Returns the set of values of the selected checkboxes.
   *
   * <p>
   *
   * @return a set of strings
   */
  public Set<String> getSelected() {

    Set<String> result = new HashSet<String>();
    int i = 0;
    for (Map.Entry<String, String> entry : m_items.entrySet()) {
      String key = entry.getKey();
      CmsCheckBox checkBox = m_checkboxes.get(i);
      if (checkBox.isChecked()) {
        result.add(key);
      }
      i += 1;
    }
    return result;
  }
Exemplo n.º 3
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.º 4
0
  /** @see org.opencms.gwt.client.ui.input.I_CmsFormWidget#setEnabled(boolean) */
  public void setEnabled(boolean enabled) {

    for (CmsCheckBox checkbox : m_checkboxes) {
      checkbox.setEnabled(enabled);
    }
  }
Exemplo n.º 5
0
  /** @see org.opencms.gwt.client.ui.input.I_CmsFormWidget#reset() */
  public void reset() {

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