JTablet 1.2.0 API

cello.jtablet.installer
Class JTabletExtension

java.lang.Object
  extended by cello.jtablet.installer.JTabletExtension

public class JTabletExtension
extends Object

This class provides a system for JTablet version compatibility for Applets and Applications. Even if you are bundling JTablet in your product, an older version of JTablet installed as an extension will override and potentially conflict with your program. This class provides three mechanisms for dynamically understanding the situation:

  1. Use checkCompatibility(Component, String) to ensure any installed JTablet is compatible. This will display a simple (English) GUI asking the user to upgrade if they have an older version installed.
  2. getInstallStatus(String) to determine the installation status (such as if an upgrade is required) and call install(Component, String) to perform the install itself.
  3. getInstalledVersion() to determine the exact versio of JTablet installed.

For the best user experience, choose the earliest version of JTablet that makes sense for your application.

Author:
marcello

Nested Class Summary
static class JTabletExtension.InstallStatus
          Describes the current install state as returned by getInstallStatus(String).
 
Constructor Summary
JTabletExtension()
           
 
Method Summary
static boolean checkCompatibility(Component parentComponent, String desiredMinimumVersion)
          Checks the installed version of JTablet, and displays a message to the user if an incompatible version is found.
static String getInstalledVersion()
          Returns the currently installed version of JTablet.
static JTabletExtension.InstallStatus getInstallStatus(String desiredMinimumVersion)
          Checks the installed version of JTablet and determines if an upgrade is required.
static boolean install(Component parentComponent, String desiredMinimumVersion)
          Opens up a web-page to install (or upgrade) JTablet (if necessary).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTabletExtension

public JTabletExtension()
Method Detail

getInstalledVersion

public static String getInstalledVersion()
Returns the currently installed version of JTablet.

Returns:
the version, or null, if it is not installed

getInstallStatus

public static JTabletExtension.InstallStatus getInstallStatus(String desiredMinimumVersion)
Checks the installed version of JTablet and determines if an upgrade is required.

Parameters:
desiredMinimumVersion - the version of JTablet to compare to
Returns:
the installed version

install

public static boolean install(Component parentComponent,
                              String desiredMinimumVersion)
                       throws IOException
Opens up a web-page to install (or upgrade) JTablet (if necessary).

In the future, this method may do a silent/in-place install if called prior to loading any JTablet classes.

Parameters:
parentComponent - the parent component for showing UI messages
desiredMinimumVersion - the minimum version of JTablet to install, or null to install regardless
Returns:
true if the upgrade was successful. (This only happens if the desiredMinimumVersion is already installed. In the future it may be true after an in-place install/upgrade.)
Throws:
IOException - if there was a problem attempting to do an upgrade

checkCompatibility

public static boolean checkCompatibility(Component parentComponent,
                                         String desiredMinimumVersion)
Checks the installed version of JTablet, and displays a message to the user if an incompatible version is found. The method returns true if not conflicts are found.

Note: This method will still return true if JTablet is not installed. If you want to require JTablet be installed, you should use JTablet as an extension.

Parameters:
parentComponent - the component to launch the UI from (this is used to detect Applets)
desiredMinimumVersion - the minimum version of JTablet required for the upgrade (you may get a later version)
Returns:
true if no JTablet conflicts were found

JTablet 1.2.0 API