Examples of NSMutableDictionary


Examples of com.webobjects.foundation.NSMutableDictionary

    ajaxOptionsArray.addObject(new AjaxOption("loadingText", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("callback", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("submitOnBlur", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("valueWhenEmpty", AjaxOption.STRING));
    //ajaxOptionsArray.addObject(new AjaxOption("ajaxOptions", AjaxOption.SCRIPT));
    NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations());
    return options;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

     * Builds a cached dictionary of the list item offsets and their display strings.
     * @return the dictionary
     */
    private NSDictionary cachedPossibleValues() {
        if (null == _cachedPossibleValuesDict) {
            NSMutableDictionary result = new NSMutableDictionary();
            NSArray allValues = maybeSortedList();
            for (int i = 0; i < allValues.count(); i++) {
                Object item = allValues.objectAtIndex(i);
                setCurrentItem(item); // Force the item to push up to the parent component, so we can ask it for the displayString.
                String displayString = stringValueForBinding(Keys.DisplayString);
                String value = displayString != null ? displayString : item.toString();
                result.setObjectForKey(value, i);
            }
            _cachedPossibleValuesDict = result;
        }
        return _cachedPossibleValuesDict;
    }
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

        return _url;
    }
   
    public NSDictionary arguments() {
        if(_arguments == null) {
            _arguments = new NSMutableDictionary();
            for(Enumeration e = bindingKeys().objectEnumerator(); e.hasMoreElements();) {
                String s = (String)e.nextElement();
                if(s.indexOf("?") == 0) {
                    Object o = valueForBinding(s);
                    if(o != null)
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

   *            the session
   * @param progress
   *            the progress object to register
   */
  public static void registerProgress(WOSession session, AjaxProgress progress) {
    NSMutableDictionary progresses = (NSMutableDictionary) session.objectForKey(AjaxProgressBar.AJAX_PROGRESSES_KEY);
    if (progresses == null) {
      progresses = new NSMutableDictionary();
      session.setObjectForKey(progresses, AjaxProgressBar.AJAX_PROGRESSES_KEY);
    }
    progresses.setObjectForKey(progress, progress.id());
  }
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

   *            the session
   * @param progress
   *            the progress object to unregister
   */
  public static void unregisterProgress(WOSession session, AjaxProgress progress) {
    NSMutableDictionary progresses = (NSMutableDictionary) session.objectForKey(AjaxProgressBar.AJAX_PROGRESSES_KEY);
    if (progresses != null && progress.id() != null) {
      progresses.removeObjectForKey(progress.id());
    }
  }
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

    }
    if (java_class == null) {
      throw new UnmarshallException("no type hint");
    }
    boolean immutableClone = false;
    NSMutableDictionary abdictionary;
    if (java_class.equals("com.webobjects.foundation.NSDictionary")) {
      abdictionary = new NSMutableDictionary();
      immutableClone = true;
    }
    else if (java_class.equals("com.webobjects.foundation.NSMutableDictionary")) {
      abdictionary = new NSMutableDictionary();
    }
    else {
      throw new UnmarshallException("not an NSDictionary");
    }
    JSONObject jsondictionary;
    try {
      jsondictionary = jso.getJSONObject("nsdictionary");
    }
    catch (JSONException e) {
      throw new UnmarshallException("Could not read dictionary: " + e.getMessage(), e);
    }
    if (jsondictionary == null) {
      throw new UnmarshallException("nsdictionary missing");
    }
    Iterator i = jsondictionary.keys();
    String key = null;
    try {
      while (i.hasNext()) {
        key = (String) i.next();
        Object value = ser.unmarshall(state, null, jsondictionary.get(key));
        if (value != null) {
          abdictionary.setObjectForKey(value, key);
        }
        else {
          abdictionary.setObjectForKey(NSKeyValueCoding.NullValue, key);
        }
      }
      NSDictionary finalDictionary = abdictionary;
      if (immutableClone) {
        finalDictionary = abdictionary.immutableClone();
      }
      state.setSerialized(o, finalDictionary);
      return finalDictionary;
    }
    catch (UnmarshallException e) {
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

     * Gathers D2W-related information from the current context.  This is mainly useful for debugging.
     * @param context the current context
     * @return a dictionary of D2W-related keys to describe the D2W state of the context.
     */
    public static synchronized NSMutableDictionary informationForContext(WOContext context) {
        NSMutableDictionary info = new NSMutableDictionary();
        D2WContext d2wContext = null;
        NSArray componentStack = ERXWOContext._componentPath(context);
        // Try to get the information for the D2WPage closest to the end of the component stack, i.e., more specific
        // info., that is especially helpful for finding problems in embedded page configurations.
        WOComponent component = null;
        for (Enumeration componentsEnum = componentStack.reverseObjectEnumerator(); componentsEnum.hasMoreElements();) {
            WOComponent c = (WOComponent)componentsEnum.nextElement();
            if (c instanceof D2WPage) {
                component = c;
                break;
            }
        }
        if (null == component) { // Fall back to the highest level page.
            component = context.page();
        }

        try {
            d2wContext = (D2WContext)component.valueForKey("d2wContext");
        } catch (NSKeyValueCoding.UnknownKeyException uke) {
            if (log.isInfoEnabled()) {
                log.info("Could not retrieve D2WContext from component context; it is probably not a D2W component.");
            }
        }

        if (d2wContext != null) {
            NSMutableDictionary d2wInfo = informationForD2WContext(d2wContext);
            if (component instanceof ERD2WPage) {
                ERD2WPage currentPage = (ERD2WPage)component;
                String subTask = (String)d2wContext.valueForKey("subTask");
                if ("tab".equals(subTask) || "wizard".equals("subTask")) {
                    NSArray sections = currentPage.sectionsForCurrentTab();
                    d2wInfo.setObjectForKey(sections != null ? sections : "null", "D2W-SectionsContentsForCurrentTab");
                    d2wInfo.removeObjectForKey("D2W-TabSectionsContents");
                }
            }
            info.addEntriesFromDictionary(d2wInfo);
        }

View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

     * Gathers D2W-related information from the current context.  This is mainly useful for debugging.
     * @param d2wContext the D2W context from which to derive the debugging information
     * @return a dictionary of D2W-related keys to describe the state of the provided D2W context.
     */
    public static synchronized NSMutableDictionary informationForD2WContext(D2WContext d2wContext) {
        NSMutableDictionary info = new NSMutableDictionary();
        if (d2wContext != null) {
            String pageConfiguration = (String)d2wContext.valueForKeyPath("pageConfiguration");
            info.setObjectForKey(pageConfiguration != null ? pageConfiguration : "null", "D2W-PageConfiguration");

            String propertyKey = d2wContext.propertyKey();
            info.setObjectForKey(propertyKey != null ? propertyKey : "null", "D2W-PropertyKey");

            String entityName = (String)d2wContext.valueForKeyPath("entity.name");
            info.setObjectForKey(entityName != null ? entityName : "null", "D2W-EntityName");

            String task = (String)d2wContext.valueForKey("task");
            info.setObjectForKey(task != null ? task : "null", "D2W-SubTask");

            String subTask = (String)d2wContext.valueForKey("subTask");
            info.setObjectForKey(subTask != null ? subTask : "null", "D2W-SubTask");

            if ("tab".equals(subTask) || "wizard".equals("subTask")) {
                String tabKey = (String)d2wContext.valueForKey("tabKey");
                info.setObjectForKey(tabKey != null ? tabKey : "null", "D2W-TabKey");

                NSArray tabSections = (NSArray)d2wContext.valueForKey("tabSectionsContents");
                info.setObjectForKey(tabSections != null ? tabSections : "null", "D2W-TabSectionsContents");
            } else {
                NSArray displayPropertyKeys = (NSArray)d2wContext.valueForKey("displayPropertyKeys");
                info.setObjectForKey(displayPropertyKeys != null ? displayPropertyKeys : "null", "D2W-DisplayPropertyKeys");
            }

            String componentName = (String)d2wContext.valueForKey("componentName");
            info.setObjectForKey(componentName != null ? componentName : "null", "D2W-ComponentName");

            if (componentName != null && componentName.indexOf("CustomComponent") > 0) {
                String customComponentName = (String)d2wContext.valueForKey("customComponentName");
                info.setObjectForKey(customComponentName != null ? customComponentName : "null", "D2W-ComponentName");
            }

        }
        return info;
    }
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

    super(aName, AjaxInPlaceEditTemplate.processAssociations(associations), template);
    // TODO Auto-generated constructor stub
  }

  protected static NSDictionary processAssociations(NSDictionary associations) {
    NSMutableDictionary mutableAssociations = (NSMutableDictionary) associations;
    mutableAssociations.setObjectForKey(new WOConstantValueAssociation("edit"), "templateName");
    return mutableAssociations;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSMutableDictionary

        }
    }

    public void readDefaultValues() {
        if(_initialDefaultValues == null) {
            _initialDefaultValues = new NSMutableDictionary();

            EOEntity entity = entity();
            NSDictionary entityInfo = (NSDictionary)entity.userInfo().objectForKey("ERXDefaultValues");

            for( Enumeration e = entity.attributes().objectEnumerator(); e.hasMoreElements();) {
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.