Last updated

API / geotoolkit / report / dom / Element / Element

Class: Element

dom.Element.Element

Element is an interface from which various types of DOM API objects inherit, allowing those types to be treated similarly; for example, inheriting the same set of methods, or being testable in the same way.

Hierarchy

Implements

Table of contents

Constructors
Accessors
Methods
Css Properties
Name Type Description
cssclassstringCss class

Contents

Constructors

new Element(options)

new Element(options)

Parameters

Name Type
optionsOptions

Overrides

Node.constructor

Accessors

attributes

get attributes(): NamedItemMap

Node attributes

Name

module:geotoolkit/report/dom/Node~Node#attributes

Returns

NamedItemMap

Inherited from

Node.attributes


childNodes

get childNodes(): NodeList<Node>

The element holding the item.

Name

module:geotoolkit/report/dom/Node~Node#childNodes

Returns

NodeList<Node>

Inherited from

Node.childNodes


children

get children(): NodeList<Element>

The children property returns a collection of an element's child elements, as an NodeList object.

Name

module:geotoolkit/report/dom/Element~Element#children

Returns

NodeList<Element>


data

get data(): string

Node data

Name

module:geotoolkit/report/dom/Node~Node#data

Returns

string

Inherited from

Node.data

set data(data): void

Node data

Name

module:geotoolkit/report/dom/Node~Node#data

Parameters

Name Type
datastring

Returns

void

Inherited from

Node.data


firstChild

get firstChild(): Node

First child node

Name

module:geotoolkit/report/dom/Node~Node#firstChild

Returns

Node

Inherited from

Node.firstChild


lastChild

get lastChild(): Node

Last child node

Name

module:geotoolkit/report/dom/Node~Node#lastChild

Returns

Node

Inherited from

Node.lastChild


localName

get localName(): string

Node local name

Name

module:geotoolkit/report/dom/Node~Node#localName

Returns

string

Inherited from

Node.localName


nextSibling

get nextSibling(): Node

Next sibling node

Name

module:geotoolkit/report/dom/Node~Node#nextSibling

Returns

Node

Inherited from

Node.nextSibling


nodeName

get nodeName(): string

Node name

Name

module:geotoolkit/report/dom/Node~Node#nodeName

Returns

string

Inherited from

Node.nodeName


nodeType

get nodeType(): NodeType

Node type

Name

module:geotoolkit/report/dom/Node~Node#nodeType

Returns

NodeType

Inherited from

Node.nodeType


nodeValue

get nodeValue(): string

Node value

Name

module:geotoolkit/report/dom/Node~Node#nodeValue

Returns

string

Inherited from

Node.nodeValue

set nodeValue(value): void

Node value

Name

module:geotoolkit/report/dom/Node~Node#nodeValue

Parameters

Name Type
valuestring

Returns

void

Inherited from

Node.nodeValue


ownerDocument

get ownerDocument(): Document

Node owner document

Name

module:geotoolkit/report/dom/Node~Node#ownerDocument

Returns

Document

Inherited from

Node.ownerDocument


parentNode

get parentNode(): Node

Parent node

Name

module:geotoolkit/report/dom/Node~Node#parentNode

Returns

Node

Inherited from

Node.parentNode


previousSibling

get previousSibling(): Node

Previous sibling node

Name

module:geotoolkit/report/dom/Node~Node#previousSibling

Returns

Node

Inherited from

Node.previousSibling


rootNode

get rootNode(): Node

Return root node

Deprecated

since 2022 (3.4) use Node#getRootNode instead

Name

module:geotoolkit/report/dom/Node~Node#rootNode

Returns

Node

Inherited from

Node.rootNode


tagName

get tagName(): string

Node tag name

Name

module:geotoolkit/report/dom/Node~Node#tagName

Returns

string

Inherited from

Node.tagName

Methods

appendChild

appendChild(newChild): Element

Add child to the node

Parameters

Name Type Description
newChildNodechild to add

Returns

Element

Overrides

Node.appendChild


clearAttributes

clearAttributes(): Element

Clear attributes

Returns

Element

Inherited from

Node.clearAttributes


clearNodes

clearNodes(): Element

Remove all child nodes from this node

Returns

Element

this

Inherited from

