Applet Usability Enhancement in Java Plug-in for Merlin


Introduction

        This document outlines the applet usability enhancements that has been planned in Java Plug-in for Merlin release. The main goal of this enhancement is to make Java Plug-in much easier to be used during applet development stage and applet deployment stage. The enhancement includes the following:

  1. Unified error and warning dialog
  2. Enhanced error condition handling
  3. Enhanced Java Plug-in tracing
  4. Java Console enhancement
  5. Applet progress status
  6. Modal dialog enhancement
  7. Non-blocking browser UI during Java Plug-in startup (optional)
  8. Java Plug-in Control Panel Help (optional)
  9. Option to delete Cached Files

Unified error and warning dialog

        This enhancement will unify the look-and-feel of all the error and warning dialogs that will be displayed directly from Java Plug-in, so the developers and users will be able to distinguish the error and warning much easier. A simple infrastructure will be provided for creating these dialogs in a unified way. For example,

    public class com.sun.plugin.usability.DialogFactory
    {
        public static int showConfirmDialog(Object message, String title);
        public static String showInputDialog(Object message, String title);
        public static void showExceptionDialog(Object message, String title);
        public static void ShowMessageDialog(Object message, String title);
    }


        By using com.sun.plugin.usability.DialogFactory, we will be able to ensure all error and warning dialogs provides similar look-and-feel. Although Java Plug-in is the mechanism for making the JRE running inside the browser, the users should only know they are running Java, not the Java Plug-in. Therefore, icon displayed inside the warning and error dialogs should either be a Sun logo or a Java logo, but NOT a Java Plug-in logo. Also, to make the dialog much easier to port on various platforms, the dialog should be written in Swing. This enhancement applies to both Win32 and Unix plug-in.

        All the general dialogs in Java Plug-in will leverage this unified framework, including:

  1. Print dialog when applet tries to print
  2. Prompt user to login a protected directory
  3. Prompt user to accept the RSA signed applet
  4. Prompt user to accept downloading optional package installer from the applet
  5. Prompt user to accept the RSA signed optional package installer
  6. Prompt user for HTML Installation
  7. Prompt user for waiting Java optional package installer to exit
  8. Prompt user for waiting native optional package installer to exit

 

Enhanced error condition handling

       Currently, when Java Plug-in encounters errors, most of them will fail silently, and it makes debugging and deploying applets quite a challenge to most developer. This enhancement provide much more information when errors are encountered in Java Plug-in. Since it is impossible to handle every error conditions, we will only provide additional error condition handling in the most critical or most likely encountered cases:

  1. RSA signed applet verification
  2. Java Optional Package Installation
  3. Applet Caching
  4. HTML Installation
  5. Proxy support
  6. Java Plug-in Control Panel

By providing additional error condition handling, developers and users will be able to nail down the errors much easier. This enhancement applies to both Win32 and Unix plug-in.

Java Plug-in Exception Handling

    Right now, whenever an user Applet throws an exception, one should have Java Console open to view the stack trace. In order to allow the user to view the exception details even when the Java Console is not opened, Java Plug-in is enhanced to show up a dialog box with all the exception details whenever there is an exception in the user Applet's init(), start(), stop() and destroy() methods. This feature is enabled by default. However, it can be turned off by unchecking the "Show Exception Dialog Box" check box in the Basic Tab of the Java Plug-in Control Panel.

