Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSArray.objectEnumerator()


    }
   
    public WOComponent selectAllOnPage() {
        NSMutableArray selectedObjects = new NSMutableArray();
        NSArray list = displayGroup().displayedObjects();
        for (Enumeration e = list.objectEnumerator(); e.hasMoreElements();) {
            selectedObjects.addObject(e.nextElement());
        }
        setSelectedObjects(selectedObjects);
        return context().page();
    }
View Full Code Here


            //to what has been changed by the javascript in the WOBrowser
            NSArray hiddenFieldValues = NSArray.componentsSeparatedByString(sortedObjects, ",");
            if(log.isDebugEnabled()) log.debug("hiddenFieldValues = "+hiddenFieldValues);
            if(hiddenFieldValues != null){
                int i = 0;
                for(Enumeration e = hiddenFieldValues.objectEnumerator(); e.hasMoreElements();){
                    String objectForHashCode = (String)e.nextElement();
                    if(log.isDebugEnabled()) log.debug("objectForHashCode = "+objectForHashCode);
                    EOEnterpriseObject eo = objectForHashCode(objectForHashCode);
                    if(eo!=null){
                        eo.takeValueForKey(ERXConstant.integerForInt(i), indexKey());
View Full Code Here

        if (_destinationRelationship==null) {
            NSArray joinRelationships = ERDSortedManyToManyAssignment.joinRelationshipsForJoinEntity(entity());

            String originEntityName=object().entityName();
            //General case
            for (Enumeration e=joinRelationships.objectEnumerator(); e.hasMoreElements();) {
                EORelationship r=(EORelationship)e.nextElement();
                if (!originEntityName.equals(r.destinationEntity().name())) {
                    _destinationRelationship=r;
                    break;
                }
View Full Code Here

            // In the case we have a self join relationship we have to be more clever
            if(_destinationRelationship==null){
                EOEntity originEntity = EOModelGroup.defaultGroup().entityNamed(originEntityName);
                EORelationship originRelationship = originEntity.relationshipNamed(relationshipKey());
                EORelationship inverseOriginRelationship = originRelationship.inverseRelationship();
                for (Enumeration e=joinRelationships.objectEnumerator(); e.hasMoreElements();) {
                    EORelationship r=(EORelationship)e.nextElement();
                    if (r!=inverseOriginRelationship) {
                        _destinationRelationship=r;
                        break;
                    }
View Full Code Here

        NSArray arr = NSArray.componentsSeparatedByString(value.name(), ".");
        String prefix = "ERXAssert.instances";
        String level = System.getProperty(prefix);
        if(level == null)
            level = "LOG";
        for(Enumeration e = arr.objectEnumerator(); e.hasMoreElements(); ) {
            String s = (String)e.nextElement();
            String possibleLevel = System.getProperty(prefix + "." + s);
            if(possibleLevel != null) {
                level = possibleLevel;
            }
View Full Code Here

  private void createPrimaryKeySupportForModel(EOModel eomodel, EOAdaptorChannel channel, EOSynchronizationFactory syncFactory) {
    try {
      // AK: the (Object) cast is needed, because in 5.4 new NSArray(obj)
      // != new NSArray(array).
      NSArray pkSupportExpressions = syncFactory.primaryKeySupportStatementsForEntityGroups(new NSArray((Object) eomodel.entities()));
      Enumeration enumeration = pkSupportExpressions.objectEnumerator();
      while (enumeration.hasMoreElements()) {
        EOSQLExpression expression = (EOSQLExpression) enumeration.nextElement();
        channel.evaluateExpression(expression);
      }
    } catch (Exception e) {
View Full Code Here

    else if (type == AjaxOption.ARRAY) {
      if (_value instanceof NSArray) {
        NSArray arrayValue = (NSArray) _value;
        StringBuilder sb = new StringBuilder();
        sb.append('[');
        Enumeration objEnum = arrayValue.objectEnumerator();
        while (objEnum.hasMoreElements()) {
          Object o = objEnum.nextElement();
          sb.append(new AjaxValue(o).javascriptValue());
          if (objEnum.hasMoreElements()) {
            sb.append(',');
View Full Code Here

          strValue = new AjaxValue(AjaxOption.STRING, arrayValue.objectAtIndex(0)).javascriptValue();
        }
        else if (count > 0) {
          StringBuilder sb = new StringBuilder();
          sb.append('[');
          Enumeration objEnum = arrayValue.objectEnumerator();
          while (objEnum.hasMoreElements()) {
            Object o = objEnum.nextElement();
            sb.append(new AjaxValue(AjaxOption.STRING, o).javascriptValue());
            if (objEnum.hasMoreElements()) {
              sb.append(',');
View Full Code Here

        protected void registerDescriptionForClass(Class class1) {
            NSArray entities = (NSArray)_entitiesForClass.objectForKey(class1.getName());
            if (entities != null) {
                if (log.isDebugEnabled())
                    log.debug("Registering descriptions for class: " + class1.getName() + " found entities: " + entities.valueForKey("name"));
                for (Enumeration e = entities.objectEnumerator(); e.hasMoreElements();) {
                    EOEntity entity = (EOEntity)e.nextElement();
                    ERXEntityClassDescription cd = newClassDescriptionForEntity(entity);
                    EOClassDescription.registerClassDescription(cd, class1);
                    _setClassDescriptionOnEntity(entity, cd);
                }
View Full Code Here

    protected void _removeOrderingWithKey(String aKey) {
        int anIndex = 0;
        EOSortOrdering ordering;
        NSArray orderingArray = _sortOrderingArray();
        Enumeration anEnumerator = orderingArray.objectEnumerator();
        while (anEnumerator.hasMoreElements()) {
            ordering = (EOSortOrdering) anEnumerator.nextElement();
            if (aKey.equals(ordering.key())) {
                ((NSMutableArray)orderingArray).removeObjectAtIndex(anIndex);
                return ;
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.