OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adfinternal.view.js.laf.dhtml.rich
Class AdfOverflowSupport

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.laf.dhtml.rich.AdfOverflowSupport

public class AdfOverflowSupport
extends AdfObject
Support class for handling the overflow in a component.



Field Summary

private static Object
_DEPRESSED_STYLE_CLASS
private Object
_element
private Object
_firstVisibleStep
private Object
_lastVisibleStep
private Object
_orientation
private Object
_peer
private static Object
_POPUP_ID_END
private static Object
_POPUP_ID_START
private Object
_position
private Object
_steps
private Object
_type


Fields inherited from oracle.adf.view.js.base.AdfObject

constructor, superclass


Fields inherited from org.ecmascript.object.Object

prototype


Constructor Summary

public
AdfOverflowSupport(String overflowId, AdfRichUIPeer peer, Object type, Object position, Object orientation)
Support class for handling the overflow in a component.


Method Summary

public Object
addElement(HTMLElement element)
Adds an element to the last created step.
public Object
addOverflowElement(HTMLElement element)
Adds an overflow element to the last created step.
private Object
_createOverflowPopupHints()
Initializes the hints used for showing an overflow container.
public Object
createStep()
Creates a new overflow step.
public HTMLElement
createSwapPosition(HTMLElement element)
Creates a swap position for an element in the component.
private Object
_endOverflowButtonMouseOut(Event event)
Callback for when the end overflow button receives mouse out event.
private Object
_endOverflowButtonMouseUp(Event event)
Callback for when the end overflow button receives mouse over event.
private Object
_endOverflowButtonPressed(Event event)
Callback for when the end overflow button is pressed.
private HTMLElement
_getElement(String overflowId, String subString)
Returns a subElement.
public static AdfUIComponent
getOverflowChildComponents(AdfUIComponent baseComponent, Array<AdfUIComponent> children)
Returns an array of overflow child components present in either the start or end overflow containers.
public Object
handleResize()
Handles the showing and hiding of elements and corresponding overflow elements when the component is resized.
private Boolean
_hasAvailableSpace()
Checks if the element that contains overflowing elements has available space.
private Object
_hideElements(Array elements)
Shows DOMElements by giving it a style display none.
private Object
_hideEndContainer()
Callback invoked when the end contanier popup is hidden
private Object
_hideEndStep()
Hides the last visible overflow step on the end side.
private Object
_hideOverflowButtons()
If overflow buttons are currently visible (based on our step values), then change css to make them invisible.
private Object
_hideOverflowElements(Array elements, Boolean isStart)
Removes overflow elements from an overflow container.
private Object
_hideStartContainer()
Callback invoked when the start contanier popup is hidden
private Object
_hideStartStep()
Hides the last visible overflow step on the start side.
private Object
_hideStep(Object step, Boolean isStart)
Hides an overflow step.
private Boolean
_hideSteps()
Hide any steps that won't fit.
protected Object
Init(String overflowId, AdfRichUIPeer peer, Object type, Object position, Object orientation)
Initializes an AdfOverflowSupport instance.
protected static Object
InitClass()
Initializes the AdfOverflowSupport class
private Object
_initEndButtonEventHandling()
Adds eventListeners to an end overflow indicator.
private Object
_initStartButtonEventHandling()
Adds eventListeners to a start overflow indicator.
private Boolean
_isActiveStepInOverflow()
For type 'both' overflow, we also track an activeStep.
public static Boolean
needsOverflow(String overflowId)
Checks if overflow is needed.
private Object
_numberOfVisibleSteps()
Returns the number of currently visible steps
private Object
_overflowButtonPressed(Object popupId, Object popupContainer, Object popupHints)
Overflow button pressed.
private Object
_removeEndButtonCallbacks()
Removes event listeners from the end overflow indicator.
public Object
removeOverflowSupport()
Removes al callbacks and references to DOMElements that were created by the overflow support instance.
private Object
_removeStartButtonCallbacks()
Removes event listeners from the start overflow indicator.
private Object
_removeSteps()
Removes all references to DomElements from all created steps.
private Object
_setActiveStep()
Initializes the active step.
private Object
_setDepressedStyle(Object targetElement, Object depressed)
Overflow buttons use the depressed pseudo state instead of active.
private Object
_showElements(Array elements)
Shows DOMElements by removing style display none.
private Object
_showEndStep()
Shows the first overflow step on the end side that is currently not visible.
private Object
_showOverflowButtons()
If overflow buttons are needed (based on our step values), then change css to make them visible.
private Object
_showOverflowElements(Array elements, Boolean isStart)
Adds overflow elements to an overflow container.
private Object
_showStartStep()
Shows the first overflow step on the start side that is currently not visible.
private Object
_showStep(Object step, Boolean isStart)
Shows an overflow step.
private Object
_showSteps()
Show as many steps as will fit.
private Object
_startOverflowButtonMouseOut(Event event)
Callback for when the start overflow button receives mouse out event.
private Object
_startOverflowButtonMouseUp(Event event)
Callback for when the start overflow button receives mouse over event.
private Object
_startOverflowButtonPressed(Event event)
Callback for when the start overflow button is pressed.
private Object
_supportsEndOverflow(Object overflowId)
Returns true if we are supporting end overflow (overflow type end or both)
private Object
_supportsStartOverflow(Object overflowId)
Returns true if we are supporting start overflow (overflow type start or both)
private Object
_swapElements(Array elements, Boolean show)
Swaps DOMElements from their normal position, to their position in the overflow container.


