Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSMutableDictionary


  //
  public NSArray itemSet1() {
    if (_itemSet1 == null) {
      NSArray keys = new NSArray(Arrays.asList("name", "value", "category"));
     
      NSMutableDictionary oneA = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(100), "01/2011")), keys);
      NSMutableDictionary oneB = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(150), "02/2011")), keys);
      NSMutableDictionary oneC = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(200), "03/2011")), keys);

      NSMutableDictionary twoA = new NSMutableDictionary(new NSArray(Arrays.asList("RIM", Integer.valueOf(200), "01/2011")), keys);
      NSMutableDictionary twoB = new NSMutableDictionary(new NSArray(Arrays.asList("RIM", Integer.valueOf(210), "02/2011")), keys);
      NSMutableDictionary twoC = new NSMutableDictionary(new NSArray(Arrays.asList("RIM", Integer.valueOf(215), "03/2011")), keys);

      NSMutableDictionary threeA = new NSMutableDictionary(new NSArray(Arrays.asList("Android", Integer.valueOf(50), "01/2011")), keys);
      NSMutableDictionary threeB = new NSMutableDictionary(new NSArray(Arrays.asList("Android", Integer.valueOf(55), "02/2011")), keys);
      NSMutableDictionary threeC = new NSMutableDictionary(new NSArray(Arrays.asList("Android", Integer.valueOf(110), "03/2011")), keys);

      _itemSet1 = new NSArray(Arrays.asList(twoA, twoB, twoC, oneA, oneB, oneC, threeA, threeB, threeC));
    }
    //System.out.println("itemSet1 = "+_itemSet1);
    return _itemSet1;
View Full Code Here


  //
  public NSArray itemSet1a() {
    if (_itemSet1a == null) {
      NSArray keys = new NSArray(Arrays.asList("name", "value", "category"));
     
      NSMutableDictionary oneA = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(100), "01/2011")), keys);
      NSMutableDictionary oneB = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(150), "02/2011")), keys);
      NSMutableDictionary oneC = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(200), "03/2011")), keys);

      NSMutableDictionary twoA = new NSMutableDictionary(new NSArray(Arrays.asList("RIM", Integer.valueOf(200), "01/2011")), keys);
      NSMutableDictionary twoB = new NSMutableDictionary(new NSArray(Arrays.asList("RIM", Integer.valueOf(210), "02/2011")), keys);
      NSMutableDictionary twoC = new NSMutableDictionary(new NSArray(Arrays.asList("RIM", Integer.valueOf(215), "03/2011")), keys);

      NSMutableDictionary threeA = new NSMutableDictionary(new NSArray(Arrays.asList("Android", Integer.valueOf(50), "01/2011")), keys);
      NSMutableDictionary threeB = new NSMutableDictionary(new NSArray(Arrays.asList("Android", Integer.valueOf(55), "02/2011")), keys);
      NSMutableDictionary threeC = new NSMutableDictionary(new NSArray(Arrays.asList("Android", Integer.valueOf(110), "03/2011")), keys);

      _itemSet1a = new NSArray(Arrays.asList(oneA, oneB, oneC, twoA, twoB, twoC, threeA, threeB, threeC));
    }
    //System.out.println("itemSet1a = "+_itemSet1a);
    return _itemSet1a;
View Full Code Here

 
  public NSArray itemSet2() {
    if (_itemSet2 == null) {
      NSArray keys = new NSArray(Arrays.asList("name", "value", "category"));
     
      NSMutableDictionary oneA = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(20), "01/2011")), keys);
      NSMutableDictionary oneB = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(25), "02/2011")), keys);
      NSMutableDictionary oneC = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(30), "03/2011")), keys);
      NSMutableDictionary oneD = new NSMutableDictionary(new NSArray(Arrays.asList("iPhone", Integer.valueOf(75), "Total Q1")), keys);

      _itemSet2 = new NSArray(Arrays.asList(oneA, oneB, oneC, oneD));
    }
    //System.out.println("itemSet2 = "+_itemSet2);
    return _itemSet2;
