This sample is located in \Samples\afc11\JNotepad.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
JNotepad is a full-featured text editor, a cross between Microsoft® Windows® Notepad and WordPad. JNotepad offers several advantages over Notepad and similar text editors:
JNotepad is extensible and reusable. Many classes in JNotepad can be easily copied and used in your own applications. The \Samples\afc11\JNotepad\docs directory contains additional information on JNotepad:
To compile the sample
To run the sample
Run Jnotepad.exe in the \Samples\afc11\JNotepad\Classes directory.
You can also run JNotepad with the jview utility. Use the following command from the \Samples\afc11\JNotepad\Classes directory:
jview JNotePad
This class is the main entry point of the program; it creates an instance of the JNotepad application object and runs it in the same way the system runs an applet.
JNotePadFrame.javaThis class implements a frame window, fills the frame with all the controls needed, and handles the exit command.
JNoteMenubar.javaThis class defines the menu bar. The class extends UIBand with additional features: it supports loading menus from resource files, automatically places menu items in a hash table for easy access, and supports a Most Recently Used Files menu. JNoteMenubar uses the ICommandFeedback.java interface to enable and disable menu items as well as to check and uncheck them.
JNoteToolbar.javaThis class defines the toolbar. It operates on objects that implement the IFileOperationTarget.java interface, which contains common file operations. JNoteToolbar also implements application settings changes.
TabFileViewer.java, FeatureTabFileViewer.java, and JNoteTabFileViewer.java
These three classes descend from one another and together define the tab viewer. The uppermost parent, TabFileViewer provides basic functionality. FeatureTabFileViewer extends TabFileViewer and adds support for plug-in features and a tab context menu. JNoteTabFileViewer adds JNotepad-specific functions, such as an About JNotepad dialog box and a Properties dialog box.
JNoteUIEdit.javaThis class handles the entry and display of text.
JNoteCommandFeature.javaThis class handles all command processing in the application.
CommandFeature.javaThis class intercepts all menu commands, toolbar commands, and accelerator key commands, identifies the command, and routes them to the appropriate place. It also implements ICommandFeedback.java, which allows parts of the application to enable and disable menu items and toolbar buttons.
SettingsObject.javaThis class stores settings (user-definable options) for the entire program.
ICommandFeedback.javaThis interface allows user interface components to receive feedback. CommandFeature.java implements this interface and handles all command state changes.
IFileOperationTarget.javaThis interface contains methods that support common file operations.