Methods inherited from oracle.adf.view.js.base.AdfObject

adopt, clone, createCallback, createInitializedObject, createSubclass, ensureClassInitialization, equals, getClass, GetLazyArrayProperty, GetLazyMapProperty, getTypeName, toDebugString, toString


Field Detail


_DEPRESSED_STYLE_CLASS

private static Object _DEPRESSED_STYLE_CLASS

_element

private Object _element

_firstVisibleStep

private Object _firstVisibleStep

_lastVisibleStep

private Object _lastVisibleStep

_orientation

private Object _orientation

_peer

private Object _peer

_POPUP_ID_END

private static Object _POPUP_ID_END

_POPUP_ID_START

private static Object _POPUP_ID_START

_position

private Object _position

_steps

private Object _steps

_type

private Object _type

Constructor Detail


AdfOverflowSupport

public AdfOverflowSupport(String overflowId,
                          AdfRichUIPeer peer,
                          Object type,
                          Object position,
                          Object orientation)

Support class for handling the overflow in a component.

Parameters:
overflowId  -  The id of the element in the component that can have overflow, most of the time this is the rootElement of a component
peer  -  The peer of the component that needs overflow support
type    
position    
orientation    

Method Detail


addElement

public Object addElement(HTMLElement element)

Adds an element to the last created step. This element will be hidden if the component has not enough space to show this element. Then the corresponding overflow elements added to the same step will show up in the overflow box. If the element itself should show up in the overflow box createSwapPosition(HTMLElement) can be used. More elements can be added to one step. This method shouldn't be called if no step is created yet.

Parameters:
element  -  The element to add to the step
Return:
Object
See also:
for creating steps
for adding corresponding overflow elements

addOverflowElement

public Object addOverflowElement(HTMLElement element)

Adds an overflow element to the last created step. This overflow element will show up in the overflow box, if the component has not enough space to show the corresponding elements added to the same step. If an element that is added to the step should show up in the overflow box itself createSwapPosition(HTMLElement) can be used. More overflow elements can be added to one step. This method shouldn't be called if no step is created yet.

Parameters:
element  -  The overflow element to add to the step
Return:
Object
See also:
for adding corresponding elements

_createOverflowPopupHints

private Object _createOverflowPopupHints()

Initializes the hints used for showing an overflow container.

Return:
Object - hints for the overflow popup

createStep

public Object createStep()

Creates a new overflow step. In one step all added elements will be hidden and all added overflow elements will be placed in the overflow box. Most of the time one element and one overflow element are added to one step. But if there are elements that shouldn't be visible seperately it is possible to add them together to one step.

Return:
Object
See also:
to add an element to a step
to add an overflow element to a step

createSwapPosition

public HTMLElement createSwapPosition(HTMLElement element)

Creates a swap position for an element in the component. This is used when an element should be visible in the component if there is enough space and in the overflow box when there isn't enough space. Two swap positions are created for the element. One is inserted in the DOM just before the element. The other is returned and can be used as overflow element or inside an overflow element, that should then be added to the step with addOverflowElement(HTMLElement). These positions will be used to move the element from it's current position in the component to the position in the overflow box during overflow.

Parameters:
element  -  The element to create a swap position for
Return:
HTMLElement - the swap position for the element that can be placed in the overflow box

_endOverflowButtonMouseOut

private Object _endOverflowButtonMouseOut(Event event)

