Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSMutableArray$ListItr


    protected NSArray defaultBranchChoices(D2WContext context) {
        NSArray choices = NSArray.EmptyArray;
        try {
          String task = context.task();
          String pageName = context.dynamicPage();
            NSMutableArray methodChoices = new NSMutableArray();
            Method methods[] = getClass().getMethods();
            for (Enumeration e = new NSArray(methods).objectEnumerator(); e.hasMoreElements();) {
                Method method = (Method)e.nextElement();
                if (method.getParameterTypes().length == 1
                        &&  method.getParameterTypes()[0] == WOComponent.class
                        && !method.getName().equals("nextPage")
                        && method.getName().charAt(0) != '_'
                        && ((method.getModifiers() & Modifier.PUBLIC) == Modifier.PUBLIC)
                ) {
                    boolean isAllowed = true;
                    if(method.isAnnotationPresent(D2WDelegate.class)) {
                      D2WDelegate info = method.getAnnotation(D2WDelegate.class);
                      String scope = info.scope();
                      String availableTasks = info.availableTasks();
                      String availablePages = info.availablePages();
            if(scope.length() > 0) {
              if("object".equals(scope) && context.valueForKey("object") == null) {
                isAllowed = false;
              }
              if(!"object".equals(scope) && context.valueForKey("object") != null) {
                isAllowed = false;
              }
            }
            if(availableTasks.length() > 0 && !availableTasks.contains(task)) {
              isAllowed = false;
            }
            if(availablePages.length() > 0 && !availablePages.contains(pageName)) {
              isAllowed = false;
            }
                    }
                    if(isAllowed) {
                      NSDictionary branch = branchChoiceDictionary(method.getName(), null);
                      methodChoices.addObject(branch);     
                    }
                }
            }
            choices = ERXArrayUtilities.sortedArraySortedWithKey(methodChoices, BRANCH_LABEL);
        } catch (SecurityException e) {
View Full Code Here


     * Utility to remove entries based on an array of keys
     * @param keys
     * @param choices
     */
    protected NSArray choiceByRemovingKeys(NSArray keys, NSArray choices) {
        NSMutableArray result = new NSMutableArray(choices.count());
        for (Enumeration e = choices.objectEnumerator(); e.hasMoreElements();) {
            NSDictionary choice = (NSDictionary) e.nextElement();
            if(!keys.containsObject(choice.objectForKey(BRANCH_NAME))) {
                result.addObject(choice);
            }
        }
        return result;
    }
View Full Code Here

     * Utility to leave entries based on an array of keys
     * @param keys
     * @param choices
     */
    protected NSArray choiceByLeavingKeys(NSArray keys, NSArray choices) {
        NSMutableArray result = new NSMutableArray(choices.count());
        for (Enumeration e = choices.objectEnumerator(); e.hasMoreElements();) {
            NSDictionary choice = (NSDictionary) e.nextElement();
            if(keys.containsObject(choice.objectForKey(BRANCH_NAME))) {
                result.addObject(choice);
            }
        }
        return result;
    }
View Full Code Here

  public WODisplayGroup displayGroup() {
    return (WODisplayGroup) valueForBinding("displayGroup");
  }

  public NSArray keys() {
    NSMutableArray result = new NSMutableArray(d2wContext().componentsAvailable().toArray());
    result.remove("ERD2WCustomComponentWithArgs");
    result.remove("ERD2WStatelessCustomComponentWithArgs");
    result.remove("D2WCustomComponent");
    result.remove("D2WCustomQueryComponent");
    //result.remove("ERDEditStringWithChoices");
    //result.remove("ERDDisplayYearsMonths");
    result = (NSMutableArray) result.valueForKey("@unique");
    return result;
  }
View Full Code Here

  private NSArray<IndexAttribute> attributesForEntity(EOEntity entity) {
    return attributesForAttributes(entity.attributesToFetch());
  }

  private NSArray<IndexAttribute> attributesForAttributes(NSArray<EOAttribute> attributes) {
    NSMutableArray result = new NSMutableArray<IndexAttribute>(attributes.count());
    for (EOAttribute attribute : attributes) {
      result.addObject(new IndexAttribute(attribute));
    }
    return result;
  }
View Full Code Here

    public Object selection() {
        return selections.count() > 0 ? selections.lastObject() : null;
    }

    public void setSelection(Object value) {
        selections = value != null ? new NSMutableArray(value) : new NSMutableArray();
    }
View Full Code Here

    public NSArray selectedObjects() {
        return selections;
    }

    public void setSelectedObjects(NSArray value) {
        selections = new NSMutableArray(value);
    }
View Full Code Here

            NSArray applicationArray = new NSArray(_Application.values());
            requestTypeDict.takeValueForKey(applicationArray, "applicationArray");
        }
        if (_InstanceArray != null) {
            int instanceCount = _InstanceArray.count();
            NSMutableArray instanceArray = new NSMutableArray(instanceCount);
            for (int i = 0; i < instanceCount; i++) {
                MInstance anInst = (MInstance) _InstanceArray.objectAtIndex(i);
                instanceArray.addObject(anInst.values());
            }
            requestTypeDict.takeValueForKey(instanceArray, "instanceArray");
        }

        updateWotaskd.takeValueForKey(requestTypeDict, requestType);
View Full Code Here

            synchronized (cache) {
                NSDictionary entries = relationshipCacheEntriesForEntity(sourceGid.entityName(), handler.relationshipName());
                if(entries != null) {
                    NSArray gids = (NSArray) entries.objectForKey(sourceGid);
                    if(gids != null) {
                        NSMutableArray eos = new NSMutableArray(gids.count());
                        for (Enumeration enumerator = gids.objectEnumerator(); enumerator.hasMoreElements();) {
                            EOGlobalID gid = (EOGlobalID) enumerator.nextElement();
                            EOEnterpriseObject eo = ec.faultForGlobalID(gid, ec);
                            eos.addObject(eo);
                        }
                        EOFaultHandler.clearFault(obj);
                        ((NSMutableArray)fault).addObjectsFromArray(eos);
                        return true;
                    }
View Full Code Here

  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public NSDictionary createAjaxOptions() {
   
    NSMutableArray ajaxOptionsArray = new NSMutableArray();
    ajaxOptionsArray.addObject(new AjaxOption("pickerClass", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("toggleElements", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("days", AjaxOption.ARRAY));
    ajaxOptionsArray.addObject(new AjaxOption("dayShort", AjaxOption.NUMBER));
    ajaxOptionsArray.addObject(new AjaxOption("months", AjaxOption.ARRAY));
    ajaxOptionsArray.addObject(new AjaxOption("monthShort", AjaxOption.NUMBER));
    ajaxOptionsArray.addObject(new AjaxOption("startDay", AjaxOption.NUMBER));
    ajaxOptionsArray.addObject(new AjaxOption("timePicker", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("timePickerOnly", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("yearPicker", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("yearsPerPage", AjaxOption.NUMBER));
    ajaxOptionsArray.addObject(new AjaxOption("animationDuration", AjaxOption.NUMBER));
    ajaxOptionsArray.addObject(new AjaxOption("useFadeInOut", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("startView", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("allowEmpty", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("positionOffset", AjaxOption.ARRAY));
    ajaxOptionsArray.addObject(new AjaxOption("minDate", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("maxDate", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("debug", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("onShow", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("onClose", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("onSelect", AjaxOption.SCRIPT));

    NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this);
    options.takeValueForKey(format(), "format");
    options.takeValueForKey(format(), "inputOutputFormat");
    return options;
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSMutableArray$ListItr

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.