Node.clearNodes


connectStyle

connectStyle(style, type, callback): Element

Connects style.

This convenience method subscribes a listener to given style for the specified type.
And automatically un-subscribes listener if node is disposed to prevent memory leaks

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

Element

this

Implementation of

IStyleListener.connectStyle


disconnectStyle

disconnectStyle(style, type, callback): Element

Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

Element

this

Implementation of

IStyleListener.disconnectStyle


dispose

dispose(): void

Disposes this node, once disposes a node should not be used anymore.
Clear all listeners, and disconnect styles to avoid memory leaks.
Also aggressively 'cleanup' this node by setting some of its members to null.

Returns

void

Overrides

Node.dispose


enumerateNodes

enumerateNodes(callback, target?): void

Enumerate children nodes

Parameters

Name Type Description
callbackCallback<Node>callback
Optional targetQueryBuilder<any>target

Returns

void

Inherited from

Node.enumerateNodes


flush

Protected flush(serializationContext?): Element

Flush all changes before saving

Parameters

Name Type Description
Optional serializationContextSerializationContextserialization Context

Returns

Element

Inherited from

Node.flush


getAttribute

getAttribute(name): string

Return attribute value

Parameters

Name Type Description
namestringattribute name

Returns

string

Overrides

Node.getAttribute


getClassName

getClassName(): string

Returns

string

Inherited from

Node.getClassName


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

Node.getCssClass


getElementRegistry

getElementRegistry(): IElementsRegistry

Returns elements Registry

Returns

IElementsRegistry

Inherited from

Node.getElementRegistry


getGuid

getGuid(): string

Returns element GUID

Returns

string

Inherited from

Node.getGuid


getId

getId(): string

Returns element id

Returns

string

Inherited from

Node.getId


getInnerCssStyle

getInnerCssStyle(): string

Return collected inner css style

Returns

string

inner css style


getNodeIndex

getNodeIndex(): number

Return node index

Returns

number

Inherited from

Node.getNodeIndex


getNodeValue

getNodeValue(): string

Returns node value

Returns

string

Inherited from

Node.getNodeValue


getParent

getParent(): Node

Returns parent node

Returns

Node

parent

Inherited from

Node.getParent


getProperties

getProperties(): Options

Gets the element properties

Returns

Options

props


getRootNode

getRootNode(): Node

Return root node

Returns

Node

node

Inherited from

Node.getRootNode


getTagName

getTagName(): string

Returns node tag name

Returns

string

Inherited from

Node.getTagName


getTimeStamp

getTimeStamp(): number

Gets time stamp

Returns

number

timeStamp

Inherited from

Node.getTimeStamp


hasAttribute

hasAttribute(name): boolean

Check if attribute exists

Parameters

Name Type Description
namestringattribute name

Returns

boolean

Overrides

Node.hasAttribute


hasChildNodes

hasChildNodes(): boolean

Return true if node has children

Returns

boolean

Inherited from

Node.hasChildNodes


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

Node.hasEventListener


indexOfNode

indexOfNode(node): number

Returns index of node.

Parameters

Name Type Description
nodeNodeitem to get index of

Returns

number

Inherited from

Node.indexOfNode


insertAfter

insertAfter(newChild, refChild): Node

Insert child

Parameters

Name Type Description
newChildNodechild to insert
refChildNoderef child

Returns

Node

Inherited from

Node.insertAfter


insertBefore

insertBefore(newChild, refChild): Node

Insert child

Parameters

Name Type Description
newChildNodechild to insert
refChildNoderef child

Returns

Node

Inherited from

Node.insertBefore


invalidate

Protected invalidate(): Element

Returns

Element

this

Inherited from

Node.invalidate


invalidateDocument

Protected invalidateDocument(eventArgs): Element

Invalidate root document

Parameters

Name Type Description
eventArgsNodeEventArgsevent args

Returns

Element

this

Inherited from

Node.invalidateDocument


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

Node.isDisposed


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

Node.isSilent


lock

lock(): Element

Lock node

Returns

Element

Inherited from

Node.lock


normalize

normalize(): Element

Puts the specified node and all of its subtree into a "normalized" form. In a normalized sub-tree, no text nodes in the sub-tree are empty and there are no adjacent text nodes.

Returns

Element

this

Inherited from

Node.normalize


notify

notify<E>(type, source, args?): Element

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceElementof the event
Optional argsEventMap[E]arguments of the event

Returns

Element

this

Overrides

Node.notify


off

off<E>(type?, callback?): Element

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: Element, args: EventMap[E]) => voidfunction to be called

Returns

Element

this

Overrides

Node.off


on

on<E>(type, callback): Element

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: Element, args: EventMap[E]) => voidto be called

Returns

Element

this

Overrides

Node.on


onParentChanged

Protected onParentChanged(): Element

Returns

Element

this

Inherited from

Node.onParentChanged


onResetCssProperties

Protected onResetCssProperties(silent?): Element

Clean up cached properties

Parameters

Name Type Description
Optional silentbooleansilent reset

Returns

Element

this


removeAttribute

removeAttribute(name): Element

Remove attribute

Parameters

Name Type Description
namestringattribute name

Returns

Element


removeChild

removeChild(child): Node

Remove child from node

Parameters

Name Type Description
childNodeto remove

Returns

Node

Inherited from

Node.removeChild


replaceChild

replaceChild(newChild, oldChild): Element

Replace child

Parameters

Name Type Description
newChildNodechild to replace with
oldChildNodechild to replace

Returns

Element

Inherited from

Node.replaceChild


resetElementStyle

Protected resetElementStyle(): Element

Reset own styles

Returns

Element


save

save(recursive?, serializationContext?): string

Serialize element to xml

Parameters

Name Type Description
Optional recursivebooleansave whole dom element structure
Optional serializationContextSerializationContextserialization Context

Returns

string

Inherited from

Node.save


setAttribute

setAttribute(name, value): Element

Set attribute value

Parameters

Name Type Description
namestringattribute name
valuestringattribute value

Returns

Element

Overrides

Node.setAttribute


setAttributeNode

setAttributeNode(newAttr): Element

Adds a new Attribute node to the specified element.

Parameters

Name Type Description
newAttrAttributeattribute

Returns

Element

this

Overrides

Node.setAttributeNode


setCssClass

setCssClass(cssClass): Element

Set css class

Parameters

Name Type Description
cssClassstringcss class

Returns

Element

Inherited from

Node.setCssClass


setElementRegistry

Protected setElementRegistry(registry): Element

Set shadow element registry

Parameters

Name Type Description
registryIElementsRegistryelements registry

Returns

Element

Inherited from

Node.setElementRegistry


setGuid

setGuid(guid): Element

Set node GUID

Parameters

Name Type Description
guidstringnode GUID

Returns

Element

Inherited from

Node.setGuid


setNodeValue

setNodeValue(nodeValue): Element

Set node value

Parameters

Name Type Description
nodeValuestringnode value

Returns

Element

Inherited from

Node.setNodeValue


setProperties

setProperties(properties?): Element

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

Element

this


setSilent

setSilent(bool): Element

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

Element

this

Inherited from

Node.setSilent


setText

setText(text): Element

Set text value

Parameters

Name Type Description
textstringtext value

Returns

Element

this


setXmlContent

setXmlContent(xmlValue): Promise<NodeList<Node>>

Set XML content

Parameters

Name Type Description
xmlValuestringxml to parse

Returns

Promise<NodeList<Node>>

promise


unlock

unlock(): Element

Unlock node

Returns

Element

Inherited from

Node.unlock


updateTimeStamp

updateTimeStamp(): Element

Update time stamp to indicate that style has been changed.

Returns

Element

this

Inherited from

Node.updateTimeStamp


findParentNode

Static findParentNode<T>(node, classType): InstanceType<T>

Find root of the node with specified type

Type parameters

NameType
Textends Constructable<any>

Parameters

Name Type Description
nodeNodenode to start search
classTypeTtype of the class to search for or short interface name

Returns

InstanceType<T>

Inherited from

Node.findParentNode

Static findParentNode(node, classType): Node

Find root of the node with specified type

Parameters

Name Type Description
nodeNodenode to start search
classTypestringinterface name to search for

Returns

Node

Inherited from

Node.findParentNode


getClassName

Static getClassName(): string

Returns

string

Inherited from

Node.getClassName