Search in sources :

Example 6 with NSMutableArray

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

the class AjaxTree method nodes.

public NSArray nodes() {
    Object rootNode = treeModel().rootTreeNode();
    boolean useCache = ERXComponentUtilities.booleanValueForBinding("cache", true, _keyAssociations, parent());
    if (_nodes == null || rootNode == null || !rootNode.equals(_lastRootNode) || !useCache) {
        NSMutableArray nodes = new NSMutableArray();
        boolean showRoot = ERXComponentUtilities.booleanValueForBinding("showRoot", true, _keyAssociations, parent());
        _fillInOpenNodes(treeModel().rootTreeNode(), nodes, showRoot);
        _nodes = nodes;
        _lastRootNode = rootNode;
    }
    return _nodes;
}
Also used : NSMutableArray(com.webobjects.foundation.NSMutableArray)

Example 7 with NSMutableArray

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

the class AjaxUpdateContainer method createObserveFieldOptions.

public NSMutableDictionary createObserveFieldOptions(WOComponent component) {
    NSMutableArray ajaxOptionsArray = new NSMutableArray();
    ajaxOptionsArray.addObject(new AjaxOption("observeFieldFrequency", AjaxOption.NUMBER));
    NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations());
    return options;
}
Also used : NSMutableArray(com.webobjects.foundation.NSMutableArray) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Example 8 with NSMutableArray

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

the class AjaxSubmitButton method createAjaxOptions.

public NSMutableDictionary createAjaxOptions(WOComponent component) {
    // PROTOTYPE OPTIONS
    NSMutableArray<AjaxOption> ajaxOptionsArray = new NSMutableArray<>();
    ajaxOptionsArray.addObject(new AjaxOption("onComplete", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("onSuccess", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("onFailure", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("onLoading", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("evalScripts", AjaxOption.BOOLEAN));
    ajaxOptionsArray.addObject(new AjaxOption("insertion", AjaxOption.SCRIPT));
    ajaxOptionsArray.addObject(new AjaxOption("asynchronous", AjaxOption.BOOLEAN));
    String name = nameInContext(component.context(), component);
    NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations());
    AjaxSubmitButton.fillInAjaxOptions(this, component, name, options);
    return options;
}
Also used : NSMutableArray(com.webobjects.foundation.NSMutableArray) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Example 9 with NSMutableArray

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

the class WOEventDisplayPage method filterEvents.

public NSArray filterEvents(NSArray evs, int level) {
    int i, n;
    NSArray filtered;
    if (evs == null) {
        return NSArray.EmptyArray;
    }
    // by their plain duration, which is what the default implementation does.
    try {
        if (_displayMode != 4 || level != 0) {
            try {
                filtered = evs.sortedArrayUsingComparator(_eventAscendingComparator);
            } catch (IllegalStateException ex) {
                filtered = evs;
            }
        } else {
            // For association mode, we need to filter out unwanted events,
            // i.e. those which are not related to associations.
            int count = evs.count();
            NSMutableArray mutableFiltered = new NSMutableArray(count);
            for (i = 0, n = count; i < n; i++) {
                if (childrenForEvent((EOEvent) evs.objectAtIndex(i)).count() != 0)
                    mutableFiltered.addObject(evs.objectAtIndex(i));
            }
            mutableFiltered.sortUsingComparator(_eventAscendingComparator);
            filtered = mutableFiltered;
        }
    } catch (NSComparator.ComparisonException e) {
        throw NSForwardException._runtimeExceptionForThrowable(e);
    }
    return filtered;
}
Also used : NSComparator(com.webobjects.foundation.NSComparator) NSArray(com.webobjects.foundation.NSArray) NSMutableArray(com.webobjects.foundation.NSMutableArray)

Example 10 with NSMutableArray

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

the class WOEventDisplayPage method _cacheWebEofEvents.

public void _cacheWebEofEvents() {
    if (webEvents != null)
        return;
    NSArray allCenters = EOEventCenter.allEventsForAllCenters();
    int halfCount = allCenters.count() / 2;
    webEvents = new NSMutableArray(halfCount);
    eofEvents = new NSMutableArray(halfCount);
    Enumeration anEnumerator = allCenters.objectEnumerator();
    while (anEnumerator.hasMoreElements()) {
        EOEvent e = (EOEvent) anEnumerator.nextElement();
        if (e instanceof WOEvent)
            webEvents.addObject(e);
        else
            eofEvents.addObject(e);
    }
}
Also used : EOEvent(com.webobjects.eocontrol.EOEvent) WOEvent(com.webobjects.appserver.WOEvent) Enumeration(java.util.Enumeration) NSArray(com.webobjects.foundation.NSArray) NSMutableArray(com.webobjects.foundation.NSMutableArray)

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