Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSArray


    }

    @Override
    public NSArray<EOSQLExpression> statementsToInsertColumnForAttribute(final EOAttribute attribute, final NSDictionary options) {
      String clause = _columnCreationClauseForAttribute(attribute);
      return new NSArray(_expressionForString("alter table " + formatTableName(attribute.entity().externalName()) + " add column " + clause));
    }
View Full Code Here


                eo._setUpdateInverseRelationships(oldUpdateInverseRelationship);
              }
            }
          }
          else {
            NSArray values = (NSArray) eo.valueForKey(inverse);
            if (values != null && !values.containsObject(object)) {
              boolean oldUpdateInverseRelationship = eo._setUpdateInverseRelationships(false);
              try {
                eo.addObjectToPropertyWithKey(object, inverse);
              }
              finally {
View Full Code Here

                eo._setUpdateInverseRelationships(oldUpdateInverseRelationship);
              }
            }
          }
          else {
            NSArray values = (NSArray) eo.valueForKey(inverse);
            if (values.containsObject(object)) {
              boolean oldUpdateInverseRelationship = eo._setUpdateInverseRelationships(false);
              try {
                eo.removeObjectFromPropertyWithKey(object, inverse);
              }
              finally {
View Full Code Here

           
            ERXGenericRecord.checkMatchingEditingContexts(object, key, newValueEO);

            //object._superTakeValueForKey(value, key);
            if (newValueEO.isToManyKey(inverse)) {
              NSArray inverseOldValues = (NSArray) newValueEO.valueForKey(inverse);
              if (inverseOldValues == null || !inverseOldValues.containsObject(object)) {
                boolean oldUpdateInverseRelationship = newValueEO._setUpdateInverseRelationships(false);
                try {
                  newValueEO.addObjectToPropertyWithKey(object, inverse);
                }
                finally {
                  newValueEO._setUpdateInverseRelationships(oldUpdateInverseRelationship);
                }
              }
            }
            else {
              EOEnterpriseObject inverseOldValue = (EOEnterpriseObject) newValueEO.valueForKey(inverse);
              if (inverseOldValue != object) {
                boolean oldUpdateInverseRelationship = newValueEO._setUpdateInverseRelationships(false);
                try {
                  newValueEO.takeStoredValueForKey(object, inverse);
                }
                finally {
                  newValueEO._setUpdateInverseRelationships(oldUpdateInverseRelationship);
                }
              }
            }
          }
          // If the object is a null, we need to perform the equivalent of
          // an removeObjectFromBothSidesOfRelationshipWithKey
          else {
            //object._superTakeValueForKey(null, key);
            if (oldValueEO != null) {
              if (oldValueEO.isToManyKey(inverse)) {
                NSArray inverseOldValues = (NSArray) oldValueEO.valueForKey(inverse);
                if (inverseOldValues != null && inverseOldValues.containsObject(object)) {
                  boolean oldUpdateInverseRelationship = oldValueEO._setUpdateInverseRelationships(false);
                  try {
                    oldValueEO.removeObjectFromPropertyWithKey(object, inverse);
                  }
                  finally {
View Full Code Here

    public void setSelections(NSArray aFormValuesArray) {
        // ** This is where we accept the formValues.  Kind of weird.
        NSMutableArray aSelectionsArray = new NSMutableArray();
        if (aFormValuesArray != null) {
            Enumeration anIndexEnumerator = aFormValuesArray.objectEnumerator();
            NSArray anItemList = (NSArray)_WOJExtensionsUtil.valueForBindingOrNull("list",this);
            if (anItemList == null) {
                anItemList = NSArray.EmptyArray;
            }
            int anItemCount = anItemList.count();
            while (anIndexEnumerator.hasMoreElements()) {
                int i = Integer.parseInt((String)anIndexEnumerator.nextElement());
                if (i < anItemCount) {
                    Object anObject = anItemList.objectAtIndex(i);
                    aSelectionsArray.addObject(anObject);
                } else {
                    // ** serious problem here. Raise an exception?
                }
            }
View Full Code Here

               
                try {
                    if (second.indexOf(".") == -1) {
                        result = NSKeyValueCoding.Utility.valueForKey(result, second);
                    } else {
                        NSArray parts = NSArray.componentsSeparatedByString(second, ".");
                        for (int j = 0; j < parts.count(); j++) {
                            String part = (String)parts.objectAtIndex(j);
                            result = NSKeyValueCoding.Utility.valueForKey(result, part);
                            if (result == null)
                                break;
                        }
                    }
View Full Code Here

  @Override
  public void appendToResponse(WOResponse response, WOContext context) {
    super.appendToResponse(response, context);
    WOComponent component = context.component();
    NSArray updateContainerIDs = (NSArray) _updateContainerIDs.valueInComponent(component);
    if (updateContainerIDs != null && updateContainerIDs.count() > 0) {
      AjaxUtils.appendScriptHeader(response);
      Enumeration updateContainerIDEnum = updateContainerIDs.objectEnumerator();
      while (updateContainerIDEnum.hasMoreElements()) {
        String updateContainerID = (String) updateContainerIDEnum.nextElement();
        // PROTOTYPE FUNCTIONS
        Object evalScripts = ERXComponentUtilities.valueForBinding("evalScripts", "true", _associations, component);
        response.appendContentString("if ($wi('" + updateContainerID + "')) { ");
View Full Code Here

    }
   
    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

    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

  }

  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

TOP

Related Classes of com.webobjects.foundation.NSArray

Copyright © 2018 www.massapicom. 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.