AdfAutoDismissallManager keeps track of all visible popups that have some form of autodismiss behavior. When a popup is shown, by calling somePeer.showPopup(component, contentDom, hints), the Id of the component is pushed onto a stack (except for popups with a AUTO_DISMISS_NEVER hint). The component is then said to be the 'owner' or the 'spawner' of the popup. The reason why the datastructure is a stack is that you might want to have one popup spawn the next, which are then opened and closed in recursive fashion. (see: AdfAutoDismissallManager.addBehavior() and AdfAutoDismissallManager._addComponent() ) However, just before the requested popup has it's owner's ID pushed onto the stack, the AutoDismissalManager unwinds the stack to close any other open popups, i.e. they are auto-dismissed one-by-one, unless the event target was inside the popup DOM or unless some special condition is true. (see: AdfAutoDismissallManager.popUntilAncestorFound) This, w/o the special condition, is the default autodismiss behavior (i.e. AUTO_DISMISS_ALWAYS) but sometimes you want to make an exception, i.e. not dismiss, as for instance, in the case of menus. A submenu should't be dismissed if the item that spawned it is clicked. This is exactly what AUTO_DISMISS_MENU does. So to summarize the distinction: - AUTO_DISMISS_ALWAYS: dismiss unless event target was inside the popup DOM - AUTO_DISMISS_MENU: dismiss unless the event target was inside the popup DOM or the event target was inside the owner's DOM.
Method Summary
|
public Object |
addBehavior(Object component, Object hints)
-
Registers a component with the autoDismissalManager, to give it specific dismissal behavior.
|
private Object |
_addComponent(Object component, Object type, Object hints)
-
Adds the component to the stack and removes (invokes dismissal) of non-ancestors.
|
public Object |
cancelBlurTimeout()
-
Cancels the _dismissBlurringElement timeout.
|
private Boolean |
_cancelDismissal(HTMLElement target, Object stackedObj)
-
Inspects the event target and the registered component information to determine if dismissal should be invoked.
|
private Object |
_cancelTimeoutDismissalBehavior(Number index)
-
A popup dismissal behavior for the noteWindow.
|
public Object |
changeBehavior(Object component, Object hints)
-
Changes the dismissal behavior of a component.
|
public Object |
closeAll()
-
Closes all popups that were managed.
|
public Object |
dismiss(HTMLElement target)
-
Iterate over the components under dismissal management.
|
private static Object |
_dismissBlurringElement(Object state)
-
Timed callback invoked from the _handleBlur handler.
|
private Object |
_dismissOnMouseOver(Object target)
-
Invoked by the _handleMouseOverTimeout when catching a mouse over event.
|
public Object |
dispose()
-
Disposes the AdfDhtmlAutoDismissalManager instance.
|
public Number |
getBehaviorCount()
|
private AdfUIComponent |
_getContainingComponent(Object domElement)
-
For a domElement, return the containing component, if present
|
private Object |
_handleBlur(Object evt)
-
Handler is registered for Firefox.
|
private Object |
_handleFocusIn(Object evt)
-
Handles the focus in event (IE) specific if the target dom node is a IFRAME.
|
private Object |
_handleKeyUp(Object evt)
-
Invokes dismiss if the event has a source and target dom element and the TAB key was pressed.
|
private Object |
_handleMouseDown(Object evt)
-
Invokes dismiss if the event has a target and source element.
|
private Object |
_handleMouseOver(Object evt)
-
Invokes the _handleMouseOverTimeout event to handle the event in 300 ms.
|
private static Object |
_handleMouseOverTimeout(Object state)
-
Called by _handleMouseOver in a 300 ms timed event.
|
public Object |
hasComponent(Object component)
|
public Object |
hasComponents()
|
private Object |
_hideComponentPopups(Object component)
-
Hides the target component with a cancel status.
|
private Object |
_hideDismissalBehavior(Number index)
-
A popup dismissal behavior for most types of popups.
|
private Object |
_inactivateDismissalBehavior(Number index)
-
A popup dismissal behavior for dialogs and panelWindows only.
|
protected Object |
Init()
-
Initializes the AdfDhtmlAutoDismissalManager instance.
|
private Boolean |
_isComponentAncestor(Object ancestorClientId, Object component)
-
Returns true if the provided ancestorClientId is for an ancestor of the provided component
|
private Boolean |
_isTargetInOwner(HTMLElement target, Object popupOwner)
|
private Object |
_isTargetInPopup(HTMLElement target, Object popupList)
-
Returns true if the target is in the list of popups
|
private Boolean |
_popupUnderneathGlassPane(Object popupList)
|
private Object |
_registerEventHandlers()
-
Registers the keyup, mousedown, focusin, blur and mouseover listeners attached to the document or the window.
|
public Object |
removeBehavior(Object component)
-
Unregisters a component from the autoDismissalManager and dismisses it.
|
private static Object |
_timeoutDismissalBehavior(Object state)
-
Called for the AdfDhtmlPopupWindow.HINT_AUTODISMISS_TIMEOUT behavior.
|
private Object |
_undismissDueToActiveIframe(HTMLElement activeElement)
-
Invoked by the _dismissBlurringElement when catching a dismiss from a user moving focus into an iframe (e.g.
|
private Object |
_unregisterEventHandlers()
-
Unregisters the keyup, mousedown, focusin, blur and mouseover listeners attached to the document or the window.
|