if (scoreCalculator != null && selectedNodeList != null) {
for (Iterator iter = selectedNodeList.iterator(); iter.hasNext();) {
String nodeIdent = (String) iter.next();
boolean found = false;
for (Iterator nodeIter = allNodesList.iterator(); nodeIter.hasNext();) {
CourseNode node = (CourseNode) nodeIter.next();
if (node.getIdent().equals(nodeIdent)) {
found = true;
}
}
if (!found) addDeletedNodeIdent = true;
}
}
String[] nodeKeys = new String[allNodesList.size() + (addDeletedNodeIdent ? 1 : 0)];
String[] nodeValues = new String[allNodesList.size() + (addDeletedNodeIdent ? 1 : 0)];
for (int i = 0; i < allNodesList.size(); i++) {
CourseNode courseNode = (CourseNode) allNodesList.get(i);
nodeKeys[i] = courseNode.getIdent();
nodeValues[i] = courseNode.getShortName() + " (Id:" + courseNode.getIdent() + ")";
}
// add a deleted dummy node at last position
if (addDeletedNodeIdent) {
nodeKeys[allNodesList.size()] = DELETED_NODE_IDENTIFYER;
nodeValues[allNodesList.size()] = translate("scform.deletedNode");
}
StaticMultipleSelectionElement mse = new StaticMultipleSelectionElement(elemId, nodeKeys, nodeValues, false);
// preselect nodes from configuration
if (scoreCalculator != null && selectedNodeList != null) {
for (Iterator iter = selectedNodeList.iterator(); iter.hasNext();) {
String nodeIdent = (String) iter.next();
boolean found = false;
for (Iterator nodeIter = allNodesList.iterator(); nodeIter.hasNext();) {
CourseNode node = (CourseNode) nodeIter.next();
if (node.getIdent().equals(nodeIdent)) {
found = true;
}
}
if (found) {
mse.select(nodeIdent, true);