use of com.dexels.navajo.adapter.OptionMap in project navajo by Dexels.
the class MessageMap method getSelections.
public OptionMap[] getSelections() throws UserException {
if (selectionPointer == null) {
throw new UserException(-1, "Set selectionPointer first.");
}
Property p = getPropertyObject(selectionPointer);
if (!p.getType().equals(Property.SELECTION_PROPERTY)) {
throw new UserException(-1, "selections only supported for selection properties");
}
List<Selection> all = p.getAllSelections();
OptionMap[] om = new OptionMap[all.size()];
for (int i = 0; i < all.size(); i++) {
Selection s = all.get(i);
om[i] = new OptionMap();
om[i].setOptionName(s.getName());
om[i].setOptionValue(s.getValue());
om[i].setOptionSelected(s.isSelected());
}
return om;
}
Aggregations