Class InstallPear

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class InstallPear
    extends javax.swing.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:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  InstallPear.PEARFilter
      The PEARFilter class allows to filter directories, as well as '.tear' and '.pear' files.
      protected static class  InstallPear.RunInstallation
      The RunInstallation class implements a thread that is used to run the installation.
      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.swing.JMenuItem aboutMenuItem
      The about menu item.
      private javax.swing.JButton browseButton
      The browse button.
      private javax.swing.JButton browseDirButton
      The browse dir button.
      private static boolean errorFlag
      The error flag.
      private javax.swing.JMenu fileMenu
      The file menu.
      private javax.swing.JMenuItem fileMenuItem
      The file menu item.
      private javax.swing.JButton helpButton
      The help button.
      private static boolean helpExists
      The help exists.
      private javax.swing.JMenu helpMenu
      The help menu.
      private javax.swing.JMenuItem helpMenuItem
      The help menu item.
      private static InstallationDescriptor insdObject
      The insd object.
      private static java.io.File installationDir
      The installation dir.
      private javax.swing.JButton installButton
      The install button.
      private static javax.swing.JTextField installDirTextField
      The install dir text field.
      private static javax.swing.JScrollPane jScrollPane
      The j scroll pane.
      private static java.lang.String LAST_DIRECTORY_CHOOSEN_KEY
      The Constant LAST_DIRECTORY_CHOOSEN_KEY.
      private static java.lang.String LAST_FILE_NAME_CHOOSEN_KEY
      The Constant LAST_FILE_NAME_CHOOSEN_KEY.
      private static java.io.File localTearFile
      The local tear file.
      private static java.lang.String mainComponentId
      The main component id.
      private static java.lang.String mainComponentRootPath
      The main component root path.
      private javax.swing.JMenuBar menuBar
      The menu bar.
      private static java.lang.String message
      The message.
      private static javax.swing.JTextArea pearConsole
      The pear console.
      private javax.swing.JTextField pearFileTextField
      The pear file text field.
      private static javax.swing.JButton runButton
      The run button.
      private static long serialVersionUID
      The Constant serialVersionUID.
      private static java.lang.String SET_ENV_FILE
      The Constant SET_ENV_FILE.
      private static java.util.prefs.Preferences userPrefs
      The user prefs.
      • Fields inherited from class javax.swing.JFrame

        accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
      • Fields inherited from class java.awt.Frame

        CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
    • Constructor Summary

      Constructors 
      Constructor Description
      InstallPear()
      This is the default constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void createAndShowGUI()
      Method to create and display the frame.
      private javax.swing.JButton getbrowseButton()
      This method initializes the Browse Button.
      private javax.swing.JButton getBrowseDirButton()
      This method initializes the browseDir Button.
      private javax.swing.JButton getHelpButton()
      This method initializes the help Button.
      private javax.swing.JButton getInstallButton()
      This method initializes the Install Button.
      private javax.swing.JTextField getInstallDirTextField()
      This method initializes installDirTextField.
      private javax.swing.JScrollPane getJScrollPane()
      This method initializes the Scroll Pane.
      private javax.swing.JTextArea getPearConsole()
      This method initializes pearConsole.
      private javax.swing.JTextField getPearFileTextField()
      This method initializes the pearFile TextField.
      private javax.swing.JButton getRunButton()
      This method initializes 'Run your AE in CVD' Button.
      private void initialize()
      This method initializes the frame.
      private static void installPear​(java.io.File localPearFile, java.io.File installationDir)
      Method that installs the given PEAR file to the given installation directory.
      static void main​(java.lang.String[] args)
      Starts the GUI application.
      private static void printInConsole​(boolean errorFlag, java.lang.String message)
      Prints messages and set foreground color in the console according to a given errorFlag.
      private void runCVD()
      This method runs the installed AE in CVD (Gladis).
      private java.lang.String selectDir()
      Opens a dialog to select a directory for PEAR file installation.
      private java.lang.String selectPear()
      Opens a dialog to select a PEAR file from the local file system.
      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        The Constant serialVersionUID.
        See Also:
        Constant Field Values
      • pearFileTextField

        private javax.swing.JTextField pearFileTextField
        The pear file text field.
      • browseButton

        private javax.swing.JButton browseButton
        The browse button.
      • installDirTextField

        private static javax.swing.JTextField installDirTextField
        The install dir text field.
      • browseDirButton

        private javax.swing.JButton browseDirButton
        The browse dir button.
      • installButton

        private javax.swing.JButton installButton
        The install button.
      • menuBar

        private javax.swing.JMenuBar menuBar
        The menu bar.
      • fileMenuItem

        private javax.swing.JMenuItem fileMenuItem
        The file menu item.
      • helpMenuItem

        private javax.swing.JMenuItem helpMenuItem
        The help menu item.
      • aboutMenuItem

        private javax.swing.JMenuItem aboutMenuItem
        The about menu item.
      • fileMenu

        private javax.swing.JMenu fileMenu
        The file menu.
      • helpMenu

        private javax.swing.JMenu helpMenu
        The help menu.
      • runButton

        private static javax.swing.JButton runButton
        The run button.
      • helpButton

        private javax.swing.JButton helpButton
        The help button.
      • pearConsole

        private static javax.swing.JTextArea pearConsole
        The pear console.
      • jScrollPane

        private static javax.swing.JScrollPane jScrollPane
        The j scroll pane.
      • localTearFile

        private static java.io.File localTearFile
        The local tear file.
      • installationDir

        private static java.io.File installationDir
        The installation dir.
      • mainComponentId

        private static java.lang.String mainComponentId
        The main component id.
      • mainComponentRootPath

        private static java.lang.String mainComponentRootPath
        The main component root path.
      • helpExists

        private static boolean helpExists
        The help exists.
      • message

        private static java.lang.String message
        The message.
      • errorFlag

        private static boolean errorFlag
        The error flag.
      • userPrefs

        private static java.util.prefs.Preferences userPrefs
        The user prefs.
      • LAST_FILE_NAME_CHOOSEN_KEY

        private static final java.lang.String LAST_FILE_NAME_CHOOSEN_KEY
        The Constant LAST_FILE_NAME_CHOOSEN_KEY.
        See Also:
        Constant Field Values
      • LAST_DIRECTORY_CHOOSEN_KEY

        private static final java.lang.String LAST_DIRECTORY_CHOOSEN_KEY
        The Constant LAST_DIRECTORY_CHOOSEN_KEY.
        See Also:
        Constant Field Values
      • SET_ENV_FILE

        private static final java.lang.String SET_ENV_FILE
        The Constant SET_ENV_FILE.
        See Also:
        Constant Field Values
    • Constructor Detail

      • InstallPear

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

      • selectPear

        private java.lang.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 java.lang.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​(java.io.File localPearFile,
                                        java.io.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).
      • getPearFileTextField

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

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

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

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

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

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

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

        private static void printInConsole​(boolean errorFlag,
                                           java.lang.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 javax.swing.JScrollPane getJScrollPane()
        This method initializes the Scroll Pane.
        Returns:
        The initialized Scroll Pane.
      • getHelpButton

        private javax.swing.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​(java.lang.String[] args)
        Starts the GUI application.
        Parameters:
        args - None.
      • initialize

        private void initialize()
        This method initializes the frame.