1
2
3
4
5
6
7
8
9
10
11
12 package sk.uniba.euromath.editor.textEditor;
13
14 import sk.baka.ikslibs.ptr.DomPointer;
15 import sk.uniba.euromath.document.XMLAccess;
16
17 /***
18 * Interface to properties of text piece. Rendered and XSLT-transfomed text of
19 * node can only differ by white spaces, its obvious that some XML white spaces
20 * are losed. Info is bridge from rendering to original document, implementing
21 * bridge from rendered to transformed document and using ikslibs to bridge
22 * transformed to original document.<br>
23 * Text indexes start from zero.
24 *
25 * @author Tomáš Studva, Martin Kollár
26 */
27 public interface ITextPieceInfo {
28
29 /***
30 * Identification of node in original document(not XSLT-transformed)
31 * holding the text (text node, cdata node).
32 *
33 * @return id of node containing this text
34 */
35 public String getNodeID();
36
37 /***
38 * Returns rendered keeper's text.
39 *
40 * @return rendered text piece of this keeper.
41 */
42 public String getRenderedText();
43
44 /***
45 * Returns last index in rendered text. It is getRenderedText().length -
46 * 1.
47 *
48 * @return last valid index in rendered text
49 */
50 public int getLastIndex();
51
52 /***
53 * Index of the first character of this text piece in whole rendered
54 * text of textual node.
55 *
56 * @return globaloffset of first character
57 */
58 public int getRenderedOffset();
59
60 /***
61 * Resolves index in this rendered text to index in associated DOM
62 * node's(not XSLT - transformed) original text .
63 *
64 * @param indexInRenderedText
65 * index in this's rendered text (0 to text.length-1)or
66 * index one behind the text(for example when index is
67 * character gap index, can be text lenght)
68 *
69 * @return index in DOM node's original text or one behind the text
70 */
71 public int resolveRenderedIndex(int indexInRenderedText,
72 XMLAccess xmlAccess);
73
74 /***
75 * Returns pointer to original document specified by node assoc with
76 * this keeper and charGapIndex.
77 *
78 * @param charGapIndex
79 * index of character gap in this's rendered text
80 * @return DOMPointer to text node assoc. with this keeper, pointing at
81 * gap in node assoc. with charGapIndex
82 */
83 public DomPointer getDomPointer(int charGapIndex, XMLAccess xmlAccess);
84
85 /***
86 * Returns associated text piece keeper.
87 *
88 * @return associated keeper
89 */
90 public ITextPieceKeeper getKeeper();
91 }