SimpleNode class

Represents a leaf-node in the DOM. This node only contains text and is used to separate styling logic from the actual textual information

Inheritance

Constructors

SimpleNode(NodeV2 parent, int textIndexStart, String body)

Properties

backgroundColor Color?
no setter
body String
Text contained in the node. Unstructured plaintext containing no HTML
final
children List<NodeV2>
Children nodes.
finalinherited
endHtmlTag String
creates a valid end-tag representation for this node (HTML)
no setterinherited
fontFamily String?
Searches the path to the root for the first occurance of a node with a font-family information. Returns null if no information is present
no setter
fontFeatures Set<FontFeature>
Gathers all and nodes and adds the corresponding FontFeature to the result set
no setter
fontStyle FontStyle
Searches the path to the root for the first occurance of a node with a font-style information. Returns FontStyle.normal if no information is present
no setter
fontWeight FontWeight
Searches the path to the root for the first occurance of a node with a font-weight information. Returns FontWeight.normal if no information is present
no setter
fullTag String
full tag specification. A '' tag in HTML would result in the value of ''
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id int
id to find the node later again
getter/setter pair
isFirstChild bool
returns true iff this node is the first child of the parent or of the parent is null
no setter
isHeader bool
is true, iff the tagname starts with an "h"
no setter
isLastChild bool
returns true iff this node is the last child of the parent or of the parent is null
no setter
is true, iff the node is an "a" node
no setter
isParagraph bool
is true, iff the node is an "p" node
no setter
linkTarget String?
contains the content of the "href" attribute, if present, null otherwise
no setter
nodeIndexEnd int
markers on which position in the source-code this node starts/ends
getter/setter pairinherited
nodeIndexStart int
markers on which position in the source-code this node starts/ends
getter/setter pairinherited
parent NodeV2?
Parent node. All nodes in the DOM except the root node will have a parent
finalinherited
prettyTag String
returns a prettier version of the tag (no HTML)
no setteroverride
properties List<SimpleProperty>
text-properties of the tag
finalinherited
root NodeV2
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startHtmlTag String
creates a valid start-tag representation for this node (HTML)
no setterinherited
styleProperty StyleProperty?
returns the cached style (if present), searches for it in the properties otherwise
no setterinherited
tagName String
tag-type. A '' tag in HTML would result in the value of "a"
finalinherited
textColor Color?
Searches the path to the root for the first occurance of a node with a color information. Returns null if no information is present
no setter
textDecoration TextDecoration
Searches the path to the root for the first occurance of a node with a text-decoration information. Returns TextDecoration.none if no information is present
no setter
textIndexEnd int
Index of the last text character
no setteroverride
textIndexStart int
getter/setter pairinherited

Methods

addChild(NodeV2 node, [int? position]) → void
adds a child-node to this node at an optional position. Triggers a recalc of node indices
inherited
fontSize(Map<String, double> sizes) double
Searches the path to the root for the first occurance of a node with a font-size information. The parameter is a map of tagNames to default font-sizes. This map must contain an entry for "", which is used if no information is found.
getLeaves() List<SimpleNode>
inherited
getNodesInSelection(int start, int end) List<SimpleNode>
find all nodes that have their textIndexStart >= start and startIndex+body.length <= end
inherited
hasAnyTagInPath(List<String> tags) bool
searches the path for any tag specified in tags and returns true, iff one of the parent nodes contains at least one of these tags
hasTagInPath(String tag) bool
searches the path for a specific tag tag
isFullySelected(int selectionStart, int selectionEnd) bool
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshId() → void
toHtml() String
serializes the tree back to a HTML string
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited