/** * Write shortcuts to xml file * * @param shortcutsNode * @return */ private static void setBindings(List<KeyBindingAction> list, Document document) { Node shortcutsNode = document.createElement(SHORTCUT_ROOT); Iterator<KeyBindingAction> it = list.iterator(); while (it.hasNext()) { KeyBindingAction keyBindingAction = (KeyBindingAction) it.next(); Node node = document.createElement(SHORTCUT_TAG); shortcutsNode.appendChild(node); Attr attrKey = document.createAttribute(SHORTCUT_ATTRIBUTE_KEY); Attr attrMask = document.createAttribute(SHORTCUT_ATTRIBUTE_MASK); Attr attrAction = document.createAttribute(SHORTCUT_ATTRIBUTE_ACTION); attrKey.setNodeValue(Integer.toString(keyBindingAction.getKeyBinding().getKey())); attrMask.setNodeValue(Integer.toString(keyBindingAction.getKeyBinding().getMask())); attrAction.setNodeValue(keyBindingAction.getAction()); node.getAttributes().setNamedItem(attrKey); node.getAttributes().setNamedItem(attrMask); node.getAttributes().setNamedItem(attrAction); } document.appendChild(shortcutsNode); }