public String getCommandName(KeyboardEvent event) { if (event == null) return null; for (int i = 0; i < items.size(); i++) { Item item = items.get(i); if (item.event.equals(event)) return item.actionName; } return null; }
public void addMapping(KeyboardEvent event, String actionName) { if (event == null || actionName == null) return; if (getCommandName(event) != null) return; items.add(new Item(event, actionName)); }