Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b161b25 authored by Jean Chalard's avatar Jean Chalard
Browse files

Parse the shortcuts list file. (B2)

This does not use the shortcuts yet, it only reads up the file
in memory.

Change-Id: Ib9b8594c2dd6a38b1209b01c80e8894696312998
parent 07af2249
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -180,6 +180,26 @@ public class XmlDictInputOutput {
        }
    }

    /**
     * SAX handler for a shortcut XML file.
     */
    static private class ShortcutHandler extends AssociativeListHandler {
        private final static String ENTRY_TAG = "entry";
        private final static String ENTRY_ATTRIBUTE = "shortcut";
        private final static String TARGET_TAG = "target";
        private final static String REPLACEMENT_ATTRIBUTE = "replacement";
        private final static String TARGET_PRIORITY_ATTRIBUTE = "priority";

        public ShortcutHandler() {
            super(ENTRY_TAG, ENTRY_ATTRIBUTE, TARGET_TAG, REPLACEMENT_ATTRIBUTE,
                    TARGET_PRIORITY_ATTRIBUTE);
        }

        public HashMap<String, ArrayList<WeightedString>> getShortcutMap() {
            return getAssocMap();
        }
    }

    /**
     * Reads a dictionary from an XML file.
     *