Examples of NSArray


Examples of com.dd.plist.NSArray

      File plist = new File(app, "Info.plist");

      PListFormat format = getFormat(plist);
      NSDictionary root = (NSDictionary) PropertyListParser.parse(new FileInputStream(plist));

      NSArray devices = (NSArray) root.objectForKey("UIDeviceFamily");
      int length = devices.getArray().length;
      if (length == 1) {
        return;
      }

      NSArray rearrangedArray = new NSArray(length);
      NSNumber defaultDevice = null;
      int index = putDefaultFirst ? 1 : 0;
      for (int i = 0; i < length; i++) {
        NSNumber d = (NSNumber) devices.objectAtIndex(i);
        if (d.intValue() == device.getDeviceFamily()) {
          defaultDevice = d;
        } else {
          rearrangedArray.setValue(index, d);
          index++;
        }
      }
      if (defaultDevice == null) {
        throw new WebDriverException(
            "Cannot find device " + device + " in the supported device list.");
      }
      rearrangedArray.setValue(putDefaultFirst ? 0 : index, defaultDevice);
      root.put("UIDeviceFamily", rearrangedArray);

      write(plist, root, format);
    } catch (Exception e) {
      throw new WebDriverException("Cannot change the default device for the app." + e.getMessage(), e);
View Full Code Here

Examples of com.dd.plist.NSArray

  private void setSafariBuiltinFavories(File builtinFavoritesPList) {
    try {
      PListFormat format = getFormat(builtinFavoritesPList);

      NSArray root = new NSArray(1);
      NSDictionary favorite = new NSDictionary();
      favorite.put("Title", "about:blank");
      favorite.put("URL", "about:blank");
      root.setValue(0, favorite);

      write(builtinFavoritesPList, root, format);
    } catch (Exception e) {
      throw new WebDriverException("Cannot set " + builtinFavoritesPList.getAbsolutePath()
                                   + ": " + e.getMessage(), e);
View Full Code Here

Examples of com.dd.plist.NSArray

    }

    private NSDictionary createIOSPlistNSDictionary(String cfBundleIdentifier, String cfBundleVersion, String cfBundleName, String ipaUrl, String iconUrl) {
        NSDictionary mainDict = new NSDictionary();

        NSArray items = new NSArray(1);
        NSArray assets;
        if (StringUtils.hasText(iconUrl)) {
            assets = new NSArray(2);
        } else {
            assets = new NSArray(1);
        }
        NSDictionary itemsDict = new NSDictionary();

        NSDictionary assetsDict = new NSDictionary();
        assetsDict.put("kind", "software-package");
        assetsDict.put("url", ipaUrl);

        assets.setValue(0, assetsDict);

        if (StringUtils.hasText(iconUrl)) {
            NSDictionary iconsDict = new NSDictionary();
            iconsDict.put("kind", "display-image");
            iconsDict.put("needs-shine", true);
            iconsDict.put("url", "https://d1g1p4u8ho16cr.cloudfront.net/static/cb2639330650/resources/img/default_icon.png");

            assets.setValue(1, iconsDict);
        }

        NSDictionary mettadataDict = new NSDictionary();
        mettadataDict.put("bundle-identifier", cfBundleIdentifier);
        mettadataDict.put("bundle-version", cfBundleVersion);
View Full Code Here

Examples of com.webobjects.foundation.NSArray

      model._resetPrototypeCache();
    }
  }

  protected void localizeEntities() {
    Enumeration entitiesEnum = new NSArray(_entities).objectEnumerator();
    while (entitiesEnum.hasMoreElements()) {
      EOEntity entity = (EOEntity) entitiesEnum.nextElement();
      createLocalizedAttributes(entity);
    }
  }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

      createLocalizedAttributes(entity);
    }
  }

  protected void fixAllowsNullOnSingleTableInheritance() {
    Enumeration entitiesEnum = new NSArray(_entities).objectEnumerator();
    while (entitiesEnum.hasMoreElements()) {
      EOEntity entity = (EOEntity) entitiesEnum.nextElement();
      if (isSingleTableInheritance(entity)) {
        Enumeration attributeEnum = entity.attributes().objectEnumerator();
        while (attributeEnum.hasMoreElements()) {
View Full Code Here

Examples of com.webobjects.foundation.NSArray

      }
    }
  }

  protected void ensureSingleTableInheritanceParentEntitiesAreIncluded() {
    Enumeration entitiesEnum = new NSArray(_entities).objectEnumerator();
    while (entitiesEnum.hasMoreElements()) {
      EOEntity entity = (EOEntity) entitiesEnum.nextElement();
      ensureSingleTableInheritanceParentEntitiesAreIncluded(entity);
    }
  }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

    EOEntity parentEntity = entity.parentEntity();
    return parentEntity != null && entity.externalName() != null && entity.externalName().equalsIgnoreCase(parentEntity.externalName());
  }

  protected void createLocalizedAttributes(EOEntity entity) {
    NSArray attributes = entity.attributes().immutableClone();
    NSArray classProperties = entity.classProperties().immutableClone();
    NSArray attributesUsedForLocking = entity.attributesUsedForLocking().immutableClone();
    if (attributes == null) {
      attributes = NSArray.EmptyArray;
    }
    if (classProperties == null) {
      classProperties = NSArray.EmptyArray;
    }
    if (attributesUsedForLocking == null) {
      attributesUsedForLocking = NSArray.EmptyArray;
    }
    NSMutableArray mutableClassProperties = classProperties.mutableClone();
    NSMutableArray mutableAttributesUsedForLocking = attributesUsedForLocking.mutableClone();
    for (Enumeration e = attributes.objectEnumerator(); e.hasMoreElements();) {
      EOAttribute attribute = (EOAttribute) e.nextElement();
      NSDictionary userInfo = attribute.userInfo();
      String name = attribute.name();
      if (userInfo != null) {
        Object l = userInfo.valueForKey("ERXLanguages");
        if (l != null && !(l instanceof NSArray)) {
          l = (entity.model().userInfo() != null ? entity.model().userInfo().valueForKey("ERXLanguages") : null);
        }

        NSArray languages = (NSArray) l;
        if (languages != null && languages.count() > 0) {
          String columnName = attribute.columnName();
          for (int i = 0; i < languages.count(); i++) {
            String language = (String) languages.objectAtIndex(i);
            String newName = name + "_" + language;
            String newColumnName = columnName + "_" + language;

            EOAttribute newAttribute = new EOAttribute();
            newAttribute.setName(newName);
View Full Code Here

Examples of com.webobjects.foundation.NSArray

        map.put(key, value);
      }
      result = map;
    } else if (obj instanceof NSArray) {
      List list = new LinkedList();
      NSArray nsArray = (NSArray) obj;
      Enumeration valuesEnum = nsArray.objectEnumerator();
      while (valuesEnum.hasMoreElements()) {
        Object value = valuesEnum.nextElement();
        value = toJavaCollections(value);
        list.add(value);
      }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

  }

  public List reverseEngineerTableNames() {
    open();
    try {
      NSArray tableNamesArray = _channel.describeTableNames();
      return (List) EOFSQLUtils56.toJavaCollections(tableNamesArray);
    } finally {
      close();
    }
  }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

  }

  public File reverseEngineerWithTableNamesIntoModel(List tableNamesList) throws IOException {
    open();
    try {
      NSArray tableNamesArray = (NSArray) EOFSQLUtils56.toWOCollections(tableNamesList);
      com.webobjects.eoaccess.EOModel eofModel = _channel.describeModelWithTableNames(tableNamesArray);
      eofModel.beautifyNames();
      File tempFile = File.createTempFile("EntityModeler", "tmp");
      File eomodelFolder = new File(tempFile.getParentFile(), "EM" + System.currentTimeMillis() + ".eomodeld");
      tempFile.delete();
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.