1 /* -------------------------------------------------------------------
2 * Java source file for the class CompilableStringDocument
3 *
4 * Copyright (c), 2002, Masahiro Takatsuka.
5 * All Rights Researved.
6 *
7 * Original Author: Masahiro Takatsuka (masa@jbeans.net)
8 * $Author: takatsukam $
9 *
10 * $Date: 2003/07/25 04:51:47 $
11 *
12 * $Id: CompilableStringDocument.java,v 1.1.1.1 2003/07/25 04:51:47 takatsukam Exp $
13 *
14 * Reference: Document no:
15 * ___ ___
16 *
17 * To Do:
18 * ___
19 *
20 ------------------------------------------------------------------- */
21
22 /* --------------------------- Package ---------------------------- */
23 package net.jbeans.util.text;
24
25 /* ------------------ Import classes (packages) ------------------- *//package-summary/html">color="#329900"> ------------------ Import classes (packages) ------------------- *//package-summary.html">color="#329900">/* ------------------ Import classes (packages) ------------------- *//package-summary.html">color="#329900"> ------------------ Import classes (packages) ------------------- */
26 import javax.swing.text.*;
27
28 /*====================================================================
29 Implementation of class CompilableStringDocument
30 ====================================================================*/
31 /***
32 * A text document which will reject any characters that are not
33 * digits.
34 *
35 * @version $Revision: 1.1.1.1 $
36 * @author Masahiro Takatsuka (masa@jbeans.net)
37 * @see PlainDocument
38 */
39
40 public final class CompilableStringDocument extends PlainDocument {
41 public final void insertString(int offs, String str, AttributeSet atts)
42 throws BadLocationException {
43 if (! Character.isJavaIdentifierPart(str.charAt(0))) {
44 return;
45 }
46 super.insertString(offs, str, atts);
47 }
48 }
49
This page was automatically generated by Maven