Exemplo n.º 1
0
 /**
  * Utility to get the boolean value of a binding or a default value if none is supplied. Handles
  * non-boolean bindings Numbers, NSArray, String, NSKeyValueCoding.
  *
  * @param name name of the binding
  * @param defaultValue value to return if unbound
  * @return value for binding or defaultValue value if unbound
  */
 public boolean booleanValueForBinding(String name, boolean defaultValue) {
   boolean value = defaultValue;
   if (hasBinding(name)) {
     Object boundValue = valueForBinding(name);
     value = ERXValueUtilities.booleanValue(boundValue);
   }
   return value;
 }
Exemplo n.º 2
0
 /**
  * Boolean used to hide/show the confirmation dialog's delete button
  *
  * <p>The delete button is only shown if isEntityDeletable returns true
  */
 public Boolean showDeleteButton() {
   if (_showDeleteButton == null) {
     _showDeleteButton =
         new Boolean(
             canDelete() && ERXValueUtilities.booleanValue(valueForBinding("isEntityDeletable")));
   }
   return _showDeleteButton;
 }
 public boolean isMandatory() {
   return ERXValueUtilities.booleanValue(subContext().valueForKey("isMandatory"));
 }