sk.uniba.euromath.editor.textEditor
Interface ITextPieceInfo

All Known Implementing Classes:
TextPieceInfoImpl

public interface ITextPieceInfo

Interface to properties of text piece. Rendered and XSLT-transfomed text of node can only differ by white spaces, its obvious that some XML white spaces are losed. Info is bridge from rendering to original document, implementing bridge from rendered to transformed document and using ikslibs to bridge transformed to original document.
Text indexes start from zero.

Author:
Tomáš Studva, Martin Kollár

Method Summary
 DomPointer getDomPointer(int charGapIndex, XMLAccess xmlAccess)
          Returns pointer to original document specified by node assoc with this keeper and charGapIndex.
 ITextPieceKeeper getKeeper()
          Returns associated text piece keeper.
 int getLastIndex()
          Returns last index in rendered text.
 String getNodeID()
          Identification of node in original document(not XSLT-transformed) holding the text (text node, cdata node).
 int getRenderedOffset()
          Index of the first character of this text piece in whole rendered text of textual node.
 String getRenderedText()
          Returns rendered keeper's text.
 int resolveRenderedIndex(int indexInRenderedText, XMLAccess xmlAccess)
          Resolves index in this rendered text to index in associated DOM node's(not XSLT - transformed) original text .
 

Method Detail

getNodeID

String getNodeID()
Identification of node in original document(not XSLT-transformed) holding the text (text node, cdata node).

Returns:
id of node containing this text

getRenderedText

String getRenderedText()
Returns rendered keeper's text.

Returns:
rendered text piece of this keeper.

getLastIndex

int getLastIndex()
Returns last index in rendered text. It is getRenderedText().length - 1.

Returns:
last valid index in rendered text

getRenderedOffset

int getRenderedOffset()
Index of the first character of this text piece in whole rendered text of textual node.

Returns:
globaloffset of first character

resolveRenderedIndex

int resolveRenderedIndex(int indexInRenderedText,
                         XMLAccess xmlAccess)
Resolves index in this rendered text to index in associated DOM node's(not XSLT - transformed) original text .

Parameters:
indexInRenderedText - index in this's rendered text (0 to text.length-1)or index one behind the text(for example when index is character gap index, can be text lenght)
Returns:
index in DOM node's original text or one behind the text

getDomPointer

DomPointer getDomPointer(int charGapIndex,
                         XMLAccess xmlAccess)
Returns pointer to original document specified by node assoc with this keeper and charGapIndex.

Parameters:
charGapIndex - index of character gap in this's rendered text
Returns:
DOMPointer to text node assoc. with this keeper, pointing at gap in node assoc. with charGapIndex

getKeeper

ITextPieceKeeper getKeeper()
Returns associated text piece keeper.

Returns:
associated keeper


Copyright © 2003-2006 null. All Rights Reserved.