org.itsnat.comp.layer
Interface ItsNatModalLayer

All Superinterfaces:
ItsNatComponent, ItsNatElementComponent, ItsNatFreeComponent, ItsNatUserData

public interface ItsNatModalLayer
extends ItsNatElementComponent, ItsNatFreeComponent

Is the interface of Modal Layer components.

A modal layer is an absolute positioned element usually opaque or translucent with a z-index greater than the elements being covered and covering the complete area of the web page.

The modal layer is added as a direct child of the root element (<body> in HTML documents) added in the end. This way any mouse click is not dispatched to any covered element in the document.

By default there is no markup content contained by the modal layer, new markup can be added "on top" of the modal layer specifing a greater z-index. This new markup should be added in the end of the root element (<body> in HTML).

The component automatically removes the modal layer element when the component is disposed, markup with greater z-index should be removed before.

ItsNat default implementation supports several stacked modal layers and automatically fixes the problem of HTML SELECT elements of MSIE v6, in this case HTML SELECT elements are hidden when covered by a modal layer (stacked layers are supported too).

In Pocket IE 6 (WM 6 & 6.1) there is no support of absolute positioning and z-index, in this case covered elements are visually removed using the CSS property dispose with value "none".

If no element is provided when the component is created, the default implementation creates one used internally.

In pure SVG documents behavior is very similar to X/HTML, the main difference is z-index is ignored in SVG because z-order in SVG follows the rendering order, this order coincides with document order. More info.

In XUL documents z-index is ignored because XUL ignores the z-index CSS property. By default uses a <panel> element as layer, this element must be used as the container of any user markup shown "on top" of the layer. If popuphidden event is enabled calling ItsNatComponent.enableEventListener(String) or adding an event listener listening to the component for this event (calling ItsNatComponent.addEventListener(String,EventListener,boolean)), the component will be automatically disposed when an event is received (in XUL the popuphidden event closes the panel, by this way the component is "closed" in server too).

Author:
Jose Maria Arranz Santamaria
See Also:
ItsNatComponentManager.createItsNatModalLayer(Element,boolean,int,float,String,NameValue[]), ItsNatComponentManager.createItsNatModalLayer(Element,boolean,float,String,NameValue[]), ItsNatComponentManager.createItsNatModalLayer(Element,NameValue[])

Method Summary
 void addUnexpectedEventListener(org.w3c.dom.events.EventListener listener)
          Registers an event listener to catch events received by elements "hidden" by this modal layer.
 int getZIndex()
          Returns the z-index associated to the modal layer.
 void removeUnexpectedEventListener(org.w3c.dom.events.EventListener listener)
          Unregisters the specified event listener used for catching events received by elements "hidden" by this modal layer.
 
Methods inherited from interface org.itsnat.comp.ItsNatElementComponent
getElement, getItsNatElementComponentUI
 
Methods inherited from interface org.itsnat.comp.ItsNatComponent
addEventListener, addEventListener, addEventListener, addEventListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, disableEventListener, disableEventListener, dispose, enableEventListener, enableEventListener, getArtifact, getArtifact, getItsNatComponentManager, getItsNatComponentUI, getItsNatDocument, getNode, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, isDisposed, isEnabled, registerArtifact, removeArtifact, removeEventListener, removeEventListener, removeEventListener, removeEventListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, setEnabled, setEventListenerParams, setEventListenerParams, setNode
 
Methods inherited from interface org.itsnat.core.ItsNatUserData
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
 

Method Detail

getZIndex

int getZIndex()
Returns the z-index associated to the modal layer.

Returns:
the z-index value.

addUnexpectedEventListener

void addUnexpectedEventListener(org.w3c.dom.events.EventListener listener)
Registers an event listener to catch events received by elements "hidden" by this modal layer.

Modal layers try to be modal, in a web environment this is not fully accomplished, for instance, in desktop browsers the end user can navigate through hidden form elements and links using the TAB key, and "click" them by pressing ENTER.

This event listener may be used to alert the end user about this unwanted circumstance.

Parameters:
listener - the listener
See Also:
removeUnexpectedEventListener(EventListener)

removeUnexpectedEventListener

void removeUnexpectedEventListener(org.w3c.dom.events.EventListener listener)
Unregisters the specified event listener used for catching events received by elements "hidden" by this modal layer.

Parameters:
listener -
See Also:
addUnexpectedEventListener(EventListener)


Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.