Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSMutableDictionary


  public AjaxInPlaceViewTemplate(String aName, NSDictionary associations, WOElement template) {
    super(aName, AjaxInPlaceViewTemplate.processAssociations(associations), template);
  }

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


        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("classDescriptionNeededForClass", ERXConstant.NotificationClassArray), EOClassDescription.ClassDescriptionNeededForClassNotification, null);
      }

        public void reset() {
            _registeredModelNames = new NSMutableArray();
            _entitiesForClass = new NSMutableDictionary();
            _classDescriptionForEntity = new NSMutableDictionary();
        }
View Full Code Here

    public void appendToResponse(WOResponse res, WOContext ctx) {
        super.appendToResponse(res, ctx);
        _trackerId = safeElementID() + "_tracker";
        _handleId = safeElementID() + "_handle";
       
        NSMutableDictionary options = new NSMutableDictionary();
        new AjaxOption("axis", "orientation", null, AjaxOption.STRING).addToDictionary(this, options);
        new AjaxOption("sliderValue", "value", null, AjaxOption.NUMBER).addToDictionary(this, options);
        new AjaxOption("values", "possibleValues", null, AjaxOption.ARRAY).addToDictionary(this, options);
        new AjaxOption("alignX", AjaxOption.NUMBER).addToDictionary(this, options);
        new AjaxOption("alignY", AjaxOption.NUMBER).addToDictionary(this, options);
        new AjaxOption("disabled", AjaxOption.BOOLEAN).addToDictionary(this, options);
        new AjaxOption("handleImage", AjaxOption.STRING).addToDictionary(this, options);
        new AjaxOption("handleDisabled", AjaxOption.STRING).addToDictionary(this, options);
        new AjaxOption("increment", AjaxOption.NUMBER).addToDictionary(this, options);
        new AjaxOption("restricted", AjaxOption.BOOLEAN).addToDictionary(this, options);
        new AjaxOption("step", AjaxOption.NUMBER).addToDictionary(this, options);

        if(hasBinding("onChangeServer")) {
          String parent = (String) valueForBinding("onChange");
          options.setObjectForKey("function(v) {new Ajax.Request('"+ AjaxUtils.ajaxComponentActionUrl(context())
              +"', {parameters: '"+context().elementID()+"=' + v + '&ajaxSlideTrigger=onChange'})"
              +(parent != null ? "; var parentFunction = " + parent + "; parentFunction(v);" : "")
              +"}", "onChange");
        } else {
          new AjaxOption("onChange", AjaxOption.SCRIPT).addToDictionary(this, options);
        }
        if(hasBinding("onSlideServer")) {
          String parent = (String) valueForBinding("onSlide");
          options.setObjectForKey("function(v) {new Ajax.Request('"+ AjaxUtils.ajaxComponentActionUrl(context())
              +"', {parameters: '"+context().elementID()+"=' + v + '&ajaxSlideTrigger=onSlide'})"
              +(parent != null ? "; var parentFunction = " + parent + "; parentFunction(v);" : "")
              +"}", "onSlide");
        } else {
          new AjaxOption("onSlide", AjaxOption.SCRIPT).addToDictionary(this, options);
         }
        Number min = (Number)valueForBinding("minimum", Integer.valueOf(0));
        Number max = (Number)valueForBinding("maximum", Integer.valueOf(100));
        options.setObjectForKey("$R(" + min + "," + max + ")", "range");

        if (min != null && max != null && ERXComponentUtilities.booleanValueForBinding(this, "snap")) {
          StringBuilder valuesBuffer = new StringBuilder();
          valuesBuffer.append('[');
          for (int i = min.intValue(); i <= max.intValue(); i ++ ) {
            valuesBuffer.append(i);
            if (i < max.intValue()) {
              valuesBuffer.append(',');
            }
          }
          valuesBuffer.append(']');
          options.setObjectForKey(valuesBuffer.toString(), "values");
        }

        res.appendContentString("<div class=\"tracker\" id=\""+
                _trackerId+"\"><div class=\"handle\" id=\""+
                _handleId+"\"></div></div>");
View Full Code Here

      ajaxOptionsArray.addObject(new AjaxOption("autoSelect", AjaxOption.BOOLEAN));
      ajaxOptionsArray.addObject(new AjaxOption("choices", AjaxOption.NUMBER));
      ajaxOptionsArray.addObject(new AjaxOption("partialChars", AjaxOption.NUMBER));
      ajaxOptionsArray.addObject(new AjaxOption("ignoreCase", AjaxOption.BOOLEAN));
      ajaxOptionsArray.addObject(new AjaxOption("activateOnFocus", AjaxOption.BOOLEAN));
      NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this);
      return options;
    }
View Full Code Here

        StringBuffer str = new StringBuffer();
        boolean isLocalSharedList = hasBinding("isLocalSharedList") && ((Boolean) valueForBinding("isLocalSharedList")).booleanValue();
        String listJS = null;
        if (isLocalSharedList) {
          String varName = (String) valueForBinding("localSharedVarName");
          NSMutableDictionary userInfo = ERXWOContext.contextDictionary();
          if (userInfo.objectForKey(varName) == null) {
            String ljs = listeJS();
            AjaxUtils.addScriptCodeInHead(res, ctx, "var " + varName + " = " + ljs + ";");
            userInfo.setObjectForKey(ljs, varName);
          }
          listJS = varName;
        } else {
          listJS = listeJS();
        }
View Full Code Here

        }
        return _contextDictionary;
    }
   
    public NSDictionary contextDictionaryForPage() {
      NSMutableDictionary dict = contextDictionary().mutableClone();
      dict.removeObjectForKey("componentLevelKeys");
        return dict;
    }
View Full Code Here

    ajaxOptionsArray.addObject(new AjaxOption("evalScripts", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("useSpinner", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("spinnerTarget", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("spinnerOptions", AjaxOption.DICTIONARY));

    NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations());
    return options;

  }
View Full Code Here

    super.appendToResponse(response, context);
   
    WOComponent component = context.component();
    String observeFieldID = (String) valueForBinding("observeFieldID", component);
    String updateContainerID = MTAjaxUpdateContainer.updateContainerID(this, component);    
    NSMutableDictionary options = createAjaxOptions(component);
    boolean fullSubmit = booleanValueForBinding("fullSubmit", false, component);
    boolean observeFieldDescendents;
   
    if (observeFieldID != null) {
      observeFieldDescendents = false;
View Full Code Here

  }

  public static void appendToResponse(WOResponse response, WOContext context, AjaxDynamicElement element, String observeFieldID, boolean observeDescendentFields, String updateContainerID, boolean fullSubmit, NSMutableDictionary options) {
    WOComponent component = context.component();
    String submitButtonName = nameInContext(context, component, element);
    NSMutableDictionary observerOptions = new NSMutableDictionary();
    if (options != null) {
      observerOptions.addEntriesFromDictionary(options);
    }
    AjaxSubmitButton.fillInAjaxOptions(element, component, submitButtonName, observerOptions);

    Object observeFieldFrequency = observerOptions.removeObjectForKey("observeFieldFrequency");
    if (observeDescendentFields) {
      response.appendContentString("MTASB.observeDescendentFields");
    }
    else {
      response.appendContentString("MTASB.observeField");
    }

    Object observeDelay = observerOptions.removeObjectForKey("observeDelay");   
    response.appendContentString("(" + AjaxUtils.quote(updateContainerID) + ", " + AjaxUtils.quote(observeFieldID) + ", " + observeFieldFrequency + ", " + (!fullSubmit) + ", " + observeDelay + ", ");
    AjaxOptions.appendToResponse(observerOptions, response, context);
    response.appendContentString(");");
  }
View Full Code Here

          NSMutableArray translatedChoices = new NSMutableArray();
          for (Iterator iter = choices.iterator(); iter.hasNext();) {
            Object o = iter.next();
        String method = null;
        String label = null;
             NSMutableDictionary entry = new NSMutableDictionary();
            if (o instanceof NSDictionary) {
              entry.addEntriesFromDictionary((NSDictionary) o);
              method = (String) entry.objectForKey(BRANCH_NAME);
              label = (String) entry.objectForKey(BRANCH_LABEL);
            } else if (o instanceof String) {
                    method = (String) o;
                    entry.setObjectForKey(method, BRANCH_NAME);
                }
                if (label == null) {
              label = ERXLocalizer.currentLocalizer().localizedDisplayNameForKey(BRANCH_PREFIX, method);
               } else if(label.startsWith(BRANCH_PREFIX + ".")){
                 String localizerKey = label;
              String localized = ERXLocalizer.currentLocalizer().localizedStringForKey(label);
              if(localized == null) {
                label = ERXLocalizer.currentLocalizer().localizedDisplayNameForKey(BRANCH_PREFIX, method);
                  ERXLocalizer.currentLocalizer().takeValueForKey(label, localizerKey);
                } else {
                  label = localized;
              }
               } else {
                 // assume it's a user-provided value. If we have an entry in the localizer, use it
                 // otherwise just return it.
              label = ERXLocalizer.currentLocalizer().localizedStringForKeyWithDefault(label);
            }
            entry.setObjectForKey(label, BRANCH_LABEL);
            entry.setObjectForKey(method +  "Action", BRANCH_BUTTON_ID);
            translatedChoices.addObject(entry);
          }
          choices = translatedChoices;
        }
        return choices;
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.