1
2sub JAVA_Base {
3    MoveFileStart;
4    InsertString "package /* package name */;";
5    2:LineNew;
6    InsertString "import java.util.*;"; LineNew;
7    InsertString "import javax.swing.*;"; 2:LineNew;
8    InsertString "public class ";
9    InsertString $FileBaseName;
10    LineNew;
11    InsertString "{"; LineIndent;
12    2:LineNew;
13    InsertString "public ";
14    InsertString $FileBaseName;
15    InsertString "()"; LineIndent; LineNew;
16    InsertString "{"; LineIndent; 2:LineNew;
17    InsertString "}"; LineIndent; 2:LineNew;
18    InsertString "}"; LineIndent; LineNew;
19    MoveFileStart; 8:MoveRight;
20}
21
22colorize JAVA {
23    SyntaxParser        = 'C';
24
25    color {
26        { 'Normal',        'Editor_Default' },
27        { 'Number',        'Lang_DecimalNumber' },
28        { 'HexNumber',     'Lang_HexNumber' },
29        { 'Punctuation',   'Lang_Punctuation' },
30        { 'String',        'Lang_String' },
31        { 'Comment',       'Lang_Comment' },
32        { 'CPreprocessor', 'Lang_Preprocessor' },
33        { 'Function',      'Lang_Function' },
34        { 'Label',         'Lang_Label' },
35    };
36
37    keyword 'Editor_Keywords' {
38        'abstract',  'default',  'goto',       'null',      'synchronized',
39        'boolean',   'do',       'if',         'package',   'this',
40        'break',     'double',   'implements', 'private',   'threadsafe',
41        'byte',      'else',     'import',     'protected', 'throw',
42        'byvalue',   'extends',  'instanceof', 'public',    'transient',
43        'case',      'false',    'int',        'return',    'true',
44        'catch',     'final',    'interface',  'short',     'try',
45        'char',      'finally',  'long',       'static',    'void',
46        'class',     'float',    'native',     'super',     'while',
47        'const',     'for',      'new',        'switch',    'continue',
48        'throws'
49    };
50}
51
52mode JAVA: PLAIN {      # JAVA Mode
53    FileNameRx          = /\.\c{{java}|{js}}$/;
54    HilitOn             = 1;
55    Colorizer           = 'JAVA';
56    AutoIndent          = 1;
57    IndentMode          = 'C';
58    MatchCase           = 1;
59    Trim                = 1;
60    MultiLineHilit      = 1;
61    AutoHilitParen      = 1;
62    RoutineRegexp	= /^\s*\w[\w._]+{\s+[\w._]+}+[\w_]+\s*\([^;]*$/;
63
64    SaveFolds           = 2;      # save fold info at end of line
65    CommentStart        = ' /*';
66    CommentEnd          = '*/';
67}
68