Class PluginManager

All Implemented Interfaces:
ActionListener, EventListener, IdvConstants

public class PluginManager extends IdvManager
  • Field Details

  • Constructor Details

  • Method Details

    • viewPluginFile

      public void viewPluginFile(Object[] args)
      View the plugin file. The jar file is args[0]. The jarEntry is args[1]
      Parameters:
      args - The args
    • listPlugin

      public void listPlugin(String file)
      List the contents of the plugin file
      Parameters:
      file - The plugin file
    • selectJarFile

      public String selectJarFile()
      Ask the user to seelct a jar file. Set the jarFileFld textfield
      Returns:
      The jar file selected
    • addText

      public void addText(String text, String filename)
      Add the given text with the given filename. Write out the file to a tmp directory.
      Parameters:
      text - Text to write
      filename - Filename to use
    • addObjects

      public void addObjects(List objects)
      Add the list of objects
      Parameters:
      objects - Objects
    • addObject

      public void addObject(Object obj)
      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

      public void addCreateFile(String file)
      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

      public void initializeColorTableMenu(JMenu menu)
      Add entries to menu
      Parameters:
      menu - the menu
    • initializeStationModelsMenu

      public void initializeStationModelsMenu(JMenu menu)
      Add entries to menu
      Parameters:
      menu - the menu
    • initializeFavoritesMenu

      public void initializeFavoritesMenu(JMenu menu)
      Add entries to menu
      Parameters:
      menu - the menu
    • initializeFormulasMenu

      public void initializeFormulasMenu(JMenu menu)
      Add entries to menu
      Parameters:
      menu - the menu
    • loadBundlesFromDisk

      public void loadBundlesFromDisk()
      Load bundles from disk
    • initializeParamDefaultsMenu

      public void initializeParamDefaultsMenu(JMenu menu)
      Add entries to menu
      Parameters:
      menu - the menu
    • initializeProjectionsMenu

      public void initializeProjectionsMenu(JMenu menu)
      Add entries to menu
      Parameters:
      menu - the menu
    • initializeMenu

      public void initializeMenu(JMenu menu, List list, String name)
      Add entries to menu
      Parameters:
      menu - the menu
      list - List of entries
      name - 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

      protected void loadPlugins() throws Exception
      Load in any plugins
      Throws:
      Exception - On badness_
    • addError

      protected void addError(String message, Throwable exc)
      add an error
      Parameters:
      message - msg
      exc - exception
    • handlePlugin

      public void handlePlugin(String path) throws Exception
      Handle the extension file. It may be a jar, index or resource file
      Parameters:
      path - file path or url
      Throws:
      Exception - On badness
    • loadPlugin

      protected void loadPlugin(String filename, boolean topLevel) throws Exception
      Try to process the given file. This deals with rbis, properties and files with the default name of resources
      Parameters:
      filename - The file
      topLevel - Flag that designates that this plugin is one of the main files in the plugins directory.
      Throws:
      Exception - On badness
    • removePlugin

      public void removePlugin(String file)
      remove plugin
      Parameters:
      file - file
    • removePlugin

      public void removePlugin(File file)
      remove plugin
      Parameters:
      file - file
    • loadPlugin

      protected void loadPlugin(String filename, String prefix, boolean topLevel) throws Exception
      Try to process the given file. This deals with rbis, properties and files with the default name of resources
      Parameters:
      filename - The file
      prefix - Prefix to prepend on the filename for jar based entries
      topLevel - 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 file
      prefix - prefix
      topLevel - top level
      label - label
      Throws:
      Exception - on badness
    • loadJar

      protected void loadJar(String jarFilePath)
      Load the jar file
      Parameters:
      jarFilePath - Load the jar
    • getPluginHtml

      public String 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

      public void importPlugin(String filename)
      import plugin from file
      Parameters:
      filename - filename
    • importPlugin

      public void importPlugin(String filename, boolean merge)
      import plugin from file
      Parameters:
      filename - filename
      merge - merge
    • installPluginFromFile

      public void installPluginFromFile()
      Prompt for a plugin filename and install it.
    • installPluginFromFile

      public void installPluginFromFile(String filename)
      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

      public void installPlugin(String plugin)
      install the plugin
      Parameters:
      plugin - url or file name of the plugin
    • installPluginInThread

      public void installPluginInThread(String plugin)
      install the plugin
      Parameters:
      plugin - url or file name of the plugin
    • closePluginDialog

      public void closePluginDialog()
      close dialog
    • decode

      public static String decode(File f)
      Decode the name of the file. This is the full url or original file path
      Parameters:
      f - file
      Returns:
      decoded name
    • decode

      public static String decode(String filename)
      Decode the name of the file. This is the full url or original file path
      Parameters:
      filename - filen
      Returns:
      decoded name
    • encode

      public static String encode(String filename)
      Encode the filename
      Parameters:
      filename - file or url
      Returns:
      encoded version
    • toggleCategory

      public void toggleCategory(String category)
      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

      public static void main(String[] args) throws IOException
      test
      Parameters:
      args - args
      Throws:
      IOException - on badness