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 overflow layout for a component. Note that if you use AdfOverflowSupport, you will need to call removeOverflowSupport from your component's ComponentRemoved method. The call to removeOverflowSupport should be before cleaning up any overflow elements, as removeOverflowSupport will be removing any components that were currently in an overflow popup when the parent component was removed.



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 overflow layout for a component.


Method Summary

public Object
addDropListElements(Array elementArray)
For overflow supporting a droplist, add the elements to display in the droplist popup.
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 Boolean
_binarySearchAdjustSteps(Object hasAvailableSpace, Object availableWidth, Object availableHeight, Object lowerRange, Object upperRange)
Binary search when removing/adding items to overflow to maximize performance.
private Object
_closeOverflowPopups()
Close overflow popups
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 up event.
private Object
_endOverflowButtonPressed(Event event)
Callback for when the end overflow button is pressed.
private Integer
_getAvailableHeight()
Get the available height.
private Integer
_getAvailableWidth()
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 Object
_handleResizeTypeBoth(Object availableWidth, Object availableHeight)
Handles the showing and hiding of elements for type both overflow.
private Boolean
_hasAvailableSpace(Object availableWidth, Object availableHeight)
Checks if the element that contains overflowing elements has available space.
private Object
_hideAllSteps()
Hide all steps, regardless if there's actually room for them.
private Object
_hideElements(Array elements)
Hides DOMElements by giving them 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
_hideOneStep()
Hide one step.
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(Object availableWidth, Object availableHeight, Object hasAvailableSpace)
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.
public Object
removeAllItemsFromOverflow()
Remove all items from overflow, regardingless of the current size.
private Object
_removeEndButtonCallbacks()
Removes event listeners from the end overflow indicator.
public Object
removeOverflowSupport(Object ignoreOverflowComponentCleanup)
Removes all 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(HTMLElement targetElement, Boolean depressed)
Overflow buttons use the depressed pseudo state instead of active.
private Object
_showAllSteps()
Show all steps, regardless if there's actually room for them.
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
_showOneStep()
Show one step.
private Object
_showOverflowButtons(Object force)
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 Boolean
_showSteps(Object availableWidth, Object availableHeight, Object hasAvailableSpace)
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
_supportsBothOverflow()
Returns true if we are supporting both overflow (overflow type both or droplist)
private Object
_supportsDroplist()
Returns true if we are supporting droplist button
private Object
_supportsEndOverflow()
Returns true if we are supporting end overflow (overflow type end or both)
private Object
_supportsStartOverflow()
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, exportPrototypeSymbol, 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 overflow layout for a component. Note that if you use AdfOverflowSupport, you will need to call removeOverflowSupport from your component's ComponentRemoved method. The call to removeOverflowSupport should be before cleaning up any overflow elements, as removeOverflowSupport will be removing any components that were currently in an overflow popup when the parent component was removed.

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


addDropListElements

public Object addDropListElements(Array elementArray)

For overflow supporting a droplist, add the elements to display in the droplist popup.

Parameters:
elementArray  -  an array of elements to display in the overflow droplist popup.
Return:
Object

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

_binarySearchAdjustSteps

private Boolean _binarySearchAdjustSteps(Object hasAvailableSpace,
                                         Object availableWidth,
                                         Object availableHeight,
                                         Object lowerRange,
                                         Object upperRange)

Binary search when removing/adding items to overflow to maximize performance. This method determines within 1 how many steps should be displayed, so that when done it can rejoin the normal show/remove step algorithm.

Parameters:
hasAvailableSpace    
availableWidth    
availableHeight    
lowerRange    
upperRange    
Return:
Boolean - Last calculated has available space value

_closeOverflowPopups

private Object _closeOverflowPopups()

Close overflow popups

Return:
Object

_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 up 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

_getAvailableHeight

private Integer _getAvailableHeight()

Get the available height. A 5px addition allows for the overlap pixels used by simple border tabs.

Return:
Integer - the height of the element + a grace value of 5px.

_getAvailableWidth

private Integer _getAvailableWidth()

Return:
Integer - the width of the element + a grace value of 3px

_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 overflow indicators visible if needed.

Return:
Object

_handleResizeTypeBoth

private Object _handleResizeTypeBoth(Object availableWidth,
                                     Object availableHeight)

Handles the showing and hiding of elements for type both overflow.

Parameters:
availableWidth    
availableHeight    
Return:
Object

_hasAvailableSpace

private Boolean _hasAvailableSpace(Object availableWidth,
                                   Object availableHeight)

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

Parameters:
availableWidth    
availableHeight    
Return:
Boolean - true if there is available space

_hideAllSteps

private Object _hideAllSteps()

Hide all steps, regardless if there's actually room for them.

Return:
Object

_hideElements

private Object _hideElements(Array elements)

Hides DOMElements by giving them 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

_hideOneStep

private Object _hideOneStep()

Hide one step. For use by start or end type overflow containers.

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(Object availableWidth,
                           Object availableHeight,
                           Object hasAvailableSpace)

Hide any steps that won't fit.

Parameters:
availableWidth    
availableHeight    
hasAvailableSpace    
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. This could include items that don't actually switch into overflow, like group separators, breadcrumb dividers, etc.

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

removeAllItemsFromOverflow

public Object removeAllItemsFromOverflow()

Remove all items from overflow, regardingless of the current size. This is useful when overflow needs to be undone for calculations of preferred size.

Return:
Object

_removeEndButtonCallbacks

private Object _removeEndButtonCallbacks()

Removes event listeners from the end overflow indicator.

Return:
Object

removeOverflowSupport

public Object removeOverflowSupport(Object ignoreOverflowComponentCleanup)

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

Parameters:
ignoreOverflowComponentCleanup    
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(HTMLElement targetElement,
                                  Boolean depressed)

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

Parameters:
targetElement  -  the dom element to set the style on
depressed  -  the new depressed state
Return:
Object

_showAllSteps

private Object _showAllSteps()

Show all steps, regardless if there's actually room for them.

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

_showOneStep

private Object _showOneStep()

Show one step. For use by start or end type overflow containers.

Return:
Object

_showOverflowButtons

private Object _showOverflowButtons(Object force)

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

Parameters:
force    
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 Boolean _showSteps(Object availableWidth,
                           Object availableHeight,
                           Object hasAvailableSpace)

Show as many steps as will fit.

Parameters:
availableWidth    
availableHeight    
hasAvailableSpace    
Return:
Boolean - final has available space value

_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

_supportsBothOverflow

private Object _supportsBothOverflow()

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

Return:
Object - true if we are supporting both overflow

_supportsDroplist

private Object _supportsDroplist()

Returns true if we are supporting droplist button

Return:
Object - true if we are supporting droplist button

_supportsEndOverflow

private Object _supportsEndOverflow()

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

Return:
Object - true if we are supporting end overflow

_supportsStartOverflow

private Object _supportsStartOverflow()

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

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 2014.03.27 12:59 UTC
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.