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  /***
15   * Positions caret if has caret.
16   * 
17   * @author Martin Kollar Created on 1.8.2005
18   */
19  public interface ICaretPositioner {
20  
21      /***
22       * Returns ITextLocator of TextPiece where the Caret is created
23       */
24      /*
25       * temporarily commented out because of "not used" ITextLocator
26       * getLocator();
27       */
28  
29      /***
30       * Test if this positioner has caret, it means caret is visible and
31       * positioned by this caret positioner.
32       * 
33       * @return true if positioner has caret
34       */
35      public boolean hasCaret();
36  
37      /***
38       * Returns offset in TextPiece where caret is. Caret must be visible and
39       * must be positioned by this positioner. Otherwise IllegalArgumentException
40       * is thrown.
41       * 
42       * @return valid caret offset 
43       */
44      public int getCaretOffset();
45  
46      /***
47       * Hides the Caret
48       */
49      public void hideCaret();
50  
51      /***
52       * Shows the Caret
53       */
54      public void showCaret();
55  
56      /***
57       * Shows Caret before character at position index.
58       * 
59       * @param index
60       *            index of character before which Caret to show.
61       */
62      public void showCaretBefore(int index);
63  
64  }