Examples of NSArray


Examples of com.webobjects.foundation.NSArray

    }
   
    public NSArray sections() {
        if (_sections==null) {
            _sections= new NSMutableArray();
            NSArray list=(NSArray)valueForBinding("list");
            _itemsPerSection=new NSMutableDictionary();
            if (list!=null) {
                boolean ignoreNulls = booleanValueForBinding("ignoreNulls", false);
               
                for (Enumeration e=list.objectEnumerator(); e.hasMoreElements();) {
                    Object item=e.nextElement();
                    if(log.isDebugEnabled()) log.debug("item = "+item);
                   
                    // push value up, so parent can tell us the group
                    setValueForBinding(item,"item");
                   
                    // Sections have to be copiable objects -- no EOs!!
                    Object section=valueForBinding("sectionForItem");
                    if (section==NSKeyValueCoding.NullValue) section=null;
                    Object sectionKey;

                    if(section == null) {
                        if(ignoreNulls) {
                            continue;
                        }
                        section=NULL;
                    }
                    sectionKey = keyForSection(section);
                    if(sectionKey instanceof NSArray) {
                        NSArray array = (NSArray)sectionKey;
                        int index = 0;
                        for (Enumeration keys = ((NSArray)sectionKey).objectEnumerator(); keys.hasMoreElements(); ) {
                            Object currentKey = keys.nextElement();
                            Object currentSection = ((NSArray)section).objectAtIndex(index++);
                            NSMutableArray currentItemsForSection=(NSMutableArray)_itemsPerSection.objectForKey(currentKey);
View Full Code Here

Examples of com.webobjects.foundation.NSArray

    int declarationBodyLength = trimmedDeclarationBody.length();
    if (declarationBodyLength <= 2) {
      return associations;
    }
    trimmedDeclarationBody = trimmedDeclarationBody.substring(1, declarationBodyLength - 1).trim();
    NSArray bindings = NSArray.componentsSeparatedByString(trimmedDeclarationBody, ";");
    Enumeration bindingsEnum = bindings.objectEnumerator();
    do {
      if (!bindingsEnum.hasMoreElements()) {
        break;
      }
      String binding = ((String) bindingsEnum.nextElement()).trim();
View Full Code Here

Examples of com.webobjects.foundation.NSArray

  }

  public String onClickString() {
    String result = null;
    Object item = valueForBinding("selectsItem");
    NSArray list = (NSArray) valueForBinding("list");
    String popupName = (String) valueForBinding("popupName");
    if (list != null && item != null) {
      int index = list.indexOfObject(item);
      if (index == -1) {
        log.info(item + " could not be found in " + list);
      }
      // by default we assume that there is one more item on top of the
      // list (i.e. - none - or - pick one -)
View Full Code Here

Examples of com.webobjects.foundation.NSArray

              ec.lock()// Prevents lock churn
              try {
              ERXFetchSpecification fetchSpec = new ERXFetchSpecification(entityName(), qualifier(), null);
              fetchSpec.setRefreshesRefetchedObjects(true);
              fetchSpec.setIsDeep(true);
              NSArray objects = ec.objectsWithFetchSpecification(fetchSpec);
                  for (Enumeration enumeration = objects.objectEnumerator(); enumeration.hasMoreElements();) {
                      T eo = (T) enumeration.nextElement();
                      addObject(eo);
                  }
              } finally {
                  ec.unlock();
View Full Code Here

Examples of com.webobjects.foundation.NSArray

     * @param ec editing context to search for unsaved, matching objects
     * @param key key value to identify the unsaved object
     * @return the matching object or null if not found
     */
    public T unsavedMatchingObject(EOEditingContext ec, Object key) {
      NSArray matchingObjects = EOQualifier.filteredArrayWithQualifier(ec.insertedObjects(), ERXQ.equals("entityName", _entityName));
      matchingObjects = EOQualifier.filteredArrayWithQualifier(matchingObjects, fetchObjectsQualifier(key));

      if (matchingObjects.count() > 1) {
      throw new EOUtilities.MoreThanOneException("There was more than one " + _entityName + " with the key '" + key + "'.");
      }
      return matchingObjects.count() == 1 ? (T)matchingObjects.lastObject() : null;
    }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

     * @return all objects currently in the cache and unexpired
     */
    public NSArray<T> allObjects(EOEditingContext ec, EOQualifier additionalQualifier) {
    additionalQualifier = ERXEOControlUtilities.localInstancesInQualifier(ec, additionalQualifier);
      ERXExpiringCache<Object, EORecord<T>> cache = cache();
      NSArray allKeys = cache.allKeys();
      NSMutableArray allObjects = new NSMutableArray(allKeys.count());

      for (Object entryKey : allKeys) {
        T object = objectForKey(ec, entryKey, false);
        if (object != null && (additionalQualifier == null || additionalQualifier.evaluateWithObject(object))) {
            allObjects.addObject(object);
View Full Code Here

Examples of com.webobjects.foundation.NSArray

      if (relationship.isToManyToOne() && destinationEntity.isAbstractEntity() && fetchSpec.prefetchingRelationshipKeyPaths().containsObject(relationship.name())) {
        EOFetchSpecification newFetchSpec = (EOFetchSpecification) fetchSpec.clone();
        String inverseName = relationship.anyInverseRelationship().definition(); // from destination to intermediate
        EOQualifier singleTableRestrict = destinationEntity._singleTableRestrictingQualifier();
        EOQualifier migratedRestrict = EOQualifierSQLGeneration.Support._qualifierMigratedFromEntityRelationshipPath(singleTableRestrict, destinationEntity, inverseName);
        newFetchSpec.setQualifier(new EOAndQualifier(new NSArray(new Object[]{newFetchSpec.qualifier(),migratedRestrict})));
        fetchSpec = newFetchSpec;
      }
    }
    return fetchSpec;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

  private NSMutableArray _repeatingList;

  public NSArray repeatingList() {
    if (_repeatingList == null) {
      _repeatingList = new NSMutableArray();
      NSArray list = (NSArray) valueForBinding("list");
      Integer numberOfRepetetions = (Integer) valueForBinding("repetitions");
      if (numberOfRepetetions == null) {
        numberOfRepetetions = (Integer) valueForBinding("repetetions");
      }
      for (int i = 0; i < numberOfRepetetions.intValue(); i++) {
View Full Code Here

Examples of com.webobjects.foundation.NSArray

        return _nestingLevel;
    }

    public boolean isExpanded() {
        Object currentItem = valueForBinding("item");
        NSArray selectionPath = (NSArray)_WOJExtensionsUtil.valueForBindingOrNull("selectionPath",this);
        return (_nestingLevel < selectionPath.count())
            && selectionPath.objectAtIndex(_nestingLevel).equals(currentItem);
    }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

    }


    public int rowCount()  {
        if (_rowCount == -1) {
            NSArray aList = list();
            int aMaxColCount = maxColumns();
            int aListCount = aList.count();
            int aRemainder = 0;
            if (aMaxColCount!=0)  {
                _rowCount = aListCount / aMaxColCount;
                aRemainder = aListCount % aMaxColCount;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.