use of com.webobjects.foundation.NSArray in project wonder-slim by undur.
the class ERXDeployedBundle method deployedBundleForFrameworkNamed.
public static synchronized WODeployedBundle deployedBundleForFrameworkNamed(String aFrameworkName) {
WODeployedBundle aBundle = null;
NSArray bundleArray = TheBundles.allValues();
int baCount = TheBundles.count();
NSBundle nsBundle = NSBundle.bundleForName(aFrameworkName);
if (nsBundle == null)
nsBundle = NSBundle.bundleWithPath(aFrameworkName);
if (nsBundle != null) {
int i = 0;
do {
if (i >= baCount)
break;
WODeployedBundle aFrameworkBundle = (WODeployedBundle) bundleArray.objectAtIndex(i);
if (nsBundle.equals(aFrameworkBundle.nsBundle())) {
aBundle = aFrameworkBundle;
WODeployedBundle dBundle = aBundle.projectBundle();
if (dBundle != null)
aBundle = dBundle;
break;
}
i++;
} while (true);
}
return aBundle;
}
use of com.webobjects.foundation.NSArray in project wonder-slim by undur.
the class WXOutlineEntry method isExpanded.
public boolean isExpanded() {
Object currentItem = valueForBinding("item");
NSArray selectionPath = (NSArray) _WOJExtensionsUtil.valueForBindingOrNull("selectionPath", this);
return (_nestingLevel < selectionPath.count()) && selectionPath.objectAtIndex(_nestingLevel).equals(currentItem);
}
use of com.webobjects.foundation.NSArray in project wonder-slim by undur.
the class WOEventDisplayPage method topmostDurationValue.
public long topmostDurationValue() {
NSArray roots;
roots = rootEventList();
if (roots == null || (roots.count() == 0))
return 0;
else
return durationOfEvent((EOEvent) roots.objectAtIndex(0));
}
use of com.webobjects.foundation.NSArray in project wonder-slim by undur.
the class WOEventDisplayPage method durationOfEvent.
public long durationOfEvent(EOEvent e) {
int i, n;
long sum;
NSArray kids;
// be displayed, even if they may have a duration.
if (_displayMode != 4) {
sum = e.duration();
return sum;
}
// if an event has no kids, but we are still here, it means that it is
// an association event (because otherwise it would be filtered out).
kids = childrenForEvent(e);
if (kids == null) {
kids = NSArray.EmptyArray;
}
n = kids.count();
if (n != 0) {
for (i = 0, sum = 0; i < n; i++) {
sum += ((EOEvent) kids.objectAtIndex(i)).duration();
}
} else {
sum = e.duration();
}
return sum;
}
use of com.webobjects.foundation.NSArray in project wonder-slim by undur.
the class ERXSimpleTemplateParser method keysInTemplate.
/**
* Calculates the set of keys used in a given template
* for a given delimiter.
*
* @param template to check for keys
* @param delimiter for finding keys
* @return array of keys
*/
public NSArray keysInTemplate(String template, String delimiter) {
NSMutableSet keys = new NSMutableSet();
if (delimiter == null) {
delimiter = DEFAULT_DELIMITER;
}
NSArray components = NSArray.componentsSeparatedByString(template, delimiter);
if (!isLoggingDisabled) {
log.debug("Components: {}", components);
}
// if the template starts with delim, the first component will be a zero-length string
boolean deriveElement = false;
for (Enumeration e = components.objectEnumerator(); e.hasMoreElements(); ) {
String element = (String) e.nextElement();
if (deriveElement) {
if (element.length() == 0) {
throw new IllegalArgumentException("\"\" is not a valid keypath");
}
keys.addObject(element);
deriveElement = false;
} else {
deriveElement = true;
}
}
return keys.allObjects();
}
Aggregations