com.izforge.izpack.installer.gui
Class DefaultNavigator

java.lang.Object
  extended by com.izforge.izpack.installer.gui.DefaultNavigator
All Implemented Interfaces:
Navigator

public class DefaultNavigator
extends Object
implements Navigator

Default implementation of Navigator.

Author:
Tim Anderson

Constructor Summary
DefaultNavigator(Panels panels, IconsDatabase icons, GUIInstallData installData)
          Constructs a DefaultNavigator.
 
Method Summary
protected  JButton getNext()
          Returns the button to navigate to the next panel.
protected  JButton getPrevious()
          Returns the button to navigate to the previous panel.
protected  JButton getQuit()
          Returns the button to quit installation.
 boolean isNextEnabled()
          Determines if the next panel may be navigated to.
 boolean isPreviousEnabled()
          Determines if the previous panel may be navigated to.
 boolean isQuitEnabled()
          Determines if the 'quit' button is enabled.
 boolean next()
          Navigates to the next panel.
 boolean next(boolean validate)
          Navigates to the next panel.
 boolean previous()
          Navigates to the previous panel.
 void quit()
          Quits installation, if quit is enabled, and installation is complete.
 void reserveNavigatorButtonMnemonics()
          Call to reserve mnemonics for the buttons used by the navigator.
protected  JButton setDefaultButton()
          Sets the default button.
 void setInstallerFrame(InstallerFrame frame)
          Registers the parent installer frame.
 void setNextEnabled(boolean enable)
          Determines if the next panel may be navigated to.
 void setNextIcon(Icon icon)
          Sets the icon for the 'next' button.
 void setNextText(String text)
          Sets the text for the 'next' button.
 void setNextVisible(boolean visible)
          Makes the next button visible or invisible.
 void setPreviousEnabled(boolean enable)
          Determines if the previous panel may be navigated to.
 void setPreviousIcon(Icon icon)
          Sets the icon for the 'previous' button.
 void setPreviousText(String text)
          Sets the text for the 'previous' button.
 void setPreviousVisible(boolean visible)
          Makes the previous button visible/invisible.
 void setQuitEnabled(boolean enable)
          Determines if the 'quit' button is enabled.
 void setQuitIcon(Icon icon)
          Sets the icon for the 'quit' button.
 void setQuitText(String text)
          Sets the text for the 'quit' button.
 void setQuitVisible(boolean visible)
          Makes the 'quit' button visible/invisible.
protected  void updateButtonText(Messages messages)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNavigator

public DefaultNavigator(Panels panels,
                        IconsDatabase icons,
                        GUIInstallData installData)
Constructs a DefaultNavigator.

Parameters:
panels - the panels
icons - the icons
installData - the installation data
Method Detail

updateButtonText

protected void updateButtonText(Messages messages)

reserveNavigatorButtonMnemonics

public void reserveNavigatorButtonMnemonics()
Call to reserve mnemonics for the buttons used by the navigator.


setInstallerFrame

public void setInstallerFrame(InstallerFrame frame)
Registers the parent installer frame.

This should be invoked before using any other methods.

Parameters:
frame - the frame.

isNextEnabled

public boolean isNextEnabled()
Determines if the next panel may be navigated to.

Specified by:
isNextEnabled in interface Navigator
Returns:
true if the next panel may be navigated to

setNextEnabled

public void setNextEnabled(boolean enable)
Determines if the next panel may be navigated to.

Specified by:
setNextEnabled in interface Navigator
Parameters:
enable - if true, enable navigation, otherwise disable it

setNextVisible

public void setNextVisible(boolean visible)
Makes the next button visible or invisible.

Specified by:
setNextVisible in interface Navigator
Parameters:
visible - if true makes the button visible, otherwise makes it invisible.

setNextText

public void setNextText(String text)
Sets the text for the 'next' button.

Specified by:
setNextText in interface Navigator
Parameters:
text - the button text. May be null

setNextIcon

public void setNextIcon(Icon icon)
Sets the icon for the 'next' button.

Specified by:
setNextIcon in interface Navigator
Parameters:
icon - the icon. May be null

isPreviousEnabled

public boolean isPreviousEnabled()
Determines if the previous panel may be navigated to.

Specified by:
isPreviousEnabled in interface Navigator
Returns:
true if the previous panel may be navigated to

setPreviousEnabled

public void setPreviousEnabled(boolean enable)
Determines if the previous panel may be navigated to.

Specified by:
setPreviousEnabled in interface Navigator
Parameters:
enable - if true, enable navigation, otherwise disable it

setPreviousVisible

public void setPreviousVisible(boolean visible)
Makes the previous button visible/invisible.

Specified by:
setPreviousVisible in interface Navigator
Parameters:
visible - if true makes the button visible, otherwise makes it invisible.

setPreviousText

public void setPreviousText(String text)
Sets the text for the 'previous' button.

Specified by:
setPreviousText in interface Navigator
Parameters:
text - the button text. May be null

setPreviousIcon

public void setPreviousIcon(Icon icon)
Sets the icon for the 'previous' button.

Specified by:
setPreviousIcon in interface Navigator
Parameters:
icon - the icon. May be null

isQuitEnabled

public boolean isQuitEnabled()
Determines if the 'quit' button is enabled.

Specified by:
isQuitEnabled in interface Navigator
Returns:
true if the 'quit' button is enabled

setQuitEnabled

public void setQuitEnabled(boolean enable)
Determines if the 'quit' button is enabled.

Specified by:
setQuitEnabled in interface Navigator
Parameters:
enable - if true, enable quit, otherwise disable it

setQuitVisible

public void setQuitVisible(boolean visible)
Makes the 'quit' button visible/invisible.

Specified by:
setQuitVisible in interface Navigator
Parameters:
visible - if true makes the button visible, otherwise makes it invisible.

setQuitText

public void setQuitText(String text)
Sets the text for the 'quit' button.

Specified by:
setQuitText in interface Navigator
Parameters:
text - the button text. May be null

setQuitIcon

public void setQuitIcon(Icon icon)
Sets the icon for the 'quit' button.

Specified by:
setQuitIcon in interface Navigator
Parameters:
icon - the icon. May be null

next

public boolean next()
Navigates to the next panel.

Specified by:
next in interface Navigator
Returns:
true if the next panel was displayed, or false if the last panel is displayed

next

public boolean next(boolean validate)
Navigates to the next panel.

Parameters:
validate - if true, only move to the next panel if validation succeeds
Returns:
true if the next panel was navigated to

previous

public boolean previous()
Navigates to the previous panel.

Specified by:
previous in interface Navigator
Returns:
true if the previous panel was displayed, or false if the first panel is displayed

quit

public void quit()
Quits installation, if quit is enabled, and installation is complete.

This method does not return if the quit is accepted.

Specified by:
quit in interface Navigator

getNext

protected JButton getNext()
Returns the button to navigate to the next panel.

Returns:
the 'next' button

getPrevious

protected JButton getPrevious()
Returns the button to navigate to the previous panel.

Returns:
the 'previous' button

getQuit

protected JButton getQuit()
Returns the button to quit installation.

Returns:
the 'quit' button

setDefaultButton

protected JButton setDefaultButton()
Sets the default button.

This sets the default to the "next" button if it is enabled. If not it sets it to the "quit" button, if it is enabled.

Returns:
the default button, or null if the buttons aren't enabled


Copyright © 2018. All rights reserved.