public boolean validate( FocusController controller ){ this.controller = controller.getController(); if( force ){ return true; } return controller.getFocusedDockable() != getDockable(); }
/** * Tries to find the Dockable which owns <code>component</code> * and sets this Dockable to the focusedDockable. The method * only succeeds if no veto-listener reacts. * @param component the component whose dockable parent is to set * focused * @param event the event that causes this check */ protected void check( Component component, AWTEvent event ){ check( component, true, false, event ); }
/**d * Removes a listener from this controller. * @param listener the listener to remove */ public void removeDockableFocusListener( DockableFocusListener listener ){ focusController.removeDockableFocusListener( listener ); }
/** * This method may be called at any time by any component that received * the {@link MouseEvent} <code>event</code>. This observer may transfer the * focus because of this call.<br> * If this application runs in a {@link DockController#isRestrictedEnvironment() restricted environment} * than any {@link DockStation} of this framework will call this method. * @param event the event to check */ public void check( MouseEvent event ){ if( interact( event )){ check( (AWTEvent)event ); } }
/** * Creates a new focus tracker. * @param root the root container whose children can be focused */ public FocusTracker( Component root ){ this.root = root; add( root ); }
/** * Tells whether the focusable {@link Component} <code>component</code> should be treated like a non-focusable * <code>Component</code>. * @param component some focusable component which may get the focus * @param request information about the item that gains the focus * @return <code>true</code> if <code>component</code> should be treated as if it were not focusable */ protected boolean excluded( Component component, FocusStrategyRequest request ){ return request.excluded( component ); }
/** * Removes any listeners this {@link FocusTracker} added anywhere allowing this {@link FocusTracker} * to be collected by the garbage collector. */ public void destroy(){ remove( root ); }
/** * Adds a listener to this controller, the listener will be informed when * the focused {@link Dockable} changes. * @param listener the new listener */ public void addDockableFocusListener( DockableFocusListener listener ){ focusController.addDockableFocusListener( listener ); }
public boolean excluded( Component component ){ return !request.acceptable( component ); } });
/** * Tells whether one of the methods which change the focus is currently * running, or not. If the result is <code>true</code>, no-one should * change the focus. * @return <code>true</code> if the focus is currently changing */ public boolean isOnFocusing() { return focusController.isOnFocusing(); }
/** * Starts a request to set the focused {@link Dockable}. * @param request the request to execute, not <code>null</code> */ public void setFocusedDockable( FocusRequest request ){ focusController.focus( request ); }
/** * Ensures that a title or a {@link Component} of the currently * {@link #getFocusedDockable() focused Dockable} really * has the focus. */ public void ensureFocusSet(){ focusController.ensureFocusSet( false ); }
/** * Gets the {@link Dockable} which is currently focused. * @return the focused element or <code>null</code> */ public Dockable getFocusedDockable() { return focusController.getFocusedDockable(); }
/** * Tries to find the Dockable which owns <code>component</code> * and sets this Dockable to the focusedDockable. The method * only succeeds if no veto-listener reacts. * @param component the component whose dockable parent is to set * focused * @param event the event that causes this check */ protected void check( Component component, AWTEvent event ){ check( component, true, false, event ); }
/** * Creates a new focus tracker. * @param root the root container whose children can be focused */ public FocusTracker( Component root ){ this.root = root; add( root ); }
/** * Tells whether the focusable {@link Component} <code>component</code> should be treated like a non-focusable * <code>Component</code>. * @param component some focusable component which may get the focus * @param request information about the item that gains the focus * @return <code>true</code> if <code>component</code> should be treated as if it were not focusable */ protected boolean excluded( Component component, FocusStrategyRequest request ){ return request.excluded( component ); }
/** * Removes any listeners this {@link FocusTracker} added anywhere allowing this {@link FocusTracker} * to be collected by the garbage collector. */ public void destroy(){ remove( root ); }
public void mouseExited( MouseEvent e ){ check( e ); } }