Esempio n. 1
0
 @Override
 public boolean onKeyboardEvent(KeyboardEvent event) {
   NullCheck.notNull(event, "event");
   System.out.println(event.toString());
   if (closing.onKeyboardEvent(event)) return true;
   return super.onKeyboardEvent(event);
 }
Esempio n. 2
0
 @Override
 public boolean onKeyboardEvent(KeyboardEvent event) {
   if (event == null) throw new NullPointerException("event may not be null");
   if (closing.onKeyboardEvent(event)) return true;
   if (event.isModified() || !event.isSpecial()) return false;
   switch (event.getSpecial()) {
     case ENTER:
       return closing.doOk();
     case ARROW_DOWN:
       return onArrowDown(event, false);
     case ARROW_UP:
       return onArrowUp(event, false);
     case ALTERNATIVE_ARROW_DOWN:
       return onArrowDown(event, true);
     case ALTERNATIVE_ARROW_UP:
       return onArrowUp(event, true);
     case ARROW_LEFT:
       return onArrowLeft(event);
     case ARROW_RIGHT:
       return onArrowRight(event);
     case ALTERNATIVE_ARROW_LEFT:
       return onAltLeft(event);
     case ALTERNATIVE_ARROW_RIGHT:
       return onAltRight(event);
     case PAGE_DOWN:
       return onPageDown(event, false);
     case PAGE_UP:
       return onPageUp(event, false);
     case ALTERNATIVE_PAGE_DOWN:
       return onPageDown(event, true);
     case ALTERNATIVE_PAGE_UP:
       return onPageUp(event, true);
     case HOME:
       return onHome(event);
     case END:
       return onEnd(event);
     case ALTERNATIVE_HOME:
       return onAltHome(event);
     case ALTERNATIVE_END:
       return onAltEnd(event);
     case INSERT:
       return onInsert(event);
     default:
       return false;
   }
 }