Callback for when the end overflow button receives mouse out event. Make sure depressed style is removed.

Parameters:
event  -  The event received
Return:
Object

_endOverflowButtonMouseUp

private Object _endOverflowButtonMouseUp(Event event)

Callback for when the end overflow button receives mouse over event. Make sure depressed style is removed.

Parameters:
event  -  The event received
Return:
Object

_endOverflowButtonPressed

private Object _endOverflowButtonPressed(Event event)

Callback for when the end overflow button is pressed.

Parameters:
event  -  The event received
Return:
Object

_getElement

private HTMLElement _getElement(String overflowId,
                                String subString)

Returns a subElement.

Parameters:
overflowId  -  The id of the element in the component that can have overflow
subString  -  Used to create the subId of the subElement
Return:
HTMLElement - the subElement

getOverflowChildComponents

public static AdfUIComponent getOverflowChildComponents(AdfUIComponent baseComponent,
                                                        Array<AdfUIComponent> children)

Returns an array of overflow child components present in either the start or end overflow containers.

Parameters:
baseComponent  -  (that supports overflow) to start looking from
children  -  array to store child components in. Descendent components will be added to the end of the array. This param is optional, if not passed in an array will be created.
Return:
AdfUIComponent - array of child components, may be empty

handleResize

public Object handleResize()

Handles the showing and hiding of elements and corresponding overflow elements when the component is resized. And also makes the indicators visible if needed.

Return:
Object

_hasAvailableSpace

private Boolean _hasAvailableSpace()

Checks if the element that contains overflowing elements has available space.

Return:
Boolean - true if there is available space

_hideElements

private Object _hideElements(Array elements)

Shows DOMElements by giving it a style display none. Saves the old style, so it can be restored in _showElements(Array)

Parameters:
elements  -  Array of DOMElements
Return:
Object

_hideEndContainer

private Object _hideEndContainer()

Callback invoked when the end contanier popup is hidden

Return:
Object

_hideEndStep

private Object _hideEndStep()

Hides the last visible overflow step on the end side.

Return:
Object

_hideOverflowButtons

private Object _hideOverflowButtons()

If overflow buttons are currently visible (based on our step values), then change css to make them invisible. This is done temporarily during resize so that overflow button size does not enter into our sizing calculations when figuring out what can fit before overflow.

Return:
Object

_hideOverflowElements

private Object _hideOverflowElements(Array elements,
                                     Boolean isStart)

Removes overflow elements from an overflow container.

Parameters:
elements  -  Array of DOMElements that should be removed from an overflow container
isStart  -  Indicates if elements will be removed from start container
Return:
Object

_hideStartContainer

private Object _hideStartContainer()

Callback invoked when the start contanier popup is hidden

Return:
Object

_hideStartStep

private Object _hideStartStep()

Hides the last visible overflow step on the start side.

Return:
Object

_hideStep

private Object _hideStep(Object step,
                         Boolean isStart)

Hides an overflow step.

Parameters:
step  -  The step to hide
isStart  -  Indicates if the step gets hidden on the start side
Return:
Object

_hideSteps

private Boolean _hideSteps()

Hide any steps that won't fit.

Return:
Boolean - true if at least one step was hidden

Init

protected Object Init(String overflowId,
                      AdfRichUIPeer peer,
                      Object type,
                      Object position,
                      Object orientation)

Initializes an AdfOverflowSupport instance.

Parameters:
overflowId  -  The id of the element in the component that can have overflow, most of the time this is the rootElement of a component
peer  -  The peer of the component that needs overflow support
type    
position    
orientation    
Return:
Object
Overrides:
AdfObject.Init()

InitClass

protected static Object InitClass()

Initializes the AdfOverflowSupport class

Return:
Object

_initEndButtonEventHandling

private Object _initEndButtonEventHandling()

Adds eventListeners to an end overflow indicator.

Return:
Object

_initStartButtonEventHandling

private Object _initStartButtonEventHandling()

Adds eventListeners to a start overflow indicator.

Return:
Object

_isActiveStepInOverflow

private Boolean _isActiveStepInOverflow()

For type 'both' overflow, we also track an activeStep. Returns true if the activeStep is in either start or end overflow.

Return:
Boolean - true if the activeStep is in either start or end overflow.

needsOverflow

public static Boolean needsOverflow(String overflowId)

Checks if overflow is needed. This method is called before initializing the overflow support class. This way the overflow class doesn't get initialized unnecessarry, which improves performance. This method will always return false if the Richclient is in ScreenReader mode.

