use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.
the class ERXWOBrowser method _slowTakeValuesFromRequest.
private void _slowTakeValuesFromRequest(WORequest worequest, WOContext wocontext) {
WOComponent wocomponent = wocontext.component();
if (_selections != null && !isDisabledInContext(wocontext) && wocontext.wasFormSubmitted()) {
String s = nameInContext(wocontext, wocomponent);
NSArray nsarray = worequest.formValuesForKey(s);
int i = nsarray != null ? nsarray.count() : 0;
int size = 0;
NSMutableArray nsmutablearray = new NSMutableArray(i);
List vector = null;
if (i != 0) {
NSArray nsarray1 = null;
List vector1 = null;
Object list = _list.valueInComponent(wocomponent);
if (list != null) {
if (list instanceof NSArray) {
nsarray1 = (NSArray) list;
size = nsarray1.count();
} else if (list instanceof List) {
vector1 = (List) list;
nsmutablearray = null;
vector = new ArrayList();
size = vector1.size();
} else {
throw new IllegalArgumentException("<" + getClass().getName() + "> Evaluating 'list' binding returned a " + list.getClass().getName() + " when it should return either a com.webobjects.foundation.NSArray, or a java.lang.Vector .");
}
}
boolean flag = _multiple != null ? _multiple.booleanValueInComponent(wocomponent) : false;
for (int k = 0; k < size; k++) {
Object obj1 = nsarray1 == null ? vector1.get(k) : nsarray1.objectAtIndex(k);
_item.setValue(obj1, wocomponent);
Object obj2 = _value.valueInComponent(wocomponent);
if (obj2 != null) {
if (!nsarray.containsObject(obj2.toString())) {
continue;
}
if (nsarray1 != null) {
nsmutablearray.addObject(obj1);
} else {
vector.add(obj1);
}
if (!flag) {
break;
}
} else {
log.debug("{} 'value' evaluated to null in component {}.\nUnable to select item {}", this, wocomponent, obj1);
}
}
}
Object newValue = (nsmutablearray != null ? nsmutablearray : vector);
setSelectedValue(newValue, wocomponent);
}
}
use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.
the class ERXLog4JConfiguration method classForAppenderRow.
public String classForAppenderRow() {
NSMutableArray array = new NSMutableArray();
Level level = currentAppenderLevel().level();
if (level != null) {
array.addObject(level);
}
if (rowIndex % 2 == 0) {
array.addObject("alt");
}
return array.componentsJoinedByString(" ");
}
use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.
the class ERXLog4JConfiguration method loggers.
/**
* Gets all of the configured {@link Logger loggers} that pass the filters for logger name and level.
* @return the loggers
*/
public NSArray loggers() {
NSMutableArray result = new NSMutableArray();
for (Enumeration e = allLoggers().objectEnumerator(); e.hasMoreElements(); ) {
Logger log = (Logger) e.nextElement();
while (log != null) {
addLogger(log, result);
log = (Logger) log.getParent();
}
}
return result;
}
use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.
the class ERXLog4JConfiguration method allLoggers.
private NSArray allLoggers() {
NSMutableArray result = new NSMutableArray();
// Float the root logger to the top.
Logger rootLogger = LogManager.getRootLogger();
addLogger(rootLogger, result);
NSMutableArray otherLoggers = new NSMutableArray();
for (Enumeration e = LogManager.getCurrentLoggers(); e.hasMoreElements(); ) {
Logger log = (Logger) e.nextElement();
while (log != null) {
if (log != rootLogger) {
otherLoggers.addObject(log);
}
log = (Logger) log.getParent();
}
}
Collections.sort(otherLoggers, Comparator.comparing(Logger::getName));
result.addObjectsFromArray(otherLoggers);
return result;
}
use of com.webobjects.foundation.NSMutableArray in project wonder-slim by undur.
the class ERXLog4JConfiguration method classForLoggerRow.
public String classForLoggerRow() {
NSMutableArray array = new NSMutableArray();
Level level = logger().getLevel();
if (level != null) {
array.addObject(level.toString().toLowerCase());
}
if (rowIndex % 2 == 0) {
array.addObject("alt");
}
return array.componentsJoinedByString(" ");
}
Aggregations