Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.customcontrols.wizard
Class WizardModel

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.customcontrols.wizard.WizardModel

public class WizardModel
extends Object

The model for the Wizard component, which tracks the text, icons, and enabled state of each of the buttons, as well as the current panel that is displayed. Note that the model, in its current form, is not intended to be sub-classed.

Author:
Yana Stamcheva

Field Summary
static String BACK_BUTTON_ENABLED_PROPERTY
          Property identification String for the Back button's enabled state
static String BACK_BUTTON_ICON_PROPERTY
          Property identification String for the Back button's icon
static String BACK_BUTTON_TEXT_PROPERTY
          Property identification String for the Back button's text
static String CANCEL_BUTTON_ENABLED_PROPERTY
          Property identification String for the Cancel button's enabled state
static String CANCEL_BUTTON_ICON_PROPERTY
          Property identification String for the Cancel button's icon
static String CANCEL_BUTTON_TEXT_PROPERTY
          Property identification String for the Cancel button's text
static String CURRENT_PAGE_PROPERTY
          Identification string for the current panel.
static String NEXT_FINISH_BUTTON_ENABLED_PROPERTY
          Property identification String for the Next button's enabled state
static String NEXT_FINISH_BUTTON_ICON_PROPERTY
          Property identification String for the Next button's icon
static String NEXT_FINISH_BUTTON_TEXT_PROPERTY
          Property identification String for the Next button's text
 
Constructor Summary
WizardModel()
          Default constructor.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener p)
          Adds a PropertyChangeListener
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Informs allPropertyChangeListeners that the a given property has changed.
(package private)  Iterator<Map.Entry<Object,WizardPage>> getAllPages()
           
(package private)  Boolean getBackButtonEnabled()
          Checks if the Back button is enabled.
(package private)  Icon getBackButtonIcon()
          Returns the icon for the Back button.
(package private)  Object getBackButtonText()
          Returns the text for the Back button.
(package private)  Boolean getCancelButtonEnabled()
          Checks if the Cancel button is enabled.
(package private)  Icon getCancelButtonIcon()
          Returns the icon for the Cancel button.
(package private)  Object getCancelButtonText()
          Returns the text for the Cancel button.
(package private)  WizardPage getCurrentWizardPage()
          Returns the currently displayed WizardPage.
(package private)  Boolean getNextFinishButtonEnabled()
          Checks if the Next/Finish button is enabled.
(package private)  Icon getNextFinishButtonIcon()
          Returns the icon for the Next/Finish button.
(package private)  Object getNextFinishButtonText()
          Returns the text for the Next/Finish button.
(package private)  WizardPage getWizardPage(Object id)
          Returns the WizardPage corresponding to the given identifier.
(package private)  void registerPage(Object id, WizardPage page)
          Registers the WizardPage in the model using the Object-identifier specified.
 void removePropertyChangeListener(PropertyChangeListener p)
          Removes a PropertyChangeListener
(package private)  void setBackButtonEnabled(boolean enabled)
          Enables or disables the Back button.
(package private)  void setBackButtonIcon(Icon newIcon)
          Sets the icon for the Back button.
(package private)  void setBackButtonText(Object newText)
          Sets the text for the back button.
(package private)  void setCancelButtonEnabled(boolean enabled)
          Enables or disables the Cancel button.
(package private)  void setCancelButtonIcon(Icon newIcon)
          Sets the icon for the Cancel button.
(package private)  void setCancelButtonText(Object newText)
          Sets the text for the Cancel button.
(package private)  boolean setCurrentPanel(Object id)
          Sets the current panel to that identified by the Object passed in.
(package private)  void setNextFinishButtonEnabled(boolean enabled)
          Enables or disables the Next/Finish button.
 void setNextFinishButtonIcon(Icon newIcon)
          Sets the icon for the Next/Finish button.
(package private)  void setNextFinishButtonText(Object newText)
           
(package private)  void unregisterPage(Object id)
          Unregisters the WizardPage corresponding to the given id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT_PAGE_PROPERTY

public static final String CURRENT_PAGE_PROPERTY
Identification string for the current panel.

See Also:
Constant Field Values

BACK_BUTTON_TEXT_PROPERTY

public static final String BACK_BUTTON_TEXT_PROPERTY
Property identification String for the Back button's text

See Also:
Constant Field Values

BACK_BUTTON_ICON_PROPERTY

public static final String BACK_BUTTON_ICON_PROPERTY
Property identification String for the Back button's icon

See Also:
Constant Field Values

BACK_BUTTON_ENABLED_PROPERTY

public static final String BACK_BUTTON_ENABLED_PROPERTY
Property identification String for the Back button's enabled state

See Also:
Constant Field Values

NEXT_FINISH_BUTTON_TEXT_PROPERTY

public static final String NEXT_FINISH_BUTTON_TEXT_PROPERTY
Property identification String for the Next button's text

See Also:
Constant Field Values

NEXT_FINISH_BUTTON_ICON_PROPERTY

public static final String NEXT_FINISH_BUTTON_ICON_PROPERTY
Property identification String for the Next button's icon

