Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 public void addMapping(KeyboardEvent event, String actionName) {
   if (event == null || actionName == null) return;
   if (getCommandName(event) != null) return;
   items.add(new Item(event, actionName));
 }