Burgaud.com - SciTE Java API (original) (raw)

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.

Summary

Requirements

If you just need the API and Keyword files, download SciteJavaApi_api_files.zip and jump to section SciTE Configuration.

In order to run SciteJavaApi.bsh you need:

  1. A recent version of the Java Runtime Environment
  2. A recent version of the Java Dynamic Language BeanShell, some packages available for download already include the BeanShell library

Of course, you also need SciTE (Scintilla Text Editor) in order to use the Java API files.

Installation and Usage

$ java -XX:MaxPermSize=128m -cp bsh-2.1b2.jar bsh.Interpreter SciteJavaApi.bsh

You should get the following output:

Start ClassPath Mapping
Mapping: Archive: file:/Users/andre/SciteJavaApi/bsh-2.1b2.jar
Mapping: Archive: file:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar
End ClassPath Mapping
======================================
Beanshell SciteJavaApi
Version 1.6 July 10, 2011
Copyright 2000-2011 (c) Andre Burgaud
======================================
BeanShell 2.1b2 - http://code.google.com/p/beanshell2
Java 1.6.0_26 - by Apple 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:
  1. Choose 1 or 2 to generate respectively the Java Keywords file or the Java API file
  2. To generate the API files for a different Java version, invoke the corresponding Java command. You can achieve this by using the environment variable JAVA_HOME. See the shell scriptjava_api.sh and windows batch file java_api.bat included in the package for more detailed examples.
  3. After generating the API files, you can configure SciTE.

SciTE Configuration

import java160_26_kwd
api.*.java=$(SciteDefaultHome)\java160_26.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 java160_26.kwd. You have to rename the file to java160_26_kwd.properties, in order to allow the import to work.

Configuring SciTE as explained above will enable the following features:

  1. Java classes highlighting
  2. Calltips
  3. Auto completion

Consult the SciTE Documentation for more details about the editor configuration.

Java Classes Highlighting

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:

SciTE Keyword Highlighting

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.

Calltips

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 Calltips

Auto Completion

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:

SciTE API Completion

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.

SciTE Auto Completion

Compatibility

Release Notes

Version 1.6 - 07/10/2011

Version 1.5 - 12/20/2006

Version 1.4 - 12/05/2004

Version 1.3 - 07/30/2004

Version 1.2 - 04/06/2002

Version 1.1 - 01/08/2002

Version 1.0b - 10/01/2001

Patrick Niemeyer, BeanShell creator, is the author of the book Learning Java. This book has a short appendix dedicated to BeanShell.

All Downloads