com.izforge.izpack.installer.gui
Class InstallerFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by com.izforge.izpack.installer.gui.InstallerFrame
All Implemented Interfaces:
InstallerBase, InstallerView, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class InstallerFrame
extends JFrame
implements InstallerBase, InstallerView

The IzPack installer frame.

Author:
Julien Ponge created October 27, 2002, Fabrice Mirabile added fix for alert window on cross button, July 06 2005, Dennis Reil, added RulesEngine November 10 2006, several changes in January 2007, Bill Root added per-panel quit confirmation control, Feb 2015
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JPanel contentPane
          The frame content pane.
protected  ArrayList<GUIListener> guiListener
          Registered GUICreationListener.
protected  JComponent headingCounterComponent
          The heading counter component.
protected  JLabel[] headingLabels
          Heading major text.
protected  JPanel headingPanel
          Panel which contains the heading text and/or icon
protected  JButton helpButton
          The help button.
protected  JPanel panelsContainer
          The panels container.
protected  RulesEngine rules
          conditions
 
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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
InstallerFrame(GUIInstallData installData, RulesEngine rules, IconsDatabase icons, IzPanels panels, UninstallDataWriter uninstallDataWriter, ResourceManager resourceManager, UninstallData uninstallData, Housekeeper housekeeper, DefaultNavigator navigator, Log log, Locales locales)
          Constructs an InstallerFrame.
 
Method Summary
 void addGuiListener(GUIListener listener)
          Add a listener to the listener list.
 void blockGUI()
          Blocks GUI interaction.
 void buildGUI()
          Builds the GUI.
 void centerFrame(Window frame)
          Centers a window on screen.
 void exit()
          Exits the installer, if quit is enabled.
 Debugger getDebugger()
           
 List<GUIListener> getGuiListener()
          Returns the gui creation listener list.
 IconsDatabase getIcons()
           
 Messages getMessages()
          Returns the locale-specific messages.
 Navigator getNavigator()
          Returns the panel navigator.
 Dimension getPanelsContainerSize()
          Returns the panels container size.
 String getTitle()
           
 void install(ProgressListener listener)
          Launches the installation.
 boolean isHeading(IzPanel caller)
          Returns whether this installer frame uses with the given panel a separated heading panel or not.
 void lockNextButton()
          Locks the 'next' button.
 void lockPrevButton()
          Locks the 'previous' button.
 void lockQuitButton()
          Locks the 'Quit' button.
 void navigateNext()
          This function moves to the next panel
 void navigatePrevious()
          This function moves to the previous panel
 void releaseGUI()
          Releases GUI interaction.
 void setIcons(IconsDatabase icons)
           
 void setQuitButtonIcon(String iconName)
          Sets a new icon into the quit button if icons should be used, else nothing will be done.
 void setQuitButtonText(String text)
          Changes the quit button text.
 void setUnpacker(IUnpacker unpacker)
          Sets the unpacker.
 void showHelp()
          Show help Window
 void sizeFrame()
           
 void skipPanel()
          Allows a panel to ask to be skipped.
protected  void switchPanel(IzPanelView newPanel, IzPanelView oldPanel)
          Switches the current panel.
 void unlockNextButton()
          Unlocks the 'next' button.
 void unlockNextButton(boolean requestFocus)
          Unlocks the 'next' button.
 void unlockPrevButton()
          Unlocks the 'previous' button.
 void unlockQuitButton()
          Unlocks the 'Quit' button.
 void updateProgressBar(int maximum, int value, String message)
           
 void updateProgressCounter(String message)
           
protected  void wipeAborted()
          Wipes the written files when you abort the installation.
 void writeInstallationRecord(File file, UninstallData uninstallData)
          Writes the installation record to a file.
 
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, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, 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, transferFocusBackward, 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, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, isOpaque, 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, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, 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

panelsContainer

protected JPanel panelsContainer
The panels container.


contentPane

protected JPanel contentPane
The frame content pane.


helpButton

protected JButton helpButton
The help button.


guiListener

protected final ArrayList<GUIListener> guiListener
Registered GUICreationListener.


headingLabels

protected JLabel[] headingLabels
Heading major text.


headingPanel

protected JPanel headingPanel
Panel which contains the heading text and/or icon


headingCounterComponent

protected JComponent headingCounterComponent
The heading counter component.


rules

protected final RulesEngine rules
conditions

Constructor Detail

InstallerFrame

public InstallerFrame(GUIInstallData installData,
                      RulesEngine rules,
                      IconsDatabase icons,
                      IzPanels panels,
                      UninstallDataWriter uninstallDataWriter,
                      ResourceManager resourceManager,
                      UninstallData uninstallData,
                      Housekeeper housekeeper,
                      DefaultNavigator navigator,
                      Log log,
                      Locales locales)
Constructs an InstallerFrame.

