예제 #1
0
 protected boolean handleKeyTraverse(int traversal) {
   if (traversal == SWT.TRAVERSE_RETURN) {
     if (editor != null) {
       if (editor.isActivated()) {
         changeProperty(editor.getValue());
         hideEditor();
         update();
       } else {
         open();
       }
     }
     return false;
   } else if (traversal == SWT.TRAVERSE_ARROW_PREVIOUS) {
     //            selectPrev();
     return true;
   } else if (traversal == SWT.TRAVERSE_ARROW_NEXT) {
     //            selectNext();
     return true;
   } else if (traversal == SWT.TRAVERSE_TAB_NEXT) {
     //            return selectNext();
     return true;
   } else if (traversal == SWT.TRAVERSE_TAB_PREVIOUS) {
     //            return selectPrev();
     return true;
   } else if (traversal == SWT.TRAVERSE_ESCAPE) {
     if (editor.isActivated()) {
       hideEditor();
       update();
       return false;
     } else {
       return true;
     }
   }
   return false;
 }
예제 #2
0
 public void setFocus() {
   if (editor != null && editor.isActivated()) {
     editor.setFocus();
   } else if (canvas != null && !canvas.isDisposed()) {
     canvas.setFocus();
   }
 }
예제 #3
0
 protected void handleMouseMove(int x, int y) {
   setShowingHover(isInHover(x, y));
   if (editor != null) {
     if (!editor.isActivated()) {
       if (isInEditorHover(x, y)) {
         setShowingEditorHover(true);
       } else {
         setShowingEditorHover(false);
       }
     } else {
       setShowingEditorHover(false);
     }
   }
 }