Project Notes
Project: Modifying keybindings
Author: JBuilder Team
Company: Borland/Inprise
Description:
Demonstrates how to change keybindings.
- Compile this project and exit JBuilder.
- Update JBuilder's classpath to include the output path for this project,
which in this case is the classes directory.
For instance, if the output directory of this sample is located at
d:\foundation\samples\OpenToolsAPI\ModifyKeyBinding\classes
you want to add
d:\foundation\samples\OpenToolsAPI\ModifyKeyBinding\classes
to your classpath. One way to do this is to modify your jbuilder.bat startup
batch file and add:
set CLASSPATH=%CLASSPATH%;d:\foundation\samples\OpenToolsAPI\ModifyKeyBinding\classes
right after the setting of CLASSPATH.
OpenTools will automatically recognize the classes.opentools file and
initialize the code to modify keybindings. OpenTools expects this classes.opentools
file to be one directory above the output directory
so if you move your output directory, make sure you move
the classes.opentools file accordingly.
If you add a System.out.println command in your code, you can make sure that
the keybinding is indeed updated.
A note about classes.opentools files in general. In the classes.opentools
file you add a header and the name of the file that contains the call
to initOpenTool. There are some special formatting constraints, such as
put a space in front of the file name, and a space after the file name,
and end the file with an empty line with 2 spaces in it....
The easiest way to create another classes.opentools file is to create a
copy of any working classes.opentools file, open the file in an editor
that does NOT strip trailing blanks and that does NOT put funny EOF markers
at the end of the file (say Notepad or Wordpad), and substitute the header
and class name with your own header and class name.
If your OpenTools project refuses to initialize, there is a good chance that
your classes.opentools contains too many or not enough spaces in the correct
places.
- Restart JBuilder.