Parameters:
installData - the installation data
rules - the rules engine
icons - the icons database
panels - the panels
uninstallDataWriter - the uninstallation data writer
resourceManager - the resources
uninstallData - the uninstallation data
housekeeper - the house-keeper
navigator - the panel navigator
log - the log
Method Detail

setUnpacker

public void setUnpacker(IUnpacker unpacker)
Sets the unpacker.

Parameters:
unpacker - the unpacker

sizeFrame

public void sizeFrame()
Specified by:
sizeFrame in interface InstallerView

getDebugger

public Debugger getDebugger()

buildGUI

public void buildGUI()
Builds the GUI.


getNavigator

public Navigator getNavigator()
Returns the panel navigator.

Returns:
the panel navigator

switchPanel

protected void switchPanel(IzPanelView newPanel,
                           IzPanelView oldPanel)
Switches the current panel.

Parameters:
newPanel - the new panel
oldPanel - the old panel. May be null

centerFrame

public void centerFrame(Window frame)
Centers a window on screen.

Parameters:
frame - The window tp center.

getPanelsContainerSize

public Dimension getPanelsContainerSize()
Returns the panels container size.

Returns:
The panels container size.

exit

public void exit()
Exits the installer, if quit is enabled.

If installation is complete, this writes any uninstallation data, and shuts down. If installation is incomplete, a confirmation dialog will be displayed.


wipeAborted

protected void wipeAborted()
Wipes the written files when you abort the installation.


install

public void install(ProgressListener listener)
Launches the installation.

Parameters:
listener - The installation listener.

writeInstallationRecord

public void writeInstallationRecord(File file,
                                    UninstallData uninstallData)
                             throws Exception
Writes the installation record to a file.

Specified by:
writeInstallationRecord in interface InstallerBase
Parameters:
file - The file to write to.
uninstallData - The uninstall data.
Throws:
Exception - Description of the Exception

setQuitButtonText

public void setQuitButtonText(String text)
Changes the quit button text. If text is null, the default quit text is used.

Parameters:
text - text to be used for changes

setQuitButtonIcon

public void setQuitButtonIcon(String iconName)
Sets a new icon into the quit button if icons should be used, else nothing will be done.

Parameters:
iconName - name of the icon to be used

blockGUI

public void blockGUI()
Blocks GUI interaction.


releaseGUI

public void releaseGUI()
Releases GUI interaction.


lockPrevButton

public void lockPrevButton()
Locks the 'previous' button.

Specified by:
lockPrevButton in interface InstallerView

lockNextButton

public void lockNextButton()
Locks the 'next' button.

Specified by:
lockNextButton in interface InstallerView

lockQuitButton

public void lockQuitButton()
Locks the 'Quit' button.

Specified by:
lockQuitButton in interface InstallerView

unlockPrevButton

public void unlockPrevButton()
Unlocks the 'previous' button.

Specified by:
unlockPrevButton in interface InstallerView

unlockNextButton

public void unlockNextButton()
Unlocks the 'next' button.

Specified by:
unlockNextButton in interface InstallerView

unlockQuitButton

public void unlockQuitButton()
Unlocks the 'Quit' button.

Specified by:
unlockQuitButton in interface InstallerView

unlockNextButton

public void unlockNextButton(boolean requestFocus)
Unlocks the 'next' button.

Specified by:
unlockNextButton in interface InstallerView
Parameters:
requestFocus - if true focus goes to nextButton

skipPanel

public void skipPanel()
Allows a panel to ask to be skipped.


navigateNext

public void navigateNext()
This function moves to the next panel

Specified by:
navigateNext in interface InstallerView

navigatePrevious

public void navigatePrevious()
This function moves to the previous panel

Specified by:
navigatePrevious in interface InstallerView

showHelp

public void showHelp()
Show help Window

Specified by:
showHelp in interface InstallerView

getMessages

public Messages getMessages()
Returns the locale-specific messages.

Returns:
the messages

getIcons

public IconsDatabase getIcons()

setIcons

public void setIcons(IconsDatabase icons)

getGuiListener

public List<GUIListener> getGuiListener()
Returns the gui creation listener list.

Returns:
the gui creation listener list

addGuiListener

public void addGuiListener(GUIListener listener)
Add a listener to the listener list.

Parameters:
listener - to be added as gui creation listener

isHeading

public boolean isHeading(IzPanel caller)
Returns whether this installer frame uses with the given panel a separated heading panel or not. Be aware, this is an other heading as given by the IzPanel which will be placed in the IzPanel. This heading will be placed if the gui preferences contains an modifier with the key "useHeadingPanel" and the value "yes" and there is a message with the key "<class name>.headline".

Parameters:
caller - the IzPanel for which heading should be resolved
Returns:
whether an heading panel will be used or not

updateProgressCounter

public void updateProgressCounter(String message)

updateProgressBar

public void updateProgressBar(int maximum,
                              int value,
                              String message)

getTitle

public String getTitle()
Overrides:
getTitle in class Frame


Copyright © 2018. All rights reserved.