01: /*
02: * Sun Public License Notice
03: *
04: * The contents of this file are subject to the Sun Public License
05: * Version 1.0 (the "License"). You may not use this file except in
06: * compliance with the License. A copy of the License is available at
07: * http://www.sun.com/
08: *
09: * The Original Code is NetBeans. The Initial Developer of the Original
10: * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11: * Microsystems, Inc. All Rights Reserved.
12: */
13:
14: package org.netbeans.editor.ext.plain;
15:
16: import org.netbeans.editor.BaseImageTokenID;
17: import org.netbeans.editor.BaseTokenID;
18: import org.netbeans.editor.TokenContext;
19: import org.netbeans.editor.TokenContextPath;
20:
21: /**
22: * Tokens used in formatting
23: *
24: * @author Miloslav Metelka
25: * @version 1.00
26: */
27:
28: public class PlainTokenContext extends TokenContext {
29:
30: // Numeric-ids for token-ids
31: public static final int TEXT_ID = 1;
32: public static final int EOL_ID = 2;
33:
34: public static final BaseTokenID TEXT = new BaseTokenID("text",
35: TEXT_ID);
36:
37: public static final BaseImageTokenID EOL = new BaseImageTokenID(
38: "EOL", EOL_ID, "\n");
39:
40: // Context declaration
41: public static final PlainTokenContext context = new PlainTokenContext();
42:
43: public static final TokenContextPath contextPath = context
44: .getContextPath();
45:
46: private PlainTokenContext() {
47: super ("format-");
48:
49: try {
50: addDeclaredTokenIDs();
51: } catch (Exception e) {
52: if (Boolean.getBoolean("netbeans.debug.exceptions")) { // NOI18N
53: e.printStackTrace();
54: }
55: }
56:
57: }
58:
59: }
|