public FocusRequest grant( Component component ){ if( component.isFocusable() ){ component.requestFocus(); component.requestFocusInWindow(); return new RepeatingFocusRequest( dockable, component, isHardRequest() ); } else if( mouseClicked == null || mouseClicked == dockable.getComponent() ){ KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent( component ); } else{ mouseClicked.requestFocus(); mouseClicked.requestFocusInWindow(); return new RepeatingFocusRequest( dockable, mouseClicked, isHardRequest() ); } return null; } }
public FocusRequest grant( Component component ){ Dockable dockable = getDockable(); if( dockable != null ){ if( ensureFocusSet || ensureDockableFocused ){ return new EnsuringFocusRequest( dockable, ensureDockableFocused, component ); } } if( component == null && controller != null ){ Window root = controller.getRootWindowProvider().searchWindow(); if( root != null ){ // if another dockable gains the focus, then it is going to do that // before this request gets even processed. So this is a backup // executed to ensure that the application does not lose focus return new RepeatingFocusRequest( null, root, isHardRequest() ); } } return null; } }