Exemplo n.º 1
0
 public void pushItem() {
   NSArray aList = list();
   int index = currentCol + maxColumns() * currentRow;
   Object item = index < aList.count() ? aList.objectAtIndex(index) : null;
   setValueForBinding(item, "item");
   setValueForBinding(ERXConstant.integerForInt(currentRow), "row");
   setValueForBinding(ERXConstant.integerForInt(currentCol), "col");
   setValueForBinding(ERXConstant.integerForInt(index), "index");
   currentItemIndex++;
 }
 /**
  * Change the value of this object's <code>isEnabled</code> property.
  *
  * @param value The new value for this property
  */
 public void setIsEnabled(boolean value) {
   if (log.isDebugEnabled()) {
     log.debug("setIsEnabled(" + value + "): was " + isEnabled());
   }
   Integer actual = er.extensions.eof.ERXConstant.integerForInt(value ? 1 : 0);
   setIsEnabledRaw(actual);
 }
Exemplo n.º 3
0
  public void appendToResponse(WOResponse response, WOContext context) {
    // set the numberOfObjectsPerBatch
    Number newNumberOfObjectsPerBatch = (Number) ERXThreadStorage.valueForKey(_threadStorageKey);
    if (newNumberOfObjectsPerBatch != null
        && newNumberOfObjectsPerBatch.intValue() != displayGroup().numberOfObjectsPerBatch()) {
      if (displayGroup() != null) {
        NSArray selection = selection();

        if (log.isDebugEnabled())
          log.debug("Setting db # of objects per batch to " + newNumberOfObjectsPerBatch);
        displayGroup().setNumberOfObjectsPerBatch(newNumberOfObjectsPerBatch.intValue());

        if (log.isDebugEnabled()) log.debug("The batch index is being set to : " + 1);
        displayGroup().setCurrentBatchIndex(1);
        clearSelection(selection);
      }
      Object d2wcontext = valueForBinding("d2wContext");
      if (d2wcontext != null) {
        NSNotificationCenter.defaultCenter()
            .postNotification(
                "BatchSizeChanged",
                ERXConstant.integerForInt(newNumberOfObjectsPerBatch.intValue()),
                new NSDictionary(d2wcontext, "d2wContext"));
      }
      ERXThreadStorage.takeValueForKey(null, _threadStorageKey);
    }

    if (displayGroup() != null && !displayGroup().hasMultipleBatches()) {
      if (currentBatchIndex() != 0) setCurrentBatchIndex(ERXConstant.ZeroInteger);
    }
    super.appendToResponse(response, context);
  }
Exemplo n.º 4
0
 public Integer numberOfMonths() {
   return ERXConstant.integerForInt(totalNumberOfMonths().intValue() % 12);
 }