KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > sp > jedit > syntax > DummyTokenHandler


1 /*
2  * DummyTokenHandler.java - Ignores tokens
3  * :tabSize=8:indentSize=8:noTabs=false:
4  * :folding=explicit:collapseFolds=1:
5  *
6  * Copyright (C) 2002 Slava Pestov
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  */

22
23 package org.gjt.sp.jedit.syntax;
24
25 import javax.swing.text.Segment JavaDoc;
26
27 /**
28  * A dummy token handler that discards tokens.
29  *
30  * @author Slava Pestov
31  * @version $Id: DummyTokenHandler.java 4902 2003-10-26 19:43:58Z spestov $
32  * @since jEdit 4.1pre1
33  */

34 public class DummyTokenHandler implements TokenHandler
35 {
36     /**
37      * To avoid having to create new instances of this class, use
38      * this variable. This is allowed because instances of this
39      * class do not store any state.
40      */

41     public static final DummyTokenHandler INSTANCE = new DummyTokenHandler();
42
43     //{{{ handleToken() method
44
/**
45      * Called by the token marker when a syntax token has been parsed.
46      * @param seg The segment containing the text
47      * @param id The token type (one of the constants in the
48      * {@link Token} class).
49      * @param offset The start offset of the token
50      * @param length The number of characters in the token
51      * @param context The line context
52      * @since jEdit 4.2pre3
53      */

54     public void handleToken(Segment JavaDoc seg, byte id, int offset, int length,
55         TokenMarker.LineContext context) {} //}}}
56

57     //{{{ setLineContext() method
58
/**
59      * The token handler can compare this object with the object
60      * previously given for this line to see if the token type at the end
61      * of the line has changed (meaning subsequent lines might need to be
62      * retokenized).
63      * @since jEdit 4.2pre6
64      */

65     public void setLineContext(TokenMarker.LineContext lineContext)
66     {
67     } //}}}
68
}
69
Popular Tags