


CLEANUP
  make the editor invisible

Run these tests using ATest.bbj which is in the same directory as this file

create => press 'create' button to create grid
click => click in the grid in a cell that is not currently selected
edit =>   double click in grid
tab  =>   press <TAB> key
enter =>  press <ENTER> key
navOther =>  with focus in grid press <ALT><TAB>
navGrid  =>  with focus in some other window <ALT><TAB> to grid
CEDIT  => click in CEDIT 

A)   click cedit click                          ok
B)   edit  cedit click                          ok
C)   select navOther navGrid                    ok     
D)   edit  navOther navGrid                     ok
D2)      then click                             ok
E)   click in last column,  tab to next control ok 
E2)     then shift-tab to return                ok
F)   edit in last column, tab to next control.  ok 
F2)      then shift-tab to return               ok                                
G)   click,  click in other window, click       ok  
H)   edit,   click in other window  click     . ok    
H2)  click, return, dclick, return              ok
I)   click doubleClick , click                  ok     problem with dClick in IE                                   
J)   edit  doubleClick                          ok                                 
K)   edit  return  return                       ok
L)   edit  click                                ok
M)   edit  tab                                  ok
N)   click tab                                  ok
O)   click in 0,4, tab                          ok
P)   edit in 0,4,  tab                          ok
Q)   edit in last col, tab, then alt-tab 4x     ok
R)   do Q then repeat Q                         ok
S)   click in 1,1 tab to comboBox, tab, enter text    ok      
T)   edit in comboBox, navOther, navReturn            ok       
U)   edit in comboBox, clickOther, clickGrid          ok       

V)   quickly press multiple <enter>         in chrome we get spurious lostFocus and/or gained focus
      note:   turn on debug to see that when we type quickly the relatedObject is sometimes null -causing event to fire
      eg
      fast:  
            8 GridGWTEventHelper.onBrowserEvent RX JS BLUR (EDITOR,null)
               GridGWTBrowserSpecifics_typeA.handleBrowserFocusEvent                 SKIP NEXT FOCUS -> false
            9 GridGWTBrowserSpecifics_typeA.handleBrowserFocusEvent RX JS FOCUS (GRID,null)
      slow   
           8 GridGWTEventHelper.onBrowserEvent RX JS BLUR (EDITOR,GRID)
           9 GridGWTBrowserSpecifics_typeA.handleBrowserFocusEvent RX JS FOCUS (GRID,EDITOR)
       
     leaving window get
        GridGWTEventHelper.onBrowserEvent RX JS BLUR (EDITOR,null)
        GridGWTEventHelper.onBrowserEvent RX JS BLUR (EDITOR,null)
        GridGWTEventHelper.onBrowserEvent RX JS FOCUS (GRID, null)
             so could using scheduledEvent
                 start if get BLUR(EDITOR, null)
                 if next is   FOCUS(GRID, null)   cancel the event
                 if next is   BLUR(EDIT, null)   set skipNextFocus and allow ScheduledEvent
             
             
    
 also test having two grids and tabbing from one to other



*******************************************************
debug notes
*******************************************************

event sequence for double click
(MOUSEDOWN BLUR FOCUS) MOUSEUP CLICK MOUSEDOWN MOUSEUP CLICK DBLCLICK 
event sequence for single click
(MOUSEDOWN BLUR FOCUS) MOUSEUP CLICK

IN IE sequence for pressing mouse is
  BLUR FOCUS come when mouse is released  ie (mouseDown) (blur focus mouseup)
In firefox (and others?) it is
  BLUR FOCUS come with mouse down         ie (mouseDown blur focus)(mouseup)


DIFF between Chrome/FF
when user presses <ALT>  FF receives OnKeyPress   Chrome does not see note at 
					http://www.quirksmode.org/dom/events/keys.html







USEFUL DEBUG CODE

		in AcceleratorMgrGWT
        public void onPreviewNativeEvent(NativePreviewEvent p_event)
        {
            String type = "???";
            boolean emit = true;
            switch(p_event.getTypeInt())
            {
                case Event.ONMOUSEOUT:
                case Event.ONMOUSEMOVE:
                case Event.ONMOUSEOVER:
                    emit = false;
                    break;

                case Event.ONMOUSEDOWN:
                    type = "ONMOUSEDOWN";
                    break;
                case Event.ONMOUSEUP:
                    type = "ONMOUSEUP";
                    break;
                case Event.ONFOCUS:
                    type = "ONFOCUS";
                    break;
                case Event.ONBLUR:
                    type = "ONBLUR";
                    break;
                case Event.ONCLICK:
                    type = "ONCLICK";
                    break;
                case Event.ONDBLCLICK:
                    type = "ONDBLCLICK";
                    break;
                case Event.ONKEYDOWN:
                	type = "ONKEYDOWN";
                	break;
                case Event.ONKEYPRESS:
                	type = "ONKEYPRESS";
                	break;
                default:
                    type = "???/" + p_event.getTypeInt();
                    break;
            }

            if(emit)
            {
                Object source = p_event.getSource();
                String str = source == null ? "null" : source.getClass().getName();
                System.err.println("AcceleratorMgrGWT.Handler.onPreviewNativeEvent RX " + type   + " captureElement " + DOM.getCaptureElement().getClassName());   
            }

	in BasisWidgetDelegate
    public void onBrowserEvent(Event p_event)
    {
        switch(p_event.getTypeInt())
        {
            case Event.ONMOUSEOUT:
            case Event.ONMOUSEMOVE:
            case Event.ONMOUSEOVER:
                break;
            default:
                   System.err.println(" BasisWidgetDelegate.onBrowserEvent RX "
                		   	+ p_event.getType() + " on " + getEventTarget().getClass());        
        }


*******************************************************

