source: other-projects/rsyntax-textarea/src/java/org/fife/ui/rsyntaxtextarea/TokenFactory.java@ 25584

Last change on this file since 25584 was 25584, checked in by davidb, 12 years ago

Initial cut an a text edit area for GLI that supports color syntax highlighting

File size: 1.7 KB
Line 
1/*
2 * 10/28/2004
3 *
4 * TokenFactory.java - Interface for a class that generates tokens of some type.
5 *
6 * This library is distributed under a modified BSD license. See the included
7 * RSyntaxTextArea.License.txt file for details.
8 */
9package org.fife.ui.rsyntaxtextarea;
10
11import javax.swing.text.Segment;
12
13
14/**
15 * Interface for a class that generates tokens somehow.
16 *
17 * @author Robert Futrell
18 * @version 0.1
19 */
20interface TokenFactory {
21
22
23 /**
24 * Returns a null token.
25 *
26 * @return A null token.
27 */
28 public Token createToken();
29
30
31 /**
32 * Returns a token.
33 *
34 * @param line The segment from which to get the token's text.
35 * @param beg The starting offset of the token's text in the segment.
36 * @param end The ending offset of the token's text in the segment.
37 * @param startOffset The offset in the document of the token.
38 * @param type The type of token.
39 * @return The token.
40 */
41 public Token createToken(final Segment line, final int beg,
42 final int end, final int startOffset, final int type);
43
44
45 /**
46 * Returns a token.
47 *
48 * @param line The char array from which to get the token's text.
49 * @param beg The starting offset of the token's text in the char array.
50 * @param end The ending offset of the token's text in the char array.
51 * @param startOffset The offset in the document of the token.
52 * @param type The type of token.
53 * @return The token.
54 */
55 public Token createToken(final char[] line, final int beg,
56 final int end, final int startOffset, final int type);
57
58
59 /**
60 * Resets the state of this token maker, if necessary.
61 * FIXME: Improve documentation.
62 */
63 public void resetAllTokens();
64
65
66}
Note: See TracBrowser for help on using the repository browser.