View Full Code Here

    public void updateSourceObject(NSArray newValues) {

        // add new values to relationship, remove old values
        Object aSourceObject = _localSourceObject();
        boolean isDictionary = (aSourceObject instanceof NSMutableDictionary);
        NSMutableDictionary _dictionary = (isDictionary) ? (NSMutableDictionary) aSourceObject : null;
        EOEnterpriseObject _eo = (!isDictionary) ? (EOEnterpriseObject) aSourceObject : null;
        String masterKey = _localRelationshipKey();
        NSMutableArray currentValues = (NSMutableArray) NSKeyValueCoding.Utility.valueForKey(aSourceObject, masterKey);
        int count = currentValues.count();
        EOEnterpriseObject o;
View Full Code Here

        }
        if("list".equals(_context.task())) {
            _componentLevelKeys.addObject("propertyIsSortable");
            _componentLevelKeys.addObject("sortKeyForList");
        }
        _allKeys = new NSMutableDictionary();
        Configuration config = new Configuration();
        _allKeys.setObjectForKey(config.components(), "components");
        _allKeys.setObjectForKey(config.editors(), "editors");
    }
View Full Code Here

     * requiered, the componentName key is used to get the editors and supports.
     * @param propertyKey
     */
    protected NSDictionary componentLevelValuesForKey(String propertyKey) {
        _context.setPropertyKey(propertyKey);
        NSMutableDictionary dictionary = new NSMutableDictionary();
        for(Enumeration e = _componentLevelKeys.objectEnumerator(); e.hasMoreElements(); ) {
            String key = (String)e.nextElement();
            Object o = _context.valueForKey(key);
            if(o != null)
                dictionary.setObjectForKey(o, key);
        }
        String path = "components." + dictionary.objectForKey("componentName") + ".editors";
        NSArray keys = (NSArray)_allKeys.valueForKeyPath(path);
        if(keys != null) {
            for(Enumeration e = keys.objectEnumerator(); e.hasMoreElements(); ) {
                String key = (String)e.nextElement();
                Object o = _context.valueForKey(key);
                if(o != null)
                    dictionary.setObjectForKey(o, key);
            }
        }
        path = "components." + dictionary.objectForKey("componentName") + ".supports";
        keys = (NSArray)_allKeys.valueForKeyPath(path);
        if(keys != null) {
            for(Enumeration e = keys.objectEnumerator(); e.hasMoreElements(); ) {
                String key = (String)e.nextElement();
                Object o = _context.valueForKey(key);
                if(o != null)
                    dictionary.setObjectForKey(o, key);
            }
        }
        _context.setPropertyKey(null);
        return dictionary;
    }
View Full Code Here

        return dictionary;
    }

    public NSDictionary dictionary() {
      if(_dictionary == null) {
        _dictionary = new NSMutableDictionary();
        addPageLevelValues();
        NSArray displayPropertyKeys = (NSArray)_context.valueForKey("displayPropertyKeys");
        if(displayPropertyKeys != null && displayPropertyKeys.count() > 0) {
          NSMutableDictionary componentLevelKeys = new NSMutableDictionary();
          addPropertyKeys(componentLevelKeys, displayPropertyKeys);
          _dictionary.setObjectForKey( componentLevelKeys, "componentLevelKeys");
        }
      }
      return _dictionary;
View Full Code Here

  }

  public NSMutableDictionary configData() {
    if (configData == null) {
      NSData data = new NSData(application().resourceManager().bytesForResourceNamed("AjaxGridExampleConfiguration.plist", null, NSArray.EmptyArray));
      configData = new NSMutableDictionary((NSDictionary) NSPropertyListSerialization.propertyListFromData(data, CharEncoding.UTF_8));
    }

    return configData;
  }
View Full Code Here

            onClickBuffer.append("ASB.request(");
        }
        onClickBuffer.append(formReference);
        onClickBuffer.append(",null,");

        NSMutableDictionary options = createAjaxOptions(component);

        AjaxUpdateLink.addEffect(options, (String) valueForBinding("effect", component), updateContainerID, (String) valueForBinding("effectDuration", component));
        String afterEffectID = (String) valueForBinding("afterEffectID", component);
        if (afterEffectID == null) {
            afterEffectID = AjaxUpdateContainer.currentUpdateContainerID();
View Full Code Here

      short objectLen = dis.readShort();
      byte[] objectBytes = new byte[objectLen];
      dis.readFully(objectBytes);

      short userInfoLen = dis.readShort();
      NSMutableDictionary userInfo = new NSMutableDictionary();
      for (int i = 0; i < userInfoLen; i++) {
        short keyLen = dis.readShort();
        byte[] keyBytes = new byte[keyLen];
        dis.readFully(keyBytes);

        short valueLen = dis.readShort();
        byte[] valueBytes = new byte[valueLen];
        dis.readFully(valueBytes);

        userInfo.setObjectForKey(new String(valueBytes), new String(keyBytes));

      }

      NSNotification notification = new NSNotification(new String(nameBytes), null, userInfo);
      return notification;
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSMutableDictionary

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.