Parameters:
overflowId  -  The id of the element in the component that can have overflow
Return:
Boolean - true If the element needs to overflow

_numberOfVisibleSteps

private Object _numberOfVisibleSteps()

Returns the number of currently visible steps

Return:
Object - the number of currently visible steps

_overflowButtonPressed

private Object _overflowButtonPressed(Object popupId,
                                      Object popupContainer,
                                      Object popupHints)

Overflow button pressed. If the overflow container is not currently visible, we show it. If the overflow container is currently visible, we hide it.

Parameters:
popupId    
popupContainer    
popupHints    
Return:
Object

_removeEndButtonCallbacks

private Object _removeEndButtonCallbacks()

Removes event listeners from the end overflow indicator.

Return:
Object

removeOverflowSupport

public Object removeOverflowSupport()

Removes al callbacks and references to DOMElements that were created by the overflow support instance.

Return:
Object

_removeStartButtonCallbacks

private Object _removeStartButtonCallbacks()

Removes event listeners from the start overflow indicator.

Return:
Object

_removeSteps

private Object _removeSteps()

Removes all references to DomElements from all created steps.

Return:
Object

_setActiveStep

private Object _setActiveStep()

Initializes the active step. This is the step that contains a DOMElement that is currently active and therefore should stay visible (for example an active tab).

Return:
Object

_setDepressedStyle

private Object _setDepressedStyle(Object targetElement,
                                  Object depressed)

Overflow buttons use the depressed pseudo state instead of active. This method sets the depressed style state.

Parameters:
targetElement    
depressed    
Return:
Object

_showElements

private Object _showElements(Array elements)

Shows DOMElements by removing style display none. Restoring the old style that was saved in _hideElements(Array).

Parameters:
elements  -  Array of DOMElements
Return:
Object

_showEndStep

private Object _showEndStep()

Shows the first overflow step on the end side that is currently not visible.

Return:
Object

_showOverflowButtons

private Object _showOverflowButtons()

If overflow buttons are needed (based on our step values), then change css to make them visible.

Return:
Object

_showOverflowElements

private Object _showOverflowElements(Array elements,
                                     Boolean isStart)

Adds overflow elements to an overflow container.

Parameters:
elements  -  Array of DOMElements that should be added to an overflow container
isStart  -  If true elements will be added to the start container if false elements will be added to the end container
Return:
Object

_showStartStep

private Object _showStartStep()

Shows the first overflow step on the start side that is currently not visible.

Return:
Object

_showStep

private Object _showStep(Object step,
                         Boolean isStart)

Shows an overflow step.

Parameters:
step  -  The step to show
isStart  -  Indicates if the step gets shown on the start side
Return:
Object

_showSteps

private Object _showSteps()

Show as many steps as will fit.

Return:
Object

_startOverflowButtonMouseOut

private Object _startOverflowButtonMouseOut(Event event)

Callback for when the start overflow button receives mouse out event. Make sure depressed style is removed.

Parameters:
event  -  The event received
Return:
Object

_startOverflowButtonMouseUp

private Object _startOverflowButtonMouseUp(Event event)

Callback for when the start overflow button receives mouse over event. Make sure depressed style is removed.

Parameters:
event  -  The event received
Return:
Object

_startOverflowButtonPressed

private Object _startOverflowButtonPressed(Event event)

Callback for when the start overflow button is pressed.

Parameters:
event  -  The event received
Return:
Object

_supportsEndOverflow

private Object _supportsEndOverflow(Object overflowId)

Returns true if we are supporting end overflow (overflow type end or both)

Parameters:
overflowId    
Return:
Object - true if we are supporting end overflow

_supportsStartOverflow

private Object _supportsStartOverflow(Object overflowId)

Returns true if we are supporting start overflow (overflow type start or both)

Parameters:
overflowId    
Return:
Object - true if we are supporting start overflow

_swapElements

private Object _swapElements(Array elements,
                             Boolean show)

Swaps DOMElements from their normal position, to their position in the overflow container.

Parameters:
elements  -  Array of swapElements, swapElements is an array of a three DomElements: the DomElement that needs to be swapped, and two anchor elements that indicate its normal position and its position in the overflow container
show  -  If true the DomElement gets placed on its normal position otherwise it gets placed on its position in the overflow container
Return:
Object

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Generated on 2009.04.27 01:06 UTC
Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.