Class JDialogUninstallPlugin

All Implemented Interfaces:
DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class JDialogUninstallPlugin extends JDialogBase implements ActionListener
Simple dialog to uninstall a plugin. The user selects which .class file to install using a file chooser. The file is copied into MIPAV's class directory and the mipav.preferences file is updated accordingly. The menubars are also updated.
Author:
senseneyj
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • UNINSTALL

      private static final String UNINSTALL
      See Also:
    • pluginTree

      private JTree pluginTree
      The JTree that describes the plugin structure
    • ui

      private ViewUserInterface ui
      The main user interface
  • Constructor Details

    • JDialogUninstallPlugin

      public JDialogUninstallPlugin(String name)
      Does not create the uninstall dialog, instead performs the install algorithm as if only the name plugin had been selected, but confirmation has not occurred.
    • JDialogUninstallPlugin

      public JDialogUninstallPlugin(JFrame theParentFrame)
      Creates new dialog.
      Parameters:
      theParentFrame - Parent frame
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Calls various methods depending on the action.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - event that triggered function
    • deleteOrphans

      private String deleteOrphans(File[] orphans)
    • updateMenuBar

      private void updateMenuBar()
    • init

      private void init()
      Sets up GUI dialog.
    • buildPluginsTree

      private MutableTreeNode buildPluginsTree()
      Starts process to build exact copy of installed plugin structure as tree nodes.
    • createBranch

      private MutableTreeNode createBranch(JMenu menu)
      Helper method for creating sub-menus of the plugin.
    • isPluginSelected

      private boolean isPluginSelected()
      Whether plugins are selected in the JTree, equivalent to whether a leaf is selected in the JTree
    • uninstallPlugins

      private void uninstallPlugins()
    • detectOrphans

      private File[] detectOrphans()
    • deletePluginDependents

      private boolean deletePluginDependents(String name)
    • helpPluginSearch

      private boolean helpPluginSearch(File f, String className)
    • isInPluginFolder

      private boolean isInPluginFolder(String className)
      Determines whether the className is in the plugin folder.
      Parameters:
      className -
      Returns:
    • isInPluginFolder

      private boolean isInPluginFolder(Class c)
      Determines whether c is in the current plugin folder.
      Parameters:
      c -
      Returns:
    • deletePluginFile

      private boolean deletePluginFile(String name)
    • getSelectedPlugins

      private TreeNode[] getSelectedPlugins()
    • getInputStream

      public static InputStream getInputStream(String tarFileName) throws IOException
      DOCUMENT ME!
      Parameters:
      tarFileName - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      IOException - DOCUMENT ME!
    • readTar

      public static void readTar(InputStream in, String untarDir) throws IOException
      DOCUMENT ME!
      Parameters:
      in - DOCUMENT ME!
      untarDir - DOCUMENT ME!
      Throws:
      IOException - DOCUMENT ME!