Enhanced Java Plug-in Tracing

        Tracing in Java Plug-in may be turned on by enabling the property javaplugin.trace. However, it will turn on all the tracing facilities inside Java Plug-in, and the messages will very likely flood the Java Console. Therefore, a  more fine-grained tracing control is needed. A new property javaplugin.trace.option will be introduced as the tracing enhancement. This property may contain the following values:

        This enhancement will allow us to introduce more fine-grained tracing into Java Plug-in, and make debugging Java Plug-in and applets much easier. This enhancement applies to both Win32 and Unix plug-in.

 Java Console Enhancement

        Several enhancements will be introduced in the Java Console:

  1. Swing-based Java Console - Java Console was implemented using AWT. However, when lots of messages are displayed, it usually flood the Console window, and the native AWT widget was not able to handle the task. As a result, only the first couple hundreds line of the messages are displayed in the Java Console, and the rest are cut out. Converting the Java Console to Swing will eliminate this limitation.
  2. Debugging support - Java Console provides a simple way to show System.out and System.err, so developers will be able to debug their applets. However, debugging applets normally requires much more than System.out and System.err. This enhancement will provide the following options in the Java Console:

    - Run finalizers
    - Trigger garbage collecter
    - Display memory usage
    - Display thread list
    - Clear the console window
    - Display the available debug options
    - Quite the console

    These options are provided in the form of accelerator keys which are accepted in Java Console.
  3. Task bar integration - this enhancement is for both Internet Explorer and Netscape Navigator. It will provide an icon in the Windows taskbar when Java Plug-in is running. When this icon is clicked, Java Console will be opened. This allow user to be able to open and close the Java Console multiple times within the same browser session in different browsers. Also, one can use the taskbar icon to check the plug-in version.

         Enhancements #1 and #2 applies to both Win32 and Unix plug-in. However, #3 only applies to Win32 plug-in.

Applet Progress Status

        This enhancement will provide applet specific progress status in the applet's window. Progress status will include the following information:

        Since the progress status will be shown inside the applet's window in a non-blocking fashion, the browser UI will be more responsive, and the user will be able to read the HTML page while the applet is loading. Also, user will be able to determine the applet loading progress without using the Java Console. This enhancement applies to both Win32 and Unix plug-in.

Modal dialog enhancement

        Although modal dialog has been supported in Java Plug-in for a long time, it has been a big problem because the users will still be able to click on the applet window even if a modal dialog has been popup. This enhancement will take advantage of the modal dialog hook introduced by the AWT team to provide true modal dialog support. This enhancement applies only to Win32 plug-in.


Non-blocking browser UI during JVM startup (optional)

        Currently, when Java Plug-in is loaded into the browser, the browser UI may block for couple seconds because the JVM is loaded in the main browser UI thread. Users are prevented to do anything with the browser during this period because the entire browser is blocked. Enhancement will be introduced to resolve this blocking problem by starting up the JVM in a separate thread, so browser UI will be more responsive. This enhancement applies to only Win32 plug-in, because Unix plug-in always startup the JVM in a separate process. However, it will only be implemented only if time and resources are allowed.

Java Plug-in Control Panel Help (optional)

        Various settings of Java Plug-in may be controlled through Java Plug-in Control Panel. However, users sometimes find it difficult to use the control panel because of lack of help information. This enhancement will introduce a help button in Java Plug-in Control Panel. When the button is clicked, it will try to launch a browser to display the online help HTML page at java.sun.com, or HTML help page that bundled with Java Plug-in. This enhancement applies to both Win32 and Unix plug-in. However, it will only be implemented only if time and resources are allowed.

Option to delete Cached Files

    JAR and HTML caching features in Merlin allows the user to cache the files locally in order to avoid the redundant downloads and also to run the applet offline. Since user might want to delete the cached files sometime or the other, we have provided an option to delete the cached files from the Java Plug-in control panel. User can delete the HTML and JAR files by clicking the buttons "Clear HTML Cache" and "Clear JAR Cache" respectively in the Cache tab of  the Java Plug-in control panel.

Conclusion

        The above outlines all the applet usability enhancements that are planned in Java Plug-in for Merlin release. Hopefully, this will make Java Plug-in much easier to be used by users and developers.


Changes history

Date Action Author(s)
04/12/2000 Applet Usability Enhancement Draft 1 Stanley Ho
07/07/2000 Added sections Java Plug-in Exception handling and Option to delete Cached Files Devananda J.
07/31/2000 Updated the document Devananda J.
07/31/2000 Updated "Enhanced error condition handling" section Stanley Ho
08/02/2000 Added cases in "Unified error and warning dialog" section Stanley Ho