See Also:
Constant Field Values

NEXT_FINISH_BUTTON_ENABLED_PROPERTY

public static final String NEXT_FINISH_BUTTON_ENABLED_PROPERTY
Property identification String for the Next button's enabled state

See Also:
Constant Field Values

CANCEL_BUTTON_TEXT_PROPERTY

public static final String CANCEL_BUTTON_TEXT_PROPERTY
Property identification String for the Cancel button's text

See Also:
Constant Field Values

CANCEL_BUTTON_ICON_PROPERTY

public static final String CANCEL_BUTTON_ICON_PROPERTY
Property identification String for the Cancel button's icon

See Also:
Constant Field Values

CANCEL_BUTTON_ENABLED_PROPERTY

public static final String CANCEL_BUTTON_ENABLED_PROPERTY
Property identification String for the Cancel button's enabled state

See Also:
Constant Field Values
Constructor Detail

WizardModel

public WizardModel()
Default constructor.

Method Detail

getCurrentWizardPage

WizardPage getCurrentWizardPage()
Returns the currently displayed WizardPage.

Returns:
The currently displayed WizardPage

registerPage

void registerPage(Object id,
                  WizardPage page)
Registers the WizardPage in the model using the Object-identifier specified.

Parameters:
id - Object-based identifier
page - WizardPage that describes the panel

unregisterPage

void unregisterPage(Object id)
Unregisters the WizardPage corresponding to the given id.

Parameters:
id - The id of the WizardPage.

getWizardPage

WizardPage getWizardPage(Object id)
Returns the WizardPage corresponding to the given identifier.

Parameters:
id - The identifier of the page.
Returns:
the WizardPage corresponding to the given identifier.

getAllPages

Iterator<Map.Entry<Object,WizardPage>> getAllPages()

setCurrentPanel

boolean setCurrentPanel(Object id)
Sets the current panel to that identified by the Object passed in.

Parameters:
id - Object-based panel identifier
Returns:
boolean indicating success or failure

getBackButtonText

Object getBackButtonText()
Returns the text for the Back button.

Returns:
the text for the Back button.

setBackButtonText

void setBackButtonText(Object newText)
Sets the text for the back button.

Parameters:
newText - The text to set.

getNextFinishButtonText

Object getNextFinishButtonText()
Returns the text for the Next/Finish button.

Returns:
the text for the Next/Finish button.

setNextFinishButtonText

void setNextFinishButtonText(Object newText)

getCancelButtonText

Object getCancelButtonText()
Returns the text for the Cancel button.

Returns:
the text for the Cancel button.

setCancelButtonText

void setCancelButtonText(Object newText)
Sets the text for the Cancel button.

Parameters:
newText - The text to set.

getBackButtonIcon

Icon getBackButtonIcon()
Returns the icon for the Back button.

Returns:
the icon for the Back button.

setBackButtonIcon

void setBackButtonIcon(Icon newIcon)
Sets the icon for the Back button.

Parameters:
newIcon - The new icon to set.

getNextFinishButtonIcon

Icon getNextFinishButtonIcon()
Returns the icon for the Next/Finish button.

Returns:
the icon for the Next/Finish button.

setNextFinishButtonIcon

public void setNextFinishButtonIcon(Icon newIcon)
Sets the icon for the Next/Finish button.

Parameters:
newIcon - The new icon to set.

getCancelButtonIcon

Icon getCancelButtonIcon()
Returns the icon for the Cancel button.

Returns:
the icon for the Cancel button.

setCancelButtonIcon

void setCancelButtonIcon(Icon newIcon)
Sets the icon for the Cancel button.

Parameters:
newIcon - The new icon to set.

getBackButtonEnabled

Boolean getBackButtonEnabled()
Checks if the Back button is enabled.

Returns:
true if the Back button is enabled, false otherwise.

setBackButtonEnabled

void setBackButtonEnabled(boolean enabled)
Enables or disables the Back button.

Parameters:
enabled - true to enable the Back button, false to disable it.

getNextFinishButtonEnabled

Boolean getNextFinishButtonEnabled()
Checks if the Next/Finish button is enabled.

Returns:
true if the Next/Finish button is enabled, false otherwise.

setNextFinishButtonEnabled

void setNextFinishButtonEnabled(boolean enabled)
Enables or disables the Next/Finish button.

Parameters:
enabled - true to enable the Next/Finish button, false to disable it.

getCancelButtonEnabled

Boolean getCancelButtonEnabled()
Checks if the Cancel button is enabled.

Returns:
true if the Cancel button is enabled, false otherwise.

setCancelButtonEnabled

void setCancelButtonEnabled(boolean enabled)
Enables or disables the Cancel button.

Parameters:
enabled - true to enable the Cancel button, false to disable it.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener p)
Adds a PropertyChangeListener

Parameters:
p - The PropertyChangeListener to add.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener p)
Removes a PropertyChangeListener

Parameters:
p - The PropertyChangeListener to remove.

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Informs allPropertyChangeListeners that the a given property has changed.

Parameters:
propertyName - The name of the property.
oldValue - The old property value.
newValue - The new property value.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.