} // MyPresenceListener
private class PickUsersFunction extends ScriptableFunctionBase {
protected Object execute(Object thiz, Object[] args) throws Exception {
final Scriptable options = (Scriptable) args[0];
final ScriptableFunction onComplete = (ScriptableFunction) args[1];
// title is optional. default = null
final String title;
final Object titleObj = options.getField("title");
if(titleObj.equals(UNDEFINED)) {
title = null;
} else {
title = (String) titleObj;
}
// multiSelect is optional. default = false
final Object multiSelectObj = options.getField("multiSelect");
final boolean multiSelect;
if(multiSelectObj.equals(UNDEFINED)) {
multiSelect = false;
} else {
multiSelect = ((Boolean) multiSelectObj).booleanValue();
}
// showSelectAll is optional. default = false
final Object showSelectAllObj = options.getField("showSelectAll");
final boolean showSelectAll;
if(showSelectAllObj.equals(UNDEFINED)) {
showSelectAll = false;
} else {
showSelectAll = ((Boolean) showSelectAllObj).booleanValue();
}
// type is optional. default = -1
final Object type = options.getField("type");
final int groupTypeInt;
if(type.equals(UNDEFINED)) {
groupTypeInt = -1;
} else {
groupTypeInt = Util.groupTypeStrToInt((String) type);
}
// users is optional. default = null
final Object users = options.getField("users");
final ContactListProvider userList;
if(users.equals(UNDEFINED)) {
userList = null;
} else {
BBMPlatformUser[] usersArray = Util.scriptableUsersArrayToUserArray((Scriptable) users);