Class InstallPear

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class InstallPear extends JFrame
This GUI is used to install a pear file locally in a directory chosen by the user and then run the installed AE in CVD.
The required field is : The pear file must be specified. The User may or may not specify the installation directory. If the installation directory is not specified, the current working directory is used by default.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • pearFileTextField

      private JTextField pearFileTextField
    • browseButton

      private JButton browseButton
    • installDirTextField

      private static JTextField installDirTextField
    • browseDirButton

      private JButton browseDirButton
    • installButton

      private JButton installButton
    • fileMenuItem

      private JMenuItem fileMenuItem
    • helpMenuItem

      private JMenuItem helpMenuItem
    • aboutMenuItem

      private JMenuItem aboutMenuItem
    • fileMenu

      private JMenu fileMenu
    • helpMenu

      private JMenu helpMenu
    • runButton

      private static JButton runButton
    • helpButton

      private JButton helpButton
    • pearConsole

      private static JTextArea pearConsole
    • jScrollPane

      private static JScrollPane jScrollPane
    • localTearFile

      private static File localTearFile
    • installationDir

      private static File installationDir
    • mainComponentId

      private static String mainComponentId
    • insdObject

      private static InstallationDescriptor insdObject
    • mainComponentRootPath

      private static String mainComponentRootPath
    • helpExists

      private static boolean helpExists
    • message

      private static String message
    • errorFlag

      private static boolean errorFlag
    • userPrefs

      private static Preferences userPrefs
    • LAST_FILE_NAME_CHOOSEN_KEY

      private static final String LAST_FILE_NAME_CHOOSEN_KEY
      See Also:
    • LAST_DIRECTORY_CHOOSEN_KEY

      private static final String LAST_DIRECTORY_CHOOSEN_KEY
      See Also:
    • SET_ENV_FILE

      private static final String SET_ENV_FILE
      See Also:
  • Constructor Details

    • InstallPear

      public InstallPear()
      This is the default constructor.
  • Method Details

    • selectPear

      private String selectPear()
      Opens a dialog to select a PEAR file from the local file system.
      Returns:
      Selected PEAR file path, or null, if nothing was selected.
    • selectDir

      private String selectDir()
      Opens a dialog to select a directory for PEAR file installation.
      Returns:
      Selected installation directory path, or current directory path, if nothing was selected.
    • installPear

      private static void installPear(File localPearFile, File installationDir)
      Method that installs the given PEAR file to the given installation directory.
      Parameters:
      localPearFile - The given PEAR file path.
      installationDir - The given installation directory.
    • runCVD

      private void runCVD()
      This method runs the installed AE in CVD (Gladis).
      Throws:
      IOException - If any I/O exception occurred.
    • getPearFileTextField

      private JTextField getPearFileTextField()
      This method initializes the pearFile TextField.
      Returns:
      The initialized pearFile TextField.
    • getbrowseButton

      private JButton getbrowseButton()
      This method initializes the Browse Button.
      Returns:
      The initialized Browse Button.
    • getInstallDirTextField

      private JTextField getInstallDirTextField()
      This method initializes installDirTextField.
      Returns:
      The initialized installDirTextField.
    • getBrowseDirButton

      private JButton getBrowseDirButton()
      This method initializes the browseDir Button.
      Returns:
      The initialized browseDir Button.
    • getInstallButton

      private JButton getInstallButton()
      This method initializes the Install Button.
      Returns:
      The initialized Install Button.
    • getRunButton

      private JButton getRunButton()
      This method initializes 'Run your AE in CVD' Button.
      Returns:
      The initialized 'Run your AE in CVD' Button.
    • getPearConsole

      private JTextArea getPearConsole()
      This method initializes pearConsole.
      Returns:
      The initialized pearConsole.
    • printInConsole

      private static void printInConsole(boolean errorFlag, String message)
      Prints messages and set foreground color in the console according to a given errorFlag.
      Parameters:
      errorFlag - The given error flag.
      message - The given message to print.
    • getJScrollPane

      private JScrollPane getJScrollPane()
      This method initializes the Scroll Pane.
      Returns:
      The initialized Scroll Pane.
    • getHelpButton

      private JButton getHelpButton()
      This method initializes the help Button.
      Returns:
      The initialized help Button.
    • createAndShowGUI

      private static void createAndShowGUI()
      Method to create and display the frame.
    • main

      public static void main(String[] args)
      Starts the GUI application.
      Parameters:
      args - None.
    • initialize

      private void initialize()
      This method initializes the frame.