org.apache.batik.bridge

Class FocusManager

public class FocusManager extends Object

A class that manages focus on elements.
Nested Class Summary
protected classFocusManager.DOMFocusInTracker
The class that is responsible for tracking 'DOMFocusIn' changes.
protected classFocusManager.DOMFocusOutTracker
The class that is responsible for tracking 'DOMFocusOut' changes.
protected classFocusManager.MouseClickTracker
The class that is responsible for tracking 'mouseclick' changes.
protected classFocusManager.MouseOutTracker
The class that is responsible to update the focus according to 'mouseout' event.
protected classFocusManager.MouseOverTracker
The class that is responsible to update the focus according to 'mouseover' event.
Field Summary
protected Documentdocument
The document.
protected EventListenerdomFocusInListener
The EventListener that tracks 'DOMFocusIn' events.
protected EventListenerdomFocusOutListener
The EventListener that tracks 'DOMFocusOut' events.
protected EventTargetlastFocusEventTarget
The element that has the focus so far.
protected EventListenermouseclickListener
The EventListener that tracks 'mouseclick' events.
protected EventListenermouseoutListener
The EventListener that tracks 'mouseout' events.
protected EventListenermouseoverListener
The EventListener that tracks 'mouseover' events.
Constructor Summary
FocusManager(Document doc)
Constructs a new FocusManager for the specified document.
Method Summary
protected voidaddEventListeners(Document doc)
Adds the event listeners to the document.
voiddispose()
Removes all listeners attached to the document and that manage focus.
protected voidfireDOMActivateEvent(EventTarget target, int detailArg)
Fires a 'DOMActivate' event to the specified target.
protected voidfireDOMFocusInEvent(EventTarget target, EventTarget relatedTarget)
Fires a 'DOMFocusIn' event to the specified target.
protected voidfireDOMFocusOutEvent(EventTarget target, EventTarget relatedTarget)
Fires a 'DOMFocusOut' event to the specified target.
EventTargetgetCurrentEventTarget()
Returns the current element that has the focus or null if any.
protected voidremoveEventListeners(Document doc)
Removes the event listeners from the document.

Field Detail

document

protected Document document
The document.

domFocusInListener

protected EventListener domFocusInListener
The EventListener that tracks 'DOMFocusIn' events.

domFocusOutListener

protected EventListener domFocusOutListener
The EventListener that tracks 'DOMFocusOut' events.

lastFocusEventTarget

protected EventTarget lastFocusEventTarget
The element that has the focus so far.

mouseclickListener

protected EventListener mouseclickListener
The EventListener that tracks 'mouseclick' events.

mouseoutListener

protected EventListener mouseoutListener
The EventListener that tracks 'mouseout' events.

mouseoverListener

protected EventListener mouseoverListener
The EventListener that tracks 'mouseover' events.

Constructor Detail

FocusManager

public FocusManager(Document doc)
Constructs a new FocusManager for the specified document.

Parameters: doc the document

Method Detail

addEventListeners

protected void addEventListeners(Document doc)
Adds the event listeners to the document.

dispose

public void dispose()
Removes all listeners attached to the document and that manage focus.

fireDOMActivateEvent

protected void fireDOMActivateEvent(EventTarget target, int detailArg)
Fires a 'DOMActivate' event to the specified target.

Parameters: target the event target detailArg the detailArg parameter of the event

fireDOMFocusInEvent

protected void fireDOMFocusInEvent(EventTarget target, EventTarget relatedTarget)
Fires a 'DOMFocusIn' event to the specified target.

Parameters: target the newly focussed event target relatedTarget the previously focussed event target

fireDOMFocusOutEvent

protected void fireDOMFocusOutEvent(EventTarget target, EventTarget relatedTarget)
Fires a 'DOMFocusOut' event to the specified target.

Parameters: target the previously focussed event target relatedTarget the newly focussed event target

getCurrentEventTarget

public EventTarget getCurrentEventTarget()
Returns the current element that has the focus or null if any.

removeEventListeners

protected void removeEventListeners(Document doc)
Removes the event listeners from the document.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.