|
Web-4-All v3.00 Plug-in API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.utoronto.atrc.web4all.ControlHub
Control Hub of the Web4-4-All system. The Control Hub coordinates activity among the Preference Loader, the Preferences Wizard Manager, the Configuration Manager, and the plug-ins.
| Field Summary | |
static java.lang.String |
CONTEXT_ID_VAL
Key for fetching the value of the context ID. |
protected static boolean |
DEBUG
Static flag to control the output of debug information. |
static java.lang.String |
LIP_CONTENTYPE_LOCATION_VAL
Key for fetching the location of the LIP Contentype schema. |
static java.lang.String |
LOCALE_PROP
For notifying property change listeners that the locale has changed. |
static java.lang.String |
MAIN_WINDOW_PROP
For notifying property change listeners that the main window has been allocated. |
static java.lang.String |
NO_BUTTON_CMD
Action command for the "No" push button in an alert. |
static java.lang.String |
OK_BUTTON_CMD
Action command for the "Ok" push button. |
static java.lang.String |
SCHEMA_LOCATION_VAL
Key for fetching the location of the schema. |
static java.lang.String |
SCHEMA_VERSION_VAL
Key for fetching the version of the schema. |
static int |
SPLASH_HEIGHT
Height of the splash screen. |
static int |
SPLASH_WIDTH
Width of the splash screen. |
static java.lang.String |
THIRD_PARTY_FOLDER
Base name of the 3rd party folder. |
static java.lang.String |
XMLNS_VAL
Key to the xml schema namespace. |
static java.lang.String |
XMLNS_XSI_VAL
Key to the xml instance document namespace. |
static java.lang.String |
YES_BUTTON_CMD
Action command for the "Yes" push button in an alert. |
| Constructor Summary | |
ControlHub(java.lang.String inDirectory)
Constructor -- must initialize with the path to the directory from which the Web-4-All system was launched. |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Handle button presses on the splash screen. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener inListener)
Allow PropertyChangeListeners to add themselves. |
static java.lang.String |
createXMLString(java.lang.String inFileName)
Utility for reading an XML file into memory. |
protected void |
deiconifySplashScreen()
Deiconify the main window. |
protected void |
flushLookupTables()
Flush the "appType" and "appID" lookup tables, and their contents. |
java.util.Vector |
get3rdPartyAppIds(java.lang.String inAppType)
Given an application type, return a list of application IDs for that type. |
java.util.Vector |
get3rdPartyAppTypes(java.lang.String inAppID)
Given an application ID, return the application type codes for that ID, if any. |
java.lang.String |
get3rdPartyConfigClass(java.lang.String inAppID)
Given an application ID, return the class name of the SetterLauncher for that application, if any. |
java.lang.String |
get3rdPartyExecutable(java.lang.String inAppID)
Given an application ID, return the full path to the exectuable for that application, if any. |
protected java.net.URL |
get3rdPartyFolderUrl()
Retrieve the URL to the third party folder. |
java.lang.String |
get3rdPartyFullProductName(java.lang.String inAppID)
Given an application ID, retrieve the user-friendly string that provides a name for that application. |
java.lang.String |
get3rdPartyIni(java.lang.String inAppID)
Given an application ID, return the full path to the initialization file for that application. |
java.lang.String |
get3rdPartyPrefsClass(java.lang.String inAppID)
Given an application ID, return the class name of the preferences wizard plug-in for that application, if any. |
java.util.ResourceBundle |
get3rdPartyProperties(java.lang.String inAppID)
Given an application ID, return all of its properties. |
java.lang.String |
getGlobalProperty(java.lang.String inKey)
Retrieve a Web-4-All global property value. |
java.lang.String |
getHomeDirectory()
Retrieve the full path to the home directory. |
java.util.Locale |
getLocale()
Return current Locale in use by Web-4-All. |
java.lang.String |
getPrefElementName(java.lang.String inKey)
Retrieve an ACCLIP preference element name given its key. |
java.lang.String |
getPrefElementNameKey(java.lang.String inElementName)
Retrieve a preference element name's key, given its ACCLIP name. |
static ControlHub |
getSharedInstance()
Acquire the shared instance of the ControlHub, if any. |
static ControlHub |
getSharedInstance(boolean inCreateFlag,
java.lang.String inDirectory)
Acquire the shared instance of ControlHub. |
protected void |
iconifySplashScreen()
Minimize the main window. |
protected void |
initPWM()
Utility to create the Preferences Wizard Manager and it's main window. |
java.lang.String |
kickIt(java.lang.String inPrefs,
PrefsLoaderAPI inPrefsLoader)
The main entry point that a preferences loader uses to engage the control hub. |
org.w3c.dom.Element |
lastChance3rdPartyPrefs(java.lang.String appType,
java.util.Vector appsNotLaunched)
Attempt to find at least one technology that matches the given type. |
protected void |
load3rdPartyProps()
Find and load all of the plug-in properties files. |
static void |
main(java.lang.String[] args)
A main for running the Web-4-All system without using a smart card -- mostly for debugging. |
protected void |
makePrefsDom(java.lang.String inPrefsStr)
Parse the given XML ACCLIP string into a DOM. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener inListener)
Allow PropertyChangeListeners to remove themselves. |
void |
run()
Run the built-in preferences wizard. |
void |
savePrefs()
Write the preferences, if any, back to the storage medium. |
void |
setLocale(java.util.Locale inLocale)
Inform the Web-4-All system of a change in language preference, including notifying any property change listeners. |
static int |
showOptionDialog(java.awt.Component inParent,
java.lang.String inMessage,
java.lang.String inTitle,
int inMessageType)
Utility for showing a confirmation dialogue or an alert. |
protected void |
showSplashScreen()
Show the main window. |
static ControlHub |
startWeb4All(java.lang.String inDirectory,
PrefsLoaderAPI inPrefsLoader)
Allocate a copy of the Control Hub, and launch the Web-4-All system. |
void |
stopIt()
Stop Web-4-All and return it to its initial state. |
static void |
stopWeb4All()
Static method to shut down the shared instance of Web-4-All. |
boolean |
thirdPartyAppExists(java.lang.String inAppID)
Utility to determine if a third party application/technology exists on the system. |
void |
updateLanguagePref(java.util.Locale inLocale)
Inform the Web-4-All system of a change in language preference. |
void |
updateStatusMessage(java.lang.String inMessage)
Alter the current status message within the main window. |
int |
updateStatusMessage(java.lang.String inMessage,
int inMessageType)
Show either an alert modal dialogue or a confirmation modal dialogue containing the given message. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String THIRD_PARTY_FOLDER
public static final java.lang.String XMLNS_VAL
public static final java.lang.String XMLNS_XSI_VAL
public static final java.lang.String SCHEMA_LOCATION_VAL
public static final java.lang.String LIP_CONTENTYPE_LOCATION_VAL
public static final java.lang.String SCHEMA_VERSION_VAL
public static final java.lang.String CONTEXT_ID_VAL
public static final java.lang.String YES_BUTTON_CMD
public static final java.lang.String NO_BUTTON_CMD
public static final java.lang.String OK_BUTTON_CMD
public static final java.lang.String LOCALE_PROP
public static final java.lang.String MAIN_WINDOW_PROP
public static final int SPLASH_HEIGHT
public static final int SPLASH_WIDTH
protected static final boolean DEBUG
| Constructor Detail |
public ControlHub(java.lang.String inDirectory)
inDirectory - Full path to Web4All's home directory.| Method Detail |
public static ControlHub startWeb4All(java.lang.String inDirectory,
PrefsLoaderAPI inPrefsLoader)
inDirectory - Full path to the directory that Web-4-All is in.inPrefsLoader - The preferences loader -- implements interface
PrefsLoaderAPI.stopWeb4All(),
PrefsLoaderAPIpublic static void stopWeb4All()
null.
startWeb4All(String,PrefsLoaderAPI)public static ControlHub getSharedInstance()
null otherwise.getSharedInstance(boolean,String)
public static ControlHub getSharedInstance(boolean inCreateFlag,
java.lang.String inDirectory)
inCreateFlag - If true, and no shared instance of ControlHub
exists, then this will create one. If false
and there is no shared instance, then none will be created.inDirectory - Full path to Web4All's home directory. Used only if
inCreateFlag is true.
null otherwise.getSharedInstance(),
startWeb4All(String,PrefsLoaderAPI)
public static int showOptionDialog(java.awt.Component inParent,
java.lang.String inMessage,
java.lang.String inTitle,
int inMessageType)
updateStatusMessage() methods instead.
inParent - The Component whose Window will be the parent of the
JDialog presented.inMessage - The status message itself. If null or empty, any
current status will be simply erased.inTitle - The title for the JDialog.inMessageType - One of JOptionPane.ERROR_MESSAGE, or
JOptionPane.QUESTION_MESSAGE. If the
former, JOptionPane.showMessageDialog() is used.
If the latter, JOptionPane.showConfirmationDialog()
is used.
JOptionPane.YES_OPTION or
JOptionPane.NO_OPTION.updateStatusMessage(String),
updateStatusMessage(String,int)
public java.lang.String getGlobalProperty(java.lang.String inKey)
throws java.util.MissingResourceException
inKey - The global property name.
java.util.MissingResourceException
public java.lang.String kickIt(java.lang.String inPrefs,
PrefsLoaderAPI inPrefsLoader)
inPrefs - The XML preferences as a String.inPrefsLoader - The preferences loader -- implements interface
PrefsLoaderAPI.
startWeb4All(String,PrefsLoaderAPI),
stopIt(),
PrefsLoaderAPIpublic void stopIt()
stopIt() is kickIt().
kickIt(String,PrefsLoaderAPI),
stopWeb4All()public void updateStatusMessage(java.lang.String inMessage)
null, will replace any current status message.
inMessage - The status message itself. If null or empty, any
current status is erased.updateStatusMessage(String,int)
public int updateStatusMessage(java.lang.String inMessage,
int inMessageType)
inMessage - The status message itself. If null or empty, any
current status is erased.inMessageType - One of JOptionPane.ERROR_MESSAGE, or
JOptionPane.QUESTION_MESSAGE. If the
former, JOptionPane.showMessageDialog() is used.
If the latter, JOptionPane.showConfirmationDialog()
is used.
JOptionPane.YES_OPTION or
JOptionPane.NO_OPTION.showOptionDialog(Component,String,String,int),
updateStatusMessage(String)public void setLocale(java.util.Locale inLocale)
inLocale - The new Locale.updateLanguagePref(Locale),
getLocale()public void updateLanguagePref(java.util.Locale inLocale)
inLocale - The new Locale.setLocale(Locale),
getLocale()public java.util.Locale getLocale()
public boolean thirdPartyAppExists(java.lang.String inAppID)
inAppID - The application ID whose executable is checked for exsistence.
true if the executable associated with
inAppID is on the system; false
otherwise.protected void iconifySplashScreen()
protected void deiconifySplashScreen()
protected void showSplashScreen()
protected void makePrefsDom(java.lang.String inPrefsStr)
inPrefsStr - The preferences as a String.
public java.lang.String getPrefElementName(java.lang.String inKey)
throws java.util.MissingResourceException
inKey - The key to the element's name.
java.util.MissingResourceExceptionWeb4AllConstants,
getPrefElementNameKey(String)
public java.lang.String getPrefElementNameKey(java.lang.String inElementName)
throws java.util.MissingResourceException
inElementName - The name of an element.
java.util.MissingResourceExceptionWeb4AllConstants,
getPrefElementName(String)protected java.net.URL get3rdPartyFolderUrl()
null, if unspecified.public java.lang.String getHomeDirectory()
public java.util.Vector get3rdPartyAppIds(java.lang.String inAppType)
inAppType - The application type key (String).
null if no technology is of the given type.
public java.util.Vector get3rdPartyAppTypes(java.lang.String inAppID)
throws java.util.MissingResourceException
inAppID - The application ID (String).
java.util.MissingResourceException
public java.lang.String get3rdPartyPrefsClass(java.lang.String inAppID)
throws java.util.MissingResourceException
inAppID - The application ID (String).
java.util.MissingResourceException - Unrecognized ID, or no preferences wizard plug-in for that ID.ThirdPartyPrefsWizard
public java.lang.String get3rdPartyConfigClass(java.lang.String inAppID)
throws java.util.MissingResourceException
inAppID - The application ID (String).
java.util.MissingResourceException - Unrecognized ID, or no configuration plug-in for that ID.SetterLauncher
public java.lang.String get3rdPartyExecutable(java.lang.String inAppID)
throws java.util.MissingResourceException
inAppID - The application ID (String).
java.util.MissingResourceException - Unrecognized ID, or no executable for that ID.
public java.lang.String get3rdPartyIni(java.lang.String inAppID)
throws java.util.MissingResourceException
inAppID - The application ID (String).
java.util.MissingResourceException - Unrecognized ID, or no ".ini" property for that ID.public java.lang.String get3rdPartyFullProductName(java.lang.String inAppID)
inAppID - The application ID (String).
java.util.MissingResourceException - Unrecognized ID, or no full product name for that ID.
public java.util.ResourceBundle get3rdPartyProperties(java.lang.String inAppID)
throws java.util.MissingResourceException
inAppID - The application ID (String).
java.util.MissingResourceException - Unknown ID.protected void load3rdPartyProps()
public org.w3c.dom.Element lastChance3rdPartyPrefs(java.lang.String appType,
java.util.Vector appsNotLaunched)
This takes an application type and a list of applications. It returns the first application
of that type that is not in the list and that exists on the system. Otherwise, it
return null. The application list is a list of application ID's.
The return value is an "application" Element as defined by the ACCLIP. This element is
created and placed within a new mini-document that is separate from the user's main
preferences document.
appType - The application type.appsNotLaunched - A vector containing appID's of applications that are not on the system.
public void savePrefs()
PrefsLoaderAPIprotected void flushLookupTables()
public void addPropertyChangeListener(java.beans.PropertyChangeListener inListener)
inListener - The PropertyChangeListener to add.public void removePropertyChangeListener(java.beans.PropertyChangeListener inListener)
inListener - The PropertyChangeListener to remove.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - ActionEvent that called us.public void run()
run in interface java.lang.RunnableactionPerformed(ActionEvent)protected void initPWM()
public static void main(java.lang.String[] args)
For debugging the Web-4-All system, it takes all of its information from the command line, optionally using the low-memory binding version of the preferences, optionally displaying the properties of the specified configuration plug-in and optionally using the name of the given file as the location of the preferences. If the latter is not provided, the file name defaults to "prefs.xml".
In "menu" mode, all the other arguments are ignored, a file menu is built and this behaves like a traditional GUI app. However, only the preferences wizard is ever engaged to create/read/edit/save preferences files.
Which mode is used depends on the contents of Web4All.properties which can specify a PrefsLoaderAPI object to use to load/save the preferences. Currently, if the class specified matches the MenuPrefsLoader, then Web-4-All is launched in menu mode. Otherwise, Web-4-All is launched in debug mode.
args - usage: java ca.utoronto.atrc.web4all.ControlHub [-lowmem] [-appID id] [prefs_file]
public static java.lang.String createXMLString(java.lang.String inFileName)
java.lang.String.
inFileName - The file name. This can be a full or relative path to the file
|
Web-4-All v3.00 Plug-in API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||