예제 #1
0
  /**
   * Returns true if the stateful parameter is bound to a true value. If stateful is not bound, also
   * returns the default, true.
   *
   * <p>Note that this method can be called when the component is not rendering, therefore it must
   * directly access the {@link IBinding} for the stateful parameter.
   */
  public boolean getRequiresSession() {
    IBinding statefulBinding = getStatefulBinding();

    if (statefulBinding == null) return true;

    return statefulBinding.getBoolean();
  }
  /**
   * Gets the value of the binding.
   *
   * @param requiredType if not null, the expected type of the value object.
   * @see IBinding#getObject()
   * @see IBinding#getObject(String, Class)
   */
  protected Object getBindingValue(Class requiredType) {
    Object result;

    if (requiredType == null) result = _binding.getObject();
    else result = _binding.getObject(_parameterName, requiredType);

    return result;
  }
예제 #3
0
 public Object getObject(@SuppressWarnings("rawtypes") Class type) {
   try {
     return binding.getObject(type);
   } catch (Exception ex) {
     handle(ex);
     return null;
   }
 }
예제 #4
0
 public Object getObject() {
   try {
     return binding.getObject();
   } catch (Exception ex) {
     handle(ex);
     return null;
   }
 }
  /**
   * Restores the property to its default value. For {@link Direction#FORM} parameters, extracts the
   * property value and sets the binding form it (when appropriate).
   */
  public void resetParameter(IRequestCycle cycle) {
    if (_direction == Direction.FORM && cycle.isRewinding()) {
      IFormComponent component = (IFormComponent) _component;

      if (!component.isDisabled()) {
        IForm form = Form.get(cycle);

        if (form != null && form.isRewinding()) {
          Object value = readCurrentPropertyValue();

          _binding.setObject(value);
        }
      }
    }

    // Either way, clear the value.

    setPropertyValue(_clearValue);
  }
예제 #6
0
 public boolean isInvariant() {
   return binding.isInvariant();
 }
예제 #7
0
 public Location getLocation() {
   return binding.getLocation();
 }
예제 #8
0
 public String getDescription() {
   return binding.getDescription();
 }
예제 #9
0
 public void setObject(Object value) {
   binding.setObject(value);
 }