|
Oracle Fusion Middleware Javascript API Reference for Oracle ADF Faces 12c (12.1.3) E41654-01 |
||||||||
PREV NEXT | FRAMES NO FRAMES Warning: private items are visible |
org.ecmascript.object.Object | +--oracle.adfinternal.view.js.laf.dhtml.rich.AdfDomUtils
public class AdfDomUtils extends Object
Field Summary |
|
---|---|
public static Object |
|
public static Object |
|
public static Object |
|
private static Object |
|
private static Object |
|
private static Object |
|
private static Object |
|
public static Object |
|
public static Object |
|
public static Object |
Fields inherited from org.ecmascript.object.Object |
constructor, prototype |
Constructor Summary |
|
---|---|
public |
|
Method Summary |
|
---|---|
public static Boolean |
|
public static Object |
|
public static Boolean |
|
public static Object |
|
private static Object |
|
public static Object |
|
public static Object |
|
static Object |
|
public static Boolean |
|
public static HTMLElement |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static Object |
|
public static HTMLElement[] |
|
public static HTMLElement |
|
private static Number |
|
public static HTMLElement |
|
public static Element |
|
public static Object |
|
public static Number |
|
public static HTMLElement |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static Object |
|
public static Object |
|
private static Object |
|
public static Object |
|
public static Object |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static Number |
|
public static Object |
|
public static Number |
|
public static number |
|
public static HTMLElement |
|
public static Object |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static HTMLElement |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static Object |
|
private static boolean |
|
private static Object |
|
public static Object |
|
public static Boolean |
|
private static Object |
|
public static HTMLElement |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static Object |
|
private static Object |
|
public static Object |
|
public static Object |
|
private static Object |
|
private static Object |
|
public static Object |
|
public static Object |
|
public static Object |
|
public static Object |
Field Detail |
---|
public static Object FILTER_ACCEPT
public static Object FILTER_REJECT
public static Object FILTER_SKIP
private static Object _HELP_WINDOW_NAME_COOKIE
private static Object _LEGAL_ATTRIBUTES
private static Object _LEGAL_ELEMENTS
private static Object _REQUIRED_ICON_PLACEHOLDER_STYLE_CLASS
public static Object TRAVERSE_DIRECTION_DOWN
public static Object TRAVERSE_DIRECTION_PARALLEL
public static Object TRAVERSE_DIRECTION_UP
Constructor Detail |
---|
public AdfDomUtils()
Method Detail |
---|
public static Boolean addCSSClassName(HTMLElement domElement,
String className)
true
if the class name was added.domElement |
- | DOM Element to add style class name to |
className |
- | Name of style class to add
Default value = null
|
Boolean
- null true
if the style class was addedpublic static Object addInlineStyle(Object element,
Object newStyle,
Object takesPrecedence)
element |
||
newStyle |
||
takesPrecedence |
Object
public static Boolean addOrRemoveCSSClassName(Boolean add,
HTMLElement domElement,
String className)
add |
- | boolean value if we should do an add of a CSS className |
domElement |
- | DOM Element to remove style class name from |
className |
- | the CSS className which should be added or removed |
Boolean
- null true
if the element's style class list changedpublic static Object canScroll(Object domNode,
Object viewPortWidth,
Object viewPortHeight)
domNode |
||
viewPortWidth |
||
viewPortHeight |
Object
private static Object _cleanElementHtml(Object node)
node |
Object
public static Object cleanHtml(Object domDocument,
Object value)
domDocument |
||
value |
Object
public static Object componentShowRequiredChanged(Object component,
Object domElement,
Object newValue,
Object oldValue)
component |
||
domElement |
||
newValue |
||
oldValue |
Object
static Object __componentTextChanged(Object component,
Object domElement,
Object newValue,
Object oldValue)
component |
||
domElement |
||
newValue |
||
oldValue |
Object
public static Boolean containsCSSClassName(HTMLElement domElement,
String className)
domElement |
- | DOM Element to check for the style className |
className |
- | the CSS className to check for |
Boolean
- null true
if the className is in the element's list of classespublic static HTMLElement depthFirstFilter(HTMLElement element,
HTMLElement rootElement,
int direction,
Function filterFunc,
Object context)
element |
- | element to begin filtering from |
rootElement |
- | The filtering is constrained to the subtree within this element. |
direction |
- | the direction of the search. Ideally, we would like to have an associated array to mark whether an element is visited or not, and what's the filter value for that element when it was first visited, thus we can decide whether to return the element as accepted, or to search my sibling or parent. But DOM element is not suitable as an key, and not every element would had id, so we use the direction value to hint us whether an element has been visited before. It is possible that the filter function is invoked twice (an associated array could avoid that) on one elment, but since we have context cache, so it's a quick lookup for the second time we visit the element. |
filterFunc |
- | A function which is used to filter a particular element. The function takes two arguments - the element to test and an optional context - and returns one of the following filter values: AdfDomUtils.FILTER_SKIP : no, I am not accepted, but one of my children could be accepted AdfDomUtils.FILTER_REJECT : no, I am not accepted, and none of my children could possibly be accepted AdfDomUtils.FILTER_ACCEPT : yes, I am accepted |
context |
- | optional context for the filter function |
HTMLElement
- The accepted element if one is found, null otherwise.public static Object fillEmptyCell(Object cell)
cell |
Object
public static Object findAccessKeyDom(Object domElement,
Object accessKeyValue)
domElement |
||
accessKeyValue |
Object
public static Object getAutoScrollDeltas(Object target,
Object clientX,
Object clientY)
target |
||
clientX |
||
clientY |
Object
public static HTMLElement getChildElementByAttributeValue(Object domElement,
Object attrName,
Object attrValue,
Object tagName)
domElement |
- | the dom element which contains child element to locate |
attrName |
- | the name of the attribute on the element |
attrValue |
- | the value of the attribute on the element |
tagName |
- | name of the tag, if undefined then tagName= |
HTMLElement
- The element with matching attribute value, or null if none existpublic static HTMLElement getChildElementByPosition(Object parentElement,
Object type,
Object position)
parentElement |
- | the parent node |
type |
||
position |
- | the node position uder its parent element |
HTMLElement
- the position if currentElement is not nullpublic static HTMLElement getChildElementByValueMap(Object domElement,
Object keyValueArray,
Object tagName)
domElement |
- | the dom element which contains child element to locate |
keyValueArray |
- | key-value array for the attribute |
tagName |
- | name of the tag, if undefined then tagName= |
HTMLElement
- The element with matching attribute value, or null if none existpublic static Object getChildElements(Object parentElement)
parentElement |
Object
public static HTMLElement[] getChildElementsByAttributeValue(Object domElement,
Object attrName,
Object attrValue,
Object tagName)
domElement |
- | the dom element which contains child elements to locate |
attrName |
- | the name of the attribute on the element |
attrValue |
- | the value of the attribute on the element |
tagName |
- | name of the tag, if undefined then tagName= |
HTMLElement[]
- Elements with matching attribute value, or null if none existpublic static HTMLElement getCommonAncestor(HTMLElement nodeA,
HTMLElement nodeB)
nodeA |
- | One of the DOM nodes to count nodes between |
nodeB |
- | One of the DOM nodes to count nodes between |
HTMLElement
- null or the common ancestor of the two nodes.private static Number _getCSSClassNameIndex(String currentClassName,
String className)
className
appears within currentClassName
with either a space or the beginning or end of currentClassName
on either side. This function optimizes the runtime speed by not creating objects in most cases and assuming 1) It is OK to only check for spaces as whitespace characters 2) It is rare for the searched className to be a substring of another className, therefore if we get a hit on indexOf, we have almost certainly found our className 3) It is even rarer for the searched className to be a substring of more than one className, therefore, repeating the search from the end of the string should almost always either return our className or the original search hit from indexOfcurrentClassName |
- | Space-separated class name string to search |
className |
- | String to search for within currentClassName |
Number
- index of className in currentClassName, or -1 if it doesn't existpublic static HTMLElement getDescendentElement(HTMLElement parentElement,
String elementName,
Number index)
parentElement |
- | The parent DOM element under which to search for the descendent. |
elementName |
- | The name of the descendent element to find (eg. "SPAN"). |
index |
- | The numeric position of the descendent element, starting with "0". For clarification, 0 is the first position, 1 is the second position, etc. |
HTMLElement
- The descendent element if one is found, otherwise null.public static Element getElement(Node node)
node |
- | the node to get the element for |
Element
- the closest elementpublic static Object getElementAtPoint(Object element,
Object pageX,
Object pageY,
Object closestMatch)
element |
||
pageX |
||
pageY |
||
closestMatch |
Object
public static Number getElementDepth(HTMLElement element)
element |
- | the element whose depth is returned |
Number
- the number of nodes deep in the DOM treepublic static HTMLElement getElementPosition(Object currentElement)
currentElement |
- | the current node |
HTMLElement
- the position if currentElement is not nullpublic static Object getElementsByClassName(Object domNode,
Object className)
domNode |
||
className |
Object
public static Object getFirstChildElement(Object parentElement)
parentElement |
Object
public static Object getFirstChildNodeByType(Object parentElement,
Object type)
parentElement |
||
type |
Object
public static HTMLElement getFirstDescendentElement(HTMLElement parentElement,
String elementName)
parentElement |
- | The parent DOM element under which to search for the descendent. |
elementName |
- | The name of the descendent element to find (eg. "SPAN"). |
HTMLElement
- The descendent element if one is found, otherwise null.public static HTMLElement getFirstElementByTagName(Object domElement,
Object tagName)
domElement |
||
tagName |
HTMLElement
- the DOM within the component related to scopedIdpublic static HTMLElement getFirstElementMatch(HTMLElement element,
Boolean isExclusive,
Function matchFunc,
Object context)
element |
- | element to begin searching from |
isExclusive |
- | Whether to include provided element in the search |
matchFunc |
- | A function which is used to test whether a particular element is a match. The function takes a single argument - the element to test - and returns a boolean indicating whether the element is a match. |
context |
- | optional context for the match function |
HTMLElement
- The first matching element if one is found, null otherwise.public static HTMLElement getFirstFilteredElement(HTMLElement element,
Boolean isExclusive,
Function filterFunc,
Object context)
element |
- | element to begin filtering from |
isExclusive |
- | Whether to exclude the provided element in the filtering |
filterFunc |
- | A function which is used to filter a particular element. The function takes two arguments - the element to test and an optional context - and returns one of the following filter values: AdfDomUtils.FILTER_SKIP : no, I am not accepted, but one of my children could be accepted AdfDomUtils.FILTER_REJECT : no, I am not accepted, and none of my children could possibly be accepted AdfDomUtils.FILTER_ACCEPT : yes, I am accepted |
context |
- | optional context for the filter function |
HTMLElement
- The first accepted element if one is found, null otherwise.public static Object getFormElement(Object node)
node |
Object
public static Object getFormElementValue(HTMLElement formElement,
String formElementName)
formElement |
- | the FORM element |
formElementName |
- | The name of the form element to get the value of. |
Object
private static Object _getHelpWindowName()
Object
public static Object getInputFileForm(Object actionForm)
actionForm |
Object
public static Object getLastChildElement(Object parentElement)
parentElement |
Object
public static HTMLElement getLastElementMatch(HTMLElement element,
Boolean isExclusive,
Function matchFunc,
Object context)
element |
- | element to begin searching from |
isExclusive |
- | Whether to include provided element in the search |
matchFunc |
- | A function which is used to test whether a particular element is a match. The function takes a single argument - the element to test - and returns a boolean indicating whether the element is a match. |
context |
- | optional context for the match function |
HTMLElement
- The last matching element if one is found, null otherwise.public static HTMLElement getLastFilteredElement(HTMLElement element,
Boolean isExclusive,
Function filterFunc,
Object context)
element |
- | element to begin filtering from |
isExclusive |
- | Whether to exclude provided element in the search |
filterFunc |
- | A function which is used to filter a particular element. The function takes two arguments - the element to test and an optional context - and returns one of the following filter values: AdfDomUtils.FILTER_SKIP : no, I am not accepted, but one of my children could be accepted AdfDomUtils.FILTER_REJECT : no, I am not accepted, and none of my children could possibly be accepted AdfDomUtils.FILTER_ACCEPT : yes, I am accepted |
context |
- | optional context for the filter function |
HTMLElement
- The last accepted element if one is found, null otherwise.public static HTMLElement getNextElement(Object currentElement)
currentElement |
- | the current node |
HTMLElement
- the nex sibiling element if found or null if notpublic static HTMLElement getNextElementMatch(HTMLElement element,
HTMLElement contextElement,
Boolean isExclusive,
Function matchFunc,
Object context)
element |
- | element to begin searching from |
contextElement |
- | The search is constrained to the subtree within the this element. If no context element is specified, the root document element is treated as the context element. |
isExclusive |
- | Whether to include the children of the provided element in the search.
Default value = false
|
matchFunc |
- | A function which is used to test whether a particular element is a match. The function takes a single argument - the element to test - and returns a boolean indicating whether the element is a match. |
context |
- | optional context for the match function |
HTMLElement
- The next matching element if one is found, null otherwise.public static HTMLElement getNextFilteredElement(HTMLElement element,
HTMLElement contextElement,
Boolean isExclusive,
Function filterFunc,
Object context)
element |
- | element to begin filtering from |
contextElement |
- | The filtering is constrained to the subtree within this element. If no context element is specified, the root document element is treated as the context element. |
isExclusive |
- | Whether to exclude the children of the provided element in the filtering.
Default value = false
|
filterFunc |
- | A function which is used to filter a particular element. The function takes two arguments - the element to test and an optional context - and returns one of the following filter values: AdfDomUtils.FILTER_SKIP : no, I am not accepted, but one of my children could be accepted AdfDomUtils.FILTER_REJECT : no, I am not accepted, and none of my children could possibly be accepted AdfDomUtils.FILTER_ACCEPT : yes, I am accepted |
context |
- | optional context for the filter function |
HTMLElement
- The next accepted element if one is found, null otherwise.public static Number getNodeDistance(HTMLElement nodeA,
HTMLElement nodeB)
nodeA |
- | One of the DOM nodes to count nodes between |
nodeB |
- | One of the DOM nodes to count nodes between |
Number
- zero if equal, the number of nodes between them, or Number.POSITIVE_INFINITY if the nodes are not connected.public static Object getNodeInfo(Object domNode)
domNode |
Object
public static Number getNonWhitespaceChildCount(HTMLElement parentElement)
parentElement |
- | the node whose children we want to count |
Number
- the number of child elements and non-whitespace text nodespublic static number getOffsetSizeFromCssLength(HTMLElement container,
string cssLength)
container |
- | the container used to evaluate the offset |
cssLength |
- | the length to convert (it is invalid to specify a percentage value or "auto") |
number
- the number of pixels that the length converts to; if an invalid cssLength was provided, the result may be unreliablepublic static HTMLElement getOnlyChildElement(HTMLElement parentElement)
parentElement |
- | the node whose children we want to retrieve the sole child from |
HTMLElement
- the only child element or null if 0 or more than 1 displayed child is foundpublic static Object getParentWithAttr(Object rootElement,
Object startElement,
Object attr)
rootElement |
- | {HTMLElement} the root element where the walk up parent hierarchy stops |
startElement |
- | {HTMLElement} the element where we start the walk up the parent hierarchy |
attr |
- | {string} the attribute to check for |
Object
- the element with matching element found, or null if not foundpublic static HTMLElement getPreviousElement(Object currentElement)
currentElement |
- | the current node |
HTMLElement
- the previous sibling element if found or null if notpublic static HTMLElement getPreviousElementMatch(HTMLElement element,
HTMLElement contextElement,
Function matchFunc,
Object context)
element |
- | element to begin searching from |
contextElement |
- | The search is constrained to the subtree within the this element. If no context element is specified, the root document element is treated as the context element. |
matchFunc |
- | A function which is used to test whether a particular element is a match. The function takes a single argument - the element to test - and returns a boolean indicating whether the element is a match. |
context |
- | optional context for the match function |
HTMLElement
- The previous matching element if one is found, null otherwise.public static HTMLElement getPreviousFilteredElement(HTMLElement element,
HTMLElement contextElement,
Function filterFunc,
Object context)
element |
- | element to begin filtering from |
contextElement |
- | The filtering is constrained to the subtree within this element. If no context element is specified, the root document element is treated as the context element. |
filterFunc |
- | A function which is used to filter a particular element. The function takes two arguments - the element to test and an optional context - and returns one of the following filter values: AdfDomUtils.FILTER_SKIP : no, I am not accepted, but one of my children could be accepted AdfDomUtils.FILTER_REJECT : no, I am not accepted, and none of my children could possibly be accepted AdfDomUtils.FILTER_ACCEPT : yes, I am accepted |
context |
- | optional context for the filter function |
HTMLElement
- The previous accepted element if one is found, null otherwise.public static Object getRelativePosition(Object elem)
elem |
Object
- an object with two properties (x for the left coordinate and y for the top coordinate)public static Object getTabIndex(Object element)
element |
- | the element to get the property for |
Object
- the tab index, if specified otherwise undefinedpublic static Object handleTextChangeWithAccessKey(Object component,
Object domElement,
Object newValue)
component |
- | The component that the text changed for |
domElement |
- | The element that renders the text value for this component (not necessarily the root element for the component) |
newValue |
- | The new text value for the component |
Object
- true if the value was able to be setpublic static Object isAncestor(Object ancestorNode,
Object node)
ancestorNode |
||
node |
Object
public static Object isAncestorOrSelf(Object ancestorNode,
Object node)
ancestorNode |
||
node |
Object
public static Object isInVisibleSubtree(Object node)
node |
Object
public static Object isMultiPartForm(Object formElement)
formElement |
Object
public static Object isNodeInDocumentHierarchy(Object domDocument,
Object node)
node
is in the domDocument
's hierarchydomDocument |
||
node |
Object
public static Object isVisible(Object domElement)
domElement |
Object
public static Object launchHelpWindow(Object url)
url |
- | The url that should be displayed in the help window. |
Object
private static boolean _matchRequiredIconSpan(HTMLElement element)
element |
- | searched on |
boolean
- null true
if the element is a span that's assigned the "p_rqi" style classprivate static Object _removeAccessKeyElement(Object domElement,
Object accessKeyElement)
domElement |
||
accessKeyElement |
Object
public static Object removeAllNodes(HTMLElement element)
element |
- | the DOM element whose children will be removed |
Object
public static Boolean removeCSSClassName(HTMLElement domElement,
String className)
true
if the class name was removed.domElement |
- | DOM Element to remove style class name from |
className |
- | Name of style class to remove
Default value = null
|
Boolean
- null true
if the style class was removedprivate static Object _removeSiblings(Object domElement)
domElement |
Object
public static HTMLElement reverseDepthFirstFilter(HTMLElement element,
HTMLElement rootElement,
int direction,
Function filterFunc,
Object context)
element |
- | element to begin filtering from |
rootElement |
- | The filtering is constrained to the subtree within this element. |
direction |
- | the direction of the search. Ideally, we would like to have an associated array to mark whether an element is visited or not, and what's the filter value for that element when it was first visited, thus we can decide whether to return the element as accepted, or to search my sibling or parent. But DOM element is not suitable as key, and not every element would had id, so we use the direction value to hint us whether an element has been visited before. It is possible that the filter function is invoked twice (an associated array could avoid that), but since we have context cache, so it's a quick lookup for the second time we visit the element. |
filterFunc |
- | A function which is used to filter a particular element. The function takes two arguments - the element to test and an optional context - and returns one of the following filter values: AdfDomUtils.FILTER_SKIP : no, I am not accepted, but one of my children could be accepted AdfDomUtils.FILTER_REJECT : no, I am not accepted, and none of my children could possibly be accepted AdfDomUtils.FILTER_ACCEPT : yes, I am accepted |
context |
- | optional context for the filter function |
HTMLElement
- The accepted element if one is found, null otherwise.public static Object scrollChildIntoViewY(HTMLElement childElement)
childElement |
- | The child element to bring into view |
Object
public static Object scrollDownBy(Object domElement,
Object deltaY)
domElement |
||
deltaY |
Object
public static Object scrollRightBy(Object domElement,
Object deltaX)
domElement |
||
deltaX |
Object
public static Object setAccessibleState(Object component,
Object state)
component |
||
state |
Object
private static Object _setHelpWindowName(Object windowName)
windowName |
Object
public static Object setScrollLeft(Object domElement,
Object newScrollLeft)
domElement |
||
newScrollLeft |
Object
public static Object setScrollTop(Object domElement,
Object newScrollTop)
domElement |
||
newScrollTop |
Object
private static Object _setTextAndAccessKeySpan(Object component,
Object domElement,
Object accessKeyValue,
Object accessKeySpan,
Object newValue)
component |
||
domElement |
||
accessKeyValue |
||
accessKeySpan |
||
newValue |
Object
private static Object _setTextContent(Object domElement,
Object value)
domElement |
||
value |
Object
public static Object setVisible(Object domElement,
Object visible)
domElement |
||
visible |
Object
public static Object stripScripts(Object domElement)
domElement |
Object
public static Object suppressActionLinkBrowserContextMenu(AdfUIInputEvent componentContextMenuEvent)
componentContextMenuEvent |
- | The component context menu event |
Object
public static Object swapIcon(HTMLElement originalIcon,
String iconKey)
originalIcon |
- | the original icon dom element that you want swapped out. The originalIcon must have a parent node in order to be replaced. |
iconKey |
- | Key used to identify this icon |
Object
|
Oracle Fusion Middleware Javascript API Reference for Oracle ADF Faces 12c (12.1.3) E41654-01 |
||||||||
PREV NEXT | FRAMES NO FRAMES Warning: private items are visible |