protected void addActionHelper(IMenuManager menu, List modelQueryActionList) {
List actionList = new Vector();
for (Iterator i = modelQueryActionList.iterator(); i.hasNext();) {
ModelQueryAction action = (ModelQueryAction) i.next();
if (action.getCMNode() != null) {
int cmNodeType = action.getCMNode().getNodeType();
if (action.getKind() == ModelQueryAction.INSERT) {
switch (cmNodeType) {
case CMNode.ATTRIBUTE_DECLARATION : {
actionList.add(createAddAttributeAction((Element) action.getParent(), (CMAttributeDeclaration) action.getCMNode()));
break;
}
case CMNode.ELEMENT_DECLARATION : {
actionList.add(createAddElementAction(action.getParent(), (CMElementDeclaration) action.getCMNode(), action.getStartIndex()));
break;
}
}
}
else if (action.getKind() == ModelQueryAction.REPLACE) {
if ((action.getParent() != null) && (action.getCMNode() != null)) {
actionList.add(createReplaceAction(action.getParent(), action.getCMNode(), action.getStartIndex(), action.getEndIndex()));
}
}
}
}
menuBuilder.populateMenu(menu, actionList, false);