Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSMutableArray


      private NSMutableDictionary components = new NSMutableDictionary();
      
      private NSMutableDictionary editors = new NSMutableDictionary();

      public Configuration() {
        NSMutableArray bundles = NSBundle.frameworkBundles().mutableClone();
        bundles.addObject(NSBundle.mainBundle());
        for(Enumeration e = bundles.objectEnumerator(); e.hasMoreElements(); ) {
          NSBundle bundle = (NSBundle)e.nextElement();
          NSDictionary dict;
          String path = bundle.resourcePathForLocalizedResourceNamed("d2wclientConfiguration.plist", null);
          if(path != null) {
            dict = ERXDictionaryUtilities.dictionaryFromPropertyList("d2wclientConfiguration", bundle);
View Full Code Here


    displayGroup().setNumberOfObjectsPerBatch(Integer.parseInt((String) configData().valueForKey("batchSize")));
  }

  private NSMutableArray sampleData() {
    NSData data = new NSData(application().resourceManager().bytesForResourceNamed("AjaxGridExampleTestData.plist", null, NSArray.EmptyArray));
    NSMutableArray sampleData = new NSMutableArray((NSArray) NSPropertyListSerialization.propertyListFromData(data, CharEncoding.UTF_8));
    Random random = new Random(new NSTimestamp().getNanos());
    for (int i = 0; i < sampleData.count(); i++) {
      NSMutableDictionary<String,Object> row = (NSMutableDictionary<String,Object>) sampleData.objectAtIndex(i);
      row.setObjectForKey(Integer.valueOf(random.nextInt()), "number");
      row.setObjectForKey(new NSTimestamp(random.nextLong()), "date");
      row.setObjectForKey(Integer.valueOf(i + 1).toString(), "level");
    }
View Full Code Here

                // we can assume insertedObjectGIDs and updatedObjectGIDs are non null.  if we execute this branch, they're at
                // least empty arrays.
                final EOEditingContext parentEC = (EOEditingContext)ec.parentObjectStore();

                if (insertedObjects.count() > 0 || updatedObjects.count() > 0) {
                    NSMutableArray flushableObjects = new NSMutableArray();
                    flushableObjects.addObjectsFromArray(insertedObjects);
                    flushableObjects.addObjectsFromArray(updatedObjects);

                    parentEC.lock();
                    try {
                        final NSArray flushableObjectsInParent = ERXEOControlUtilities.localInstancesOfObjects(parentEC, flushableObjects);
View Full Code Here

    public boolean checked() {
        return selectedObjects().containsObject(object());
    }

    public void setChecked(boolean newChecked) {
        NSMutableArray selectedObjects = selectedObjects().mutableClone();
        if (newChecked) {
            if (!selectedObjects.containsObject(object())) {
                selectedObjects.addObject(object());
            }
        } else {
            selectedObjects.removeObject(object());
        }
        setSelectedObjects(selectedObjects);
    }
View Full Code Here

        }
        return displayGroup().qualifier() == null ? displayGroup().allObjects() : EOQualifier.filteredArrayWithQualifier(displayGroup().allObjects(), displayGroup().qualifier());
    }
   
    public WOComponent selectAll() {
        NSMutableArray selectedObjects = new NSMutableArray();
        NSArray list = filteredObjects();
        for (Enumeration e = list.objectEnumerator(); e.hasMoreElements();) {
            selectedObjects.addObject(e.nextElement());
        }
        setSelectedObjects(selectedObjects);
        return context().page();
    }
View Full Code Here

     
      if (qualifier == null) {
        fullQualifier = inverseQualifier;
      }
      else {
        NSMutableArray qualifiers = new NSMutableArray();
        qualifiers.addObject(qualifier);
        qualifiers.addObject(inverseQualifier);
        fullQualifier = new EOAndQualifier(qualifiers);
      }

      results = er.ajax.mootools.example.components.Employee.fetchEmployees(editingContext(), fullQualifier, sortOrderings);
    }
View Full Code Here

        setSelectedObjects(selectedObjects);
        return context().page();
    }
   
    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

        setSelectedObjects(selectedObjects);
        return context().page();
    }

    public WOComponent unselectAll() {
        NSMutableArray selectedObjects = new NSMutableArray();
        setSelectedObjects(selectedObjects);
        return context().page();
    }
View Full Code Here

   * Ajax action method for when control clicked to remove all sorting.
   * Updates configurationData() and displayGroup().
   */
  public void removeSorting() {
    if (canResort()) {
      configurationData().setObjectForKey(hasMandatorySort() ? new NSMutableArray(manadatorySortDictionary()) : new NSMutableArray(), SORT_ORDER);
      clearCachedConfiguration();
      updateDisplayGroupSort();
    }
  }
View Full Code Here

   * Returns SORT_ORDER value from configurationData()
   *
   * @return list of sort orders controlling display of data in the grid
   */
  protected NSMutableArray sortOrders() {
    NSMutableArray sortOrders = (NSMutableArray) configurationData().valueForKey(SORT_ORDER);
   
    // Add the mandatory sort if it is not present
    if (hasMandatorySort()) {
      boolean includesMandatorySort = false;
      for (int i = 0; i < sortOrders.count() && ! includesMandatorySort; i++) {
        if (((NSKeyValueCoding) sortOrders.objectAtIndex(i)).valueForKey(KEY_PATH).equals(manadatorySortKeyPath())) {
          includesMandatorySort = true;
        }
      }
      if ( ! includesMandatorySort) {
        sortOrders.addObject(manadatorySortDictionary());
      }
    }
    return sortOrders;
  }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSMutableArray

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.