Inside the JBuilder OpenTools API
Chapter 19 - Structure Pane

Previous   Next   Listings

The GIFEditor example defines a new node viewer for GIF files, allowing you to edit their content within JBuilder.

Zipped Files

GIFEditor.jpx   The project file for this tool
GIFEditor.html Project notes
classes.opentools The OpenTools manifest The entry point for the tool - a factory that creates viewers for GIF images on demand The viewer definition - which creates the actual UI page on demand The pixel editing component that interacts with JBuilder's buffers to load and save the image - based on code written by Claude Duguay in a JavaPro article A file format encoder for GIF images - from Acme Laboratories A Structure Pane component that displays a preview of the image
*.java Supporting code for this tool
GIFEditor.jar The packaged tool
GIFEditorDoc.jar The packaged documentation

The OpenToolsNode example hooks into several parts of the JBuilder API. It defines a new node type that knows how to deal with OpenTools manifest files (.opentools extension). For these nodes it defines a new EditorKit and Scanner to provide syntax highlighting within the editor. It adds a list of headers to the Structure Pane and links these back to their locations in the file. Popup menus in the Structure and Editor Panes let you easily add a new header to the file. And finally, an OpenTool personality lets you turn OpenTools support on or off in JBuilder 10 and up.

Zipped Files

OpenToolsNode.jpx   The project file for this tool
OpenToolsNode.html Project notes
classes.opentools The OpenTools manifest The TextFileNode descendent that knows about OpenTools manifest files. It links to the editor kit and structure component. The TextEditorKit descendent for these files. It links to the scanner. The Scanner implementation that tokenizes OpenTools manifest files The TextStructure descendent that displays the headers from these files A popup menu that lists the standard OpenTools headers and inserts them on request A wizard to create or update a classes.opentools file based on the OpenTools found in the project. The UI for the above wizard A wizard to create a new OpenTools project - adding the OpenTools SDK library and creating your classes.opentools file The UI for the above wizard A custom personality for OpenTools related features (JBuilder 10 only)
OpenToolsNode.jar The packaged tool
Inside the JBuilder OpenTools API 2004, Keith Wood Previous   Next   Listings