(转自http://www.burgaud.com/scite-java-api/)
SciTE (Scintilla Text Editor) supports API and Keyword files to customize some aspects of the editor for a given programming language. Keywords files extend the highlighting of source code files (i.e. Class names in Java), and API files allow to displays calltips, basic form of the popular Microsoft Intellisense ®. The BeanShell script, SciteJavaApi.bsh, generates both the Java API and the Keyword files for your current Java Runtime Environment.
If you just need the API and Keyword files, download SciteJavaApi_api_files.zip (947kB) and jump to section SciTE Configuration.
In order to run SciteJavaApi.bsh you need:
Of course, you also need SciTE (Scintilla Text Editor) in order to use the Java API files.
C:\SciteJavaApi>java -cp bsh-2.0b5.jar bsh.Interpreter SciteJavaApi.bsh
Start ClassPath Mapping Mapping: Archive: file:/C:/bsh/bsh-2.0b5.jar Mapping: Archive: file:/C:/jdk1.5.0_06/jre/lib/rt.jar End ClassPath Mapping ====================================== Beanshell SciteJavaApi Version 1.5 December 23, 2006 Copyright 2000-2006 (c) Andre Burgaud ====================================== BeanShell 2.0b5 - by Pat Niemeyer ([email protected]) Java 1.5.0_06 - by Sun Microsystems Inc. ====================================== Beanshell SciTETools Menu - Type "q|Q" and [ENTER] to quit. - Type "1" and [ENTER] to build a Java Keywords file for SciTE. - Type "2" and [ENTER] to build a Java Api file for SciTE. Your choice:
import java150_kwd api.*.java=$(SciteDefaultHome)\java150.api calltip.java.word.characters=._$(word.chars.cxx) calltip.java.parameters.start=( calltip.java.parameters.start=) calltip.java.parameters.separators=.
Note: In versions prior to 1.5, SciteJavaApi.bsh generated the keyword file with the format java150.kwd. You had to rename the file to java150_kwd.properties, in order to allow the import to work.
Configuring SciTE as explained above will enable the following features:
The Java classes highlighting is automatically enabled due to the import of the keywords file. Classes are highlighted as shown in the following screen capture:
To modify the highlight color, modify the value of the style associated with keyword2 in the file cpp.properties:
... # Keywords2 style.cpp.16=fore:#B00040 ...
Note: To limit the size of the keywords properties file, only classes from packages started with java are included. This excludes classes from javax packages for example.
With the calltip configuration, such as the one described in the section Scite Configuration, when you type the open parenthesis after a method name, a scrollable pop-up help box displays the possible parameters of this method. You can enter the parameters accordingly, and also use the mouse to navigate up and down to see the other method signatures. You can also invoke calltips by pressing Ctrl+Shift+Space with the cursor located inside of the method parameter parenthesis.
SciTE allows you to customize the behavior of the word completion feature, based on the source code being edited. In the case of Java, I simply suggest to take advantage of the the word completion from the API file by invoking it via the shortcut key Ctrl+Space or Ctrl+i, as shown in the screen capture below:
Though not directly related to the auto completion provided by the API file, there is another auto completion feature available in SciTE. By typing Ctrl+Enter just after at least one character, SciTE will open a list of words already available in your file and matching the first characters of the word being typed.