Package ucar.unidata.idv
Class PluginManager
java.lang.Object
ucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.PluginManager
- All Implemented Interfaces:
ActionListener,EventListener,IdvConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringXml attrstatic final StringXml attr namestatic final StringXml attrstatic final StringXml attrstatic final StringXml attr namestatic final StringXml attrstatic final Stringfor url pluginsstatic final Stringxml tagFields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, windowFields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_B64ISL, ARG_BUNDLE, ARG_CATALOG, ARG_CHOOSER, ARG_CLEARDEFAULT, ARG_CODE, ARG_CONNECT, ARG_CURRENTTIME, ARG_DATA, ARG_DEBUG, ARG_DEFAULT, ARG_DISPLAY, ARG_DXML, ARG_FIXEDTIME, ARG_HELP, ARG_IMAGE, ARG_IMAGESERVER, ARG_INSTALLPLUGIN, ARG_ISLFILE, ARG_ISLINTERACTIVE, ARG_LISTRESOURCES, ARG_MAINCLASS, ARG_MOVIE, ARG_MSG_DEBUG, ARG_MSG_RECORD, ARG_NODEFAULT, ARG_NOERRORSINGUI, ARG_NOGUI, ARG_NOONEINSTANCE, ARG_NOPLUGINS, ARG_NOPREF, ARG_ONEINSTANCEPORT, ARG_PLUGIN, ARG_PORT, ARG_PRINTJNLP, ARG_PROPERTIES, ARG_SCRIPT, ARG_SERVER, ARG_SETFILES, ARG_SITEPATH, ARG_TEMPLATE, ARG_TEST, ARG_TESTEVAL, ARG_TRACE, ARG_TRACEONLY, ARG_USERPATH, DEFAULT_DATE_FORMAT, DEFAULT_DOCPATH, DEFAULT_TIMEZONE, FILTER_CPT, FILTER_ISL, FILTER_JNLP, FILTER_XIDV, FILTER_XIDVZIDV, FILTER_XML, FILTER_ZIDV, ID_COMMANDSTORUN, ID_DATASOURCES, ID_DISPLAYCONTROLS, ID_IDV, ID_JYTHON, ID_MESSAGE, ID_MISCHASHTABLE, ID_NCIDV_VERSION, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_APPEARANCEMODE, PREF_ARCHIVEDIR, PREF_ARCHIVENAME, PREF_AUTODISPLAYS_ENABLE, PREF_AUTODISPLAYS_SHOWGUI, PREF_AUTOSELECTDATA, PREF_CACHESIZE, PREF_CONTROLSINTABS, PREF_DATAPREFIX, PREF_DATE_FORMAT, PREF_DISTANCEUNIT, PREF_DOCACHE, PREF_EMBEDDATACHOOSERINDASHBOARD, PREF_EMBEDFIELDSELECTORINDASHBOARD, PREF_EMBEDLEGENDINDASHBOARD, PREF_EMBEDQUICKLINKSINDASHBOARD, PREF_EVENT_KEYBOARDMAP, PREF_EVENT_MOUSEMAP, PREF_EVENT_WHEELMAP, PREF_FAST_RENDER, PREF_FIELD_CACHETHRESHOLD, PREF_FILEREADDIR, PREF_FILEWRITEDIR, PREF_GEOMETRY_BY_REF, PREF_HISTORY, PREF_IMAGE_BY_REF, PREF_LARGE_REMOTE_DATA_WARN, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAXIMAGESIZE, PREF_MEMORY, PREF_NPOT_IMAGE, PREF_OPEN_ASK, PREF_OPEN_MERGE, PREF_OPEN_REMOVE, PREF_PROJ_LIST, PREF_SAMPLINGMODE, PREF_SHOWCONTROLWINDOW, PREF_SHOWDASHBOARD, PREF_SHOWDECODEDIALOG, PREF_SHOWHIDDENFILES, PREF_SHOWQUITCONFIRM, PREF_SITEPATH, PREF_THREADS_DATA, PREF_THREADS_RENDER, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_WINDOW_SHOWTOOLBAR, PREF_ZIDV_ASK, PREF_ZIDV_DIRECTORY, PREF_ZIDV_SAVETOTMP, PROP_3DMODE, PROP_ABOUTTEXT, PROP_APPRESOURCEPATH, PROP_CHOOSERS, PROP_CHOOSERS_ALL, PROP_CONTROLDESCRIPTORS, PROP_CONTROLDESCRIPTORS_ALL, PROP_DATAHOLDERBOUNDS, PROP_DEFAULTLOCATIONS, PROP_DISPLAYLIST_GROUP, PROP_FIXFILELOCKUP, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_MAP_GLOBE_LEVEL, PROP_MAP_MAP_LEVEL, PROP_MINIMUMFRAMECYCLETIME, PROP_MONITORPORT, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWCLOCK_DASH, PROP_SHOWCLOCK_VIEW, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_DISPLAYAREA, PROP_USE_TIMEDRIVER, PROP_VERSIONFILE, PROP_WINDOW_SCREENSIZEOFFSET, PROP_WINDOW_SIZEHEIGHT, PROP_WINDOW_SIZEWIDTH, PROP_WINDOW_USESCREENSIZE, SUFFIX_BAT, SUFFIX_CPT, SUFFIX_ISL, SUFFIX_JNLP, SUFFIX_RBI, SUFFIX_SH, SUFFIX_XIDV, SUFFIX_XML, SUFFIX_ZIDV -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidLet user select a file to put into the pluginvoidaddCreateFile(String file) Add the file to the list of plugin filesprotected voidadd an errorvoidAdd some object to the listvoidaddObjects(List objects) Add the list of objectsvoidAdd main.xmlvoidAdd the given text with the given filename.voidApply preferencesvoidClose the dialogvoidclose dialogprotected voidThis gets called on System.exit and closes any open plugin jar filesvoidWrite the pluginstatic StringDecode the name of the file.static StringDecode the name of the file.static StringEncode the filenameShow a dialog that lists the loaded pluginsvoidhandlePlugin(String path) Handle the extension file.voidimport plugin from filevoidimportPlugin(String filename) import plugin from filevoidimportPlugin(String filename, boolean merge) import plugin from filevoidAdd entries to menuvoidinitializeFavoritesMenu(JMenu menu) Add entries to menuvoidinitializeFormulasMenu(JMenu menu) Add entries to menuvoidinitializeMenu(JMenu menu, List list, String name) Add entries to menuvoidAdd entries to menuvoidAdd entries to menuvoidAdd entries to menuvoidinstallPlugin(String plugin) install the pluginvoidPrompt for a plugin filename and install it.voidinstallPluginFromFile(String filename) Install a plugin from a filevoidPrompt for a plugin url and install it.voidinstallPluginInThread(String plugin) install the pluginvoidlistPlugin(String file) List the contents of the plugin filevoidLoad bundles from diskprotected voidLoad the jar fileprotected voidloadPlugin(String filename, boolean topLevel) Try to process the given file.protected voidloadPlugin(String filename, String prefix, boolean topLevel) Try to process the given file.protected voidloadPlugin(String filename, String prefix, boolean topLevel, String label) load pluginprotected voidLoad in any pluginsstatic voidtestprotected voidNotify the users to restart the IDVvoidRemove the selected entry(ies) in the list of resourcesvoidremovePlugin(File file) remove pluginvoidremovePlugin(String file) remove pluginAsk the user to seelct a jar file.voidShow the create dialogvoidShow helpvoidShow helpvoidshow dialogvoidtoggleCategory(String category) Show or hide the categoryvoidShow a dialog that lists the loaded pluginsvoidupdatePlugins(boolean doLoaded) Show a dialog that lists the loaded pluginsvoidviewPluginFile(Object[] args) View the plugin file.Methods inherited from class ucar.unidata.idv.IdvManager
getArgsManager, getCollabManager, getColorTableManager, getDataManager, getIdv, getIdvChooserManager, getIdvClass, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getPersistenceManager, getPreferenceManager, getProperty, getProperty, getProperty, getPublishManager, getResourceManager, getStateManager, getStationModelManager, getStore, getVMManager, logException, showNormalCursor, showWaitCursor, waitUntilDisplaysAreDone, waitUntilDisplaysAreDoneMethods inherited from class ucar.unidata.ui.WindowHolder
actionPerformed, close, doMakeContents, getContents, getDialog, getFrame, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing
-
Field Details
-
PLUGIN_PROTOCOL
for url plugins- See Also:
-
TAG_PLUGIN
xml tag- See Also:
-
ATTR_NAME
Xml attr- See Also:
-
ATTR_SIZE
Xml attr- See Also:
-
ATTR_VERSION
Xml attr- See Also:
-
ATTR_CATEGORY
Xml attr- See Also:
-
ATTR_DESC
Xml attr name- See Also:
-
ATTR_URL
Xml attr name- See Also:
-
-
Constructor Details
-
PluginManager
ctor- Parameters:
idv- the idv
-
-
Method Details
-
viewPluginFile
View the plugin file. The jar file is args[0]. The jarEntry is args[1]- Parameters:
args- The args
-
listPlugin
List the contents of the plugin file- Parameters:
file- The plugin file
-
selectJarFile
Ask the user to seelct a jar file. Set the jarFileFld textfield- Returns:
- The jar file selected
-
addText
Add the given text with the given filename. Write out the file to a tmp directory.- Parameters:
text- Text to writefilename- Filename to use
-
addObjects
Add the list of objects- Parameters:
objects- Objects
-
addObject
Add some object to the list- Parameters:
obj- The object to add
-
createPlugin
public void createPlugin()Write the plugin -
closeCreatePlugin
public void closeCreatePlugin()Close the dialog -
applyPreferences
public void applyPreferences()Apply preferences -
addCreateFile
public void addCreateFile()Let user select a file to put into the plugin -
addCreateFile
Add the file to the list of plugin files- Parameters:
file- The file
-
removeCreateFile
public void removeCreateFile()Remove the selected entry(ies) in the list of resources -
initializeColorTableMenu
Add entries to menu- Parameters:
menu- the menu
-
initializeStationModelsMenu
Add entries to menu- Parameters:
menu- the menu
-
initializeFavoritesMenu
Add entries to menu- Parameters:
menu- the menu
-
initializeFormulasMenu
Add entries to menu- Parameters:
menu- the menu
-
loadBundlesFromDisk
public void loadBundlesFromDisk()Load bundles from disk -
initializeParamDefaultsMenu
Add entries to menu- Parameters:
menu- the menu
-
initializeProjectionsMenu
Add entries to menu- Parameters:
menu- the menu
-
initializeMenu
Add entries to menu- Parameters:
menu- the menulist- List of entriesname- name of the sub menu
-
addPreferences
public void addPreferences()Add main.xml -
showCreatePlugin
public void showCreatePlugin()Show the create dialog -
showCreatorHelp
public void showCreatorHelp()Show help -
showManagerHelp
public void showManagerHelp()Show help -
showPluginList
public void showPluginList()show dialog -
closeResources
protected void closeResources()This gets called on System.exit and closes any open plugin jar files -
loadPlugins
Load in any plugins- Throws:
Exception- On badness_
-
addError
add an error- Parameters:
message- msgexc- exception
-
handlePlugin
Handle the extension file. It may be a jar, index or resource file- Parameters:
path- file path or url- Throws:
Exception- On badness
-
loadPlugin
Try to process the given file. This deals with rbis, properties and files with the default name of resources- Parameters:
filename- The filetopLevel- Flag that designates that this plugin is one of the main files in the plugins directory.- Throws:
Exception- On badness
-
removePlugin
remove plugin- Parameters:
file- file
-
removePlugin
remove plugin- Parameters:
file- file
-
loadPlugin
Try to process the given file. This deals with rbis, properties and files with the default name of resources- Parameters:
filename- The fileprefix- Prefix to prepend on the filename for jar based entriestopLevel- Flag that designates that this plugin is one of the main files in the plugins directory.- Throws:
Exception- On badness
-
loadPlugin
protected void loadPlugin(String filename, String prefix, boolean topLevel, String label) throws Exception load plugin- Parameters:
filename- plugin fileprefix- prefixtopLevel- top levellabel- label- Throws:
Exception- on badness
-
loadJar
Load the jar file- Parameters:
jarFilePath- Load the jar
-
getPluginHtml
Show a dialog that lists the loaded plugins- Returns:
- the plugin html listing to include in support requests
-
importPlugin
public void importPlugin()import plugin from file -
importPlugin
import plugin from file- Parameters:
filename- filename
-
importPlugin
import plugin from file- Parameters:
filename- filenamemerge- merge
-
installPluginFromFile
public void installPluginFromFile()Prompt for a plugin filename and install it. -
installPluginFromFile
Install a plugin from a file- Parameters:
filename- file name
-
notifyUser
protected void notifyUser()Notify the users to restart the IDV -
installPluginFromUrl
public void installPluginFromUrl()Prompt for a plugin url and install it. -
installPlugin
install the plugin- Parameters:
plugin- url or file name of the plugin
-
installPluginInThread
install the plugin- Parameters:
plugin- url or file name of the plugin
-
closePluginDialog
public void closePluginDialog()close dialog -
decode
Decode the name of the file. This is the full url or original file path- Parameters:
f- file- Returns:
- decoded name
-
decode
Decode the name of the file. This is the full url or original file path- Parameters:
filename- filen- Returns:
- decoded name
-
encode
Encode the filename- Parameters:
filename- file or url- Returns:
- encoded version
-
toggleCategory
Show or hide the category- Parameters:
category- category to show or hide
-
updatePlugins
public void updatePlugins()Show a dialog that lists the loaded plugins -
updatePlugins
public void updatePlugins(boolean doLoaded) Show a dialog that lists the loaded plugins- Parameters:
doLoaded- Update the loaded list as well
-
main
test- Parameters:
args- args- Throws:
IOException- on badness
-