1
2
3
4
5
6
7
8
9
10
11
12 package sk.uniba.euromath.editor.textEditor;
13
14 /***
15 * Keeps piece of text of textual node. This text is localized by locator into
16 * segment of one line. Properties of this text are held by ITextPieceInfo.
17 *
18 * @author Tomáš Studva, Martin Kollár
19 */
20 public interface ITextPieceKeeper {
21
22 /***
23 * Returns ITextPieceContainer where keeper is held.
24 *
25 * @return container containing this keeper
26 */
27 public ITextPieceContainer getTextContainer();
28
29 /***
30 * Returns ITextLocator for this keeper.
31 *
32 * @return text locator to lacate keeped text piece
33 */
34 public ITextLocator getTextLocator();
35
36 /***
37 * Returns ITextPieceInfo about keeper's text piece.
38 *
39 * @return info for keeped text
40 */
41 public ITextPieceInfo getTextPieceInfo();
42
43 /***
44 * Returns text from node before keeper's text.
45 *
46 * @return substring of textual node's text, with start index 0 to offset of
47 * first character of keeper's text in node's text.
48 */
49 public String getPreviousText();
50
51 /***
52 * Returns text before keeper's text from node + substring of keeper's text
53 * to position index. Character at position index is not included (it is
54 * like substring).
55 *
56 * @return substring of textual node's text, with start index 0 to (offset
57 * of first character of keeper's text + position) in node's text.
58 * @param index
59 * local position in text
60 */
61 public String getWholeTextToPosition(int index);
62
63 /***
64 * Returns keeper's text.
65 *
66 * @return text piece of textual node held by this keeper.
67 */
68 public String getText();
69
70 /***
71 * Returns status about which text is selected.
72 *
73 * @return selection status
74 */
75 public ITextPieceSelectionStatus getSelectionStatus();
76
77 /***
78 * Selects whole text.
79 */
80 void select();
81
82 /***
83 * Selects text starting at position start and ending at position end - 1.
84 *
85 * @param start
86 * index of first character in the selection
87 * @param end
88 * index of first character that is not in the selection
89 */
90 void select(int start, int end);
91
92 /***
93 * Deselects anything selected.
94 */
95 void deselect();
96
97 }