JPad Pro is an Integrated Development Environment (IDE) for Java and JavaScript that runs on Windows ® 95 and Windows NT platforms. The demo version is the same as the full version of JPad Pro except that it is limited to opening files less than 2500 bytes (you can however create and save files of any size). To order JPad Pro see the enclosed order form.
The Java support in JPad Pro is based upon Sun's Java Development Kit (JDK). JDK itself is just a collection of command line tools and related files. JPad Pro provides a set of commands that make it easy to use the JDK tools. For example, to compile a Java class you just have to choose the compile command in JPad Pro. If you use the command line tool "javac.exe" from the JDK then you need to know how to set up the environment for running JDK javac and will also need to know what parameters to pass to javac.
JPad Pro also makes it easy to locate syntax errors generated by JDK tools. All you need to do to locate the source where a syntax error occurred is to double click on a error message that includes a line number. You can also turn on JPad Pro's line number option or use the "Go To " command if you want to locate the error your self. The following example shows a syntax error in the "system.out.flush()" statement. In this case the word "system" should be spelled "System".
JPad Pro also makes it easy to insert existing or your own templates into a source file. In the JPad Pro directory you will find a "Templates" folder. Any text (.txt) files put in this folder will be displayed in the Templates tree view located in the Project panel. Double clicking on a template file will insert the contents of the file at the current insertion location in your active view. The next example shows the result of inserting MyApplet template into a source file.
When inserting the contents JPad Pro takes into account the current indentation level. If the current location in the source is a blank line or at the start of a line then the contents will be inserted starting at that line. Otherwise the contents will be inserted in new lines following the line with the current location.
The project manager in JPad Pro manages a class, package, and file view of one or more Java packages. You create a new project by choosing the New command and selecting project. This will bring up a dialog to let you define your project. Each project has a name, a list of folders each of which correspond to a package, and a location for the project file as shown in the New Project dialog below.
If you are building a Java application you can let JPad Pro define the package by filling out the information in the following Insert Package dialog (choose Insert from the Edit menu to get to this dialog). A top level Java package will have no parent. Sub-packages will have a parent. Note that JPad Pro will only let you select an existing parent for a sub-package. This dialog also lets you choose a separate source and class path for your application. By default the paths are the same.
After you have defined a project you can use the Package Info dialog to change some information about a package. You get to this dialog by choosing "Project Info " from the View menu and then choosing a package to view.
Once you have a project defined you can use the Build commands
to compile a Java application. This is a lot easier than using
the compile command if you have a large package to compile. In
the examples folder there is a package called "vrml"
consisting of around 50 classes. To try out the project manager,
create a new Project and choose the vrml package as the initial
package. You will then be able to browse the vrml package using
any of the project views. Double-clicking on an item in a project
view will bring up the appropriate source (see below).
Once you have defined a project then JPad Pro makes it easy to create a new class at the correct location in the package hierarchy by bring up the following dialog when you choose a new Java file. Just choose a package from the drop-down list and enter in a class name. JPad Pro will then create a .java file in the correct location.
Known problems: The Java Build and Build All commands can generate class not found errors when using a binary directory that is different than the source directory. Workaround: Compile each class not found during a build using the Compile command and then use the Build command.
For JavaScript, the key feature is the Syntax Check tool. It's this tool that you will want to use to reduce browser generated syntax and runtime errors. The Syntax Check tool lets you detect the following types of errors:
The following figure shows a screen shot of JPad Pro without the
project manager. The upper panel is where you edit HTML and Java
files. The bottom panel is the output panel which is where output
is displayed from JPad Pro tools. This example shows a JavaScript
enabled HTML page with a JavaScript error highlighted. The error
report was generated by the HTML/JavaScript Syntax Check tool.
The Syntax Check tool simulates the actions taken by a browser when it loads and displays a page. First the page is parsed along with the JavaScript to build the Object Model including user defined HTML objects, JavaScript functions, and JavaScript scriptlets (event handlers). After each script is parsed the immediate statements defined in a script are evaluated (global variables defined in the immediate statements are created at this time). Finally, after the page is "loaded", the "onLoad", other, and "onUnload" events are evaluated in that order.
It's during the first phase that the Syntax Check function checks the page for HTML and JavaScript for syntax errors. Valid Object Model references are also checked in the first phase while evaluating any immediate statements. Out of order execution problems will also be detected while evaluating the immediate statements. During the final phase, the Syntax Check function checks for valid references to the Object Model as it evaluates each event.
The Syntax Check tool is based on a custom JavaScript parser with a full JavaScript Object Model. The Object Model includes the following standard objects:
Each object includes all appropriate properties and methods. See a JavaScript reference manual for a full description of the object model.
In general, you should first try to remove all syntax errors from
your page before focusing on object model reference errors. The
reason for this is that a syntax error stops the parsing of a
script. If the syntax error occurred in a function then that function
and any functions or statements defined below it will not be parsed
or added to the Object Model. If the syntax error occurred in
an immediate statement then that statement and anything that follows
that statement will not be parsed. This in turn means that any
references to those functions or global variables not added to
the Object Model will generate a not found message. For example,
here is the output generated by Syntax Check for a page with a
JavaScript syntax error.
## Begin Syntax Check File "C:\JPad Pro - JS\Example.html" Line 7: Syntax error at '=' if (field.vlaue === field.defaultValue) { -----------------------^ Added scriplet for "onFocus" in object "name" ## HTML Page Loaded Evaluating event "onFocus" File "C:\JPad Pro - JS\Example.html" Line 16: Cannot find the method "clearField" -- Finished evaluating event "onFocus" ## End Syntax Check
In this example the function clearField is obviously defined, but since there was a syntax error in the function clearField, the function was not added to the Object Model and thus it was not found when the onFocus event was evaluated. Fixing the syntax error will eliminate this not found message.
You should also check out the Object Model dump option. To turn it on go the Configure dialog for an HTML page and select Object Model. The Object Model dump outputs the Object Model as it exists after the Syntax Check tool is finished. The Object Model dump includes HTML objects and default objects defined in the page. It also includes all functions, local and global variables defined in the page.
This edition of JPad Pro has a number of limitations in the Syntax
Check function. Some of these limitations may be removed in a
future release of this edition, in the full version of JPad Pro,
or in a future ModelWorks product.
There is no installer. To install JPad Pro just copy the files
to a folder. To setup JPad Pro, open JPad Pro and follow instructions.
The only thing that you need to know to setup JPad Pro is the
location of javac.exe in your JDK directory if you want to use
JPad Pro to compile and run Java programs. Read the JPad Pro FAQ
for more information.
IMPORTANT: If you have an existing version of
JPad Pro installed on your system, we recommend that you delete
your "JPad Pro.ini" file located in your windows directory
before using this release.
Send comments, suggestions or bug reports to Chet Murphy at cmurphy@modelworks.com. If you got this release from a CD-ROM distribution be sure to check out ModelWorks for latest release and for information about other ModelWorks products..
Copyright (c) 1996, Modelworks Software. All rights reserved.
JPad and JPad Pro are a trademarks of ModelWorks Software. Java is a trademark of Sun Microsystems, Inc. Windows is a registered trademark of Microsoft Corporation.