View Javadoc

1   /*
2    * Copyright 1999-2006 Faculty of Mathematics, Physics
3    * and Informatics, Comenius University, Bratislava. This file is protected by
4    * the Mozilla Public License version 1.1 (the License); you may not use this
5    * file except in compliance with the License. You may obtain a copy of the
6    * License at http://euromath2.sourceforge.net/license.html Unless required by
7    * applicable law or agreed to in writing, software distributed under the
8    * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9    * OF ANY KIND, either express or implied. See the License for the specific
10   * language governing permissions and limitations under the License.
11   */
12  package sk.uniba.euromath.editor.textEditor;
13  
14  import sk.uniba.euromath.editor.xmlEditor.IXMLEditPart;
15  
16  /***
17   * Keeps piece of rendered text of textual node. This text is localized by
18   * locator into segment of one line (segments can be for example at end of
19   * paragraph). Properties of this text are held by ITextPieceInfo. Rendered and
20   * XSLT transformed text of node can only differ by white spaces, its usual that
21   * some XML white spaces are losed(for example in XHTML many white spaces are
22   * treated as one).
23   * 
24   * @author Tomáš Studva, Martin Kollár
25   */
26  public interface ITextPieceKeeper extends IXMLEditPart {
27  
28          /***
29           * Returns rendered keeper's text. Same as
30           * {@link ITextPieceInfo#getRenderedText()}
31           * 
32           * @return rendered text piece of this keeper.
33           */
34          public String getText();
35  
36          /***
37           * Returns ITextPieceContainer where keeper is held.
38           * 
39           * @return container containing this keeper
40           */
41          public ITextPieceContainer getTextContainer();
42  
43          /***
44           * Sets container 
45           */
46          public void setTextContainer(ITextPieceContainer container);
47          
48          /***
49           * Returns ITextLocator for this keeper.
50           * 
51           * @return text locator to lacate keeped text piece
52           */
53          public ITextLocator getTextLocator();
54  
55          /***
56           * Returns ITextPieceInfo about keeper's text piece.
57           * 
58           * @return info for keeped text
59           */
60          public ITextPieceInfo getTextPieceInfo();
61  
62          /***
63           * Returns status about which text is selected.
64           * 
65           * @return selection status
66           */
67          public ITextPieceSelectionStatus getSelectionStatus();
68  
69          /***
70           * Shows(renders) actual selection stored in ITextSelectionStatus.
71           */
72          public void showSelection();
73  
74          /***
75           * Returns keeper located next in direction to this's.
76           * 
77           * @param direction
78           *                one of {@link Direction#LEFT},
79           *                {@link Direction#RIGHT}
80           */
81          public ITextPieceKeeper getNextKeeperInDirection(Direction direction);
82  
83          /***
84           * Returns keeper located in direction from this keeper at xCoordinate.
85           * 
86           * @param direction
87           *                {@link Direction#TOP}, {@link Direction#BOTTOM}
88           * @param xCoordinate
89           *                x coordinate of vertical to find closest keeper in
90           *                direction
91           * 
92           * 
93           */
94          public ITextPieceKeeper getKeeperInDirection(Direction direction,
95                          int xCoordinate);
96  
97  }