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;
}
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;
}
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;
}
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;
}
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);
}
}
Aggregations