Search in sources :

Example 26 with NSMutableArray

use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.

the class AjaxModalDialogOpener method ajaxRequestOptions.

/**
 * @return options for Ajax.Request that is made when the link is clicked
 */
protected NSMutableDictionary ajaxRequestOptions() {
    NSMutableArray ajaxOptionsArray = new NSMutableArray();
    ajaxOptionsArray.addObject(new AjaxConstantOption("asynchronous", Boolean.FALSE, AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxConstantOption("evalScripts", Boolean.FALSE, AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("onFailure", AjaxOption.FUNCTION_1));
    // onSuccess callback handler to open AMD
    StringBuilder sb = new StringBuilder(500);
    sb.append(AjaxModalDialog.openDialogFunctionName(modalDialogId()));
    sb.append('(');
    // Override for dialog name
    if (hasBinding("title")) {
        sb.append(AjaxValue.javaScriptEscaped(valueForBinding("title")));
    }
    sb.append(");");
    ajaxOptionsArray.addObject(new AjaxConstantOption("onSuccess", sb.toString(), AjaxOption.FUNCTION_1));
    return AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this);
}
Also used : NSMutableArray(com.webobjects.foundation.NSMutableArray)

Example 27 with NSMutableArray

use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.

the class AjaxAccordion method createAjaxOptions.

public NSDictionary createAjaxOptions() {
    NSMutableArray ajaxOptionsArray = new NSMutableArray();
    ajaxOptionsArray.addObject(new AjaxOption("expandedBg", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("hoverBg", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("collapsedBg", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("expandedTextColor", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("expandedFontWeight", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("hoverTextColor", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("collapsedTextColor", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("collapsedFontWeight", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("hoverTextColor", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("borderColor", AjaxOption.STRING));
    ajaxOptionsArray.addObject(new AjaxOption("panelHeight", AjaxOption.NUMBER));
    ajaxOptionsArray.addObject(new AjaxOption("onHideTab", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("onShowTab", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("onLoadShowTab", AjaxOption.SCRIPT));
    NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this);
    return options;
}
Also used : NSMutableArray(com.webobjects.foundation.NSMutableArray) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Example 28 with NSMutableArray

use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.

the class AjaxDatePicker method localizeStringArray.

private NSArray<String> localizeStringArray(NSArray<String> strings) {
    NSMutableArray<String> localizedStrings = new NSMutableArray<>(strings.count());
    ERXLocalizer l = ERXLocalizer.currentLocalizer();
    for (String string : strings) localizedStrings.add(l.localizedStringForKeyWithDefault(string));
    return localizedStrings.immutableClone();
}
Also used : NSMutableArray(com.webobjects.foundation.NSMutableArray) ERXLocalizer(er.extensions.localization.ERXLocalizer)

Example 29 with NSMutableArray

use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.

the class ERXSession method setLanguage.

/**
 * Cover method to set the current localizer to the localizer for that
 * language.
 * <p>
 * Also updates languages list with the new single language.
 *
 * @param language to set the current localizer for.
 * @see #language
 * @see #setLanguages
 */
public void setLanguage(String language) {
    ERXLocalizer newLocalizer = ERXLocalizer.localizerForLanguage(language);
    if (!newLocalizer.equals(_localizer)) {
        if (_localizer == null && !WOApplication.application().isCachingEnabled())
            observer().registerForLocalizationDidResetNotification();
        _localizer = newLocalizer;
        ERXLocalizer.setCurrentLocalizer(_localizer);
        NSMutableArray languageList = new NSMutableArray(_localizer.language());
        if (!languageList.containsObject("Nonlocalized"))
            languageList.addObject("Nonlocalized");
        setLanguages(languageList);
    }
}
Also used : NSMutableArray(com.webobjects.foundation.NSMutableArray) ERXLocalizer(er.extensions.localization.ERXLocalizer)

Example 30 with NSMutableArray

use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.

the class ERXAjaxSession method _permanentPageCache.

/**
 * Returns the permanent page cache. Initializes it if needed.
 */
protected NSMutableDictionary _permanentPageCache() {
    if (_permanentPageCache == null) {
        _permanentPageCache = new NSMutableDictionary(64);
        _permanentContextIDArray = new NSMutableArray(64);
    }
    return _permanentPageCache;
}
Also used : NSMutableArray(com.webobjects.foundation.NSMutableArray) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Aggregations

NSMutableArray (com.webobjects.foundation.NSMutableArray)35 NSArray (com.webobjects.foundation.NSArray)13 Enumeration (java.util.Enumeration)8 NSMutableDictionary (com.webobjects.foundation.NSMutableDictionary)6 WOComponent (com.webobjects.appserver.WOComponent)4 WOElement (com.webobjects.appserver.WOElement)3 WODynamicGroup (com.webobjects.appserver._private.WODynamicGroup)3 WOHTMLBareString (com.webobjects.appserver._private.WOHTMLBareString)3 NSBundle (com.webobjects.foundation.NSBundle)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 WOComponentReference (com.webobjects.appserver._private.WOComponentReference)2 NSComparator (com.webobjects.foundation.NSComparator)2 ERXLocalizer (er.extensions.localization.ERXLocalizer)2 File (java.io.File)2 Level (org.apache.log4j.Level)2 Logger (org.apache.log4j.Logger)2 WOActionResults (com.webobjects.appserver.WOActionResults)1 WOContext (com.webobjects.appserver.WOContext)1 WOEvent (com.webobjects.appserver.WOEvent)1