Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.dictaccregwizz
Class FirstWizardPage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by net.java.sip.communicator.util.swing.TransparentPanel
                      extended by net.java.sip.communicator.plugin.dictaccregwizz.FirstWizardPage
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, DocumentListener, WizardPage

public class FirstWizardPage
extends TransparentPanel
implements WizardPage, DocumentListener, ActionListener

The FirstWizardPage is the page, where user could enter the host, port and the strategy of the account.

Author:
ROTH Damien, LITZELMANN Cedric
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
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
static String FIRST_PAGE_IDENTIFIER
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface net.java.sip.communicator.service.gui.WizardPage
DEFAULT_PAGE_IDENTIFIER, FINISH_PAGE_IDENTIFIER, SUMMARY_PAGE_IDENTIFIER
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FirstWizardPage(DictAccountRegistrationWizard wizard)
          Creates an instance of FirstWizardPage.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Handles the action of the button.
 void autoSelectStrategy()
          Automatic selection of a strategy
 void changedUpdate(DocumentEvent e)
          Handles the DocumentEvent triggered when user changes an attribute or set of attributes from the UIN field.
 void commitPage()
          Saves the user input when the "Next" wizard buttons is clicked.
 Object getBackPageIdentifier()
          Implements the WizardPage.getBackPageIdentifier to return the back identifier, which is null as this is the first wizard page.
 Object getIdentifier()
          Implements the WizardPage.getIdentifier to return this page identifier.
 Object getNextPageIdentifier()
          Implements the WizardPage.getNextPageIdentifier to return the next page identifier - the summary page.
 Object getSimpleForm()
           
 Object getWizardForm()
          Implements the WizardPage.getWizardForm to return this panel.
 void insertUpdate(DocumentEvent e)
          Handles the DocumentEvent triggered when user types in the UIN field.
 boolean isCommitted()
           
 boolean isFirstAccount()
          Indicates if this is the first dict account
 void loadAccount(ProtocolProviderService protocolProvider)
          Fills the Host, Port and Strategy fields in this panel with the data comming from the given protocolProvider.
 void pageBack()
          Invoked when user clicks on the "Back" wizard button.
 void pageHiding()
          Invoked when this WizardPage will be hidden eighter because the user has clicked "Back" or "Next".
 void pageShowing()
          Before this page is displayed enables or disables the "Next" wizard button according to whether the UIN field is empty.
 void pageShown()
          Invoked when this WizardPage will be shown eighter because the user has clicked "Back" on the next wizard page or "Next" on the previous one.
 void populateStrategies()
          Start the thread which will populate the Strategies List
 void progressMessage(String message)
          Informs the user of the current status of the search Should only be called by the thread
 void removeUpdate(DocumentEvent e)
          Handles the DocumentEvent triggered when user deletes letters from the UIN field.
 void setStrategies(List<net.java.dict4j.Strategy> strategies)
           
 void setStrategyButtonEnable(boolean e)
          Enables or disable the Next Button and the Strategy Button
 void strategiesSearchComplete()
          Informs the wizard that the search of the strategies is complete.
 void strategiesSearchFailure(String reason, net.java.dict4j.DictException de)
          Informs the wizard that the search of the strategies is a failure Should only be called by the thread
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIRST_PAGE_IDENTIFIER

public static final String FIRST_PAGE_IDENTIFIER
See Also:
Constant Field Values
Constructor Detail

FirstWizardPage

public FirstWizardPage(DictAccountRegistrationWizard wizard)
Creates an instance of FirstWizardPage.

Parameters:
wizard - the parent wizard
Method Detail

getIdentifier

public Object getIdentifier()
Implements the WizardPage.getIdentifier to return this page identifier.

Specified by:
getIdentifier in interface WizardPage
Returns:
Returns the identifier of the current (the first) page of the wizard.

getNextPageIdentifier

public Object getNextPageIdentifier()
Implements the WizardPage.getNextPageIdentifier to return the next page identifier - the summary page.

Specified by:
getNextPageIdentifier in interface WizardPage
Returns:
Returns the identifier of the next page of the wizard.

getBackPageIdentifier

public Object getBackPageIdentifier()
Implements the WizardPage.getBackPageIdentifier to return the back identifier, which is null as this is the first wizard page.

Specified by:
getBackPageIdentifier in interface WizardPage
Returns:
the identifier of the previous page of the wizard.

getWizardForm

public Object getWizardForm()
Implements the WizardPage.getWizardForm to return this panel.

Specified by:
getWizardForm in interface WizardPage
Returns:
Returns this form of the wizard.

pageShowing

public void pageShowing()
Before this page is displayed enables or disables the "Next" wizard button according to whether the UIN field is empty.

Specified by:
pageShowing in interface WizardPage

commitPage

public void commitPage()
Saves the user input when the "Next" wizard buttons is clicked.

Specified by:
commitPage in interface WizardPage

insertUpdate

public void insertUpdate(DocumentEvent e)
Handles the DocumentEvent triggered when user types in the UIN field. Enables or disables the "Next" wizard button according to whether the UIN field is empty.

Specified by:
insertUpdate in interface DocumentListener
Parameters:
e - the DocumentEvent triggered when user types in the UIN field.

removeUpdate

public void removeUpdate(DocumentEvent e)
Handles the DocumentEvent triggered when user deletes letters from the UIN field. Enables or disables the "Next" wizard button according to whether the UIN field is empty.

Specified by:
removeUpdate in interface DocumentListener
Parameters:
e - The DocumentEvent triggered when user deletes letters from the UIN field.

changedUpdate

public void changedUpdate(DocumentEvent e)
Handles the DocumentEvent triggered when user changes an attribute or set of attributes from the UIN field. Currently this notification has no effect and is just here to implement the DocumentListener interface.

Specified by:
changedUpdate in interface DocumentListener
Parameters:
e - The DocumentEvent triggered when an attribute or set of attributes changed from the UIN field.

pageHiding

public void pageHiding()
Invoked when this WizardPage will be hidden eighter because the user has clicked "Back" or "Next". This function has no effect.

Specified by:
pageHiding in interface WizardPage

pageShown

public void pageShown()
Invoked when this WizardPage will be shown eighter because the user has clicked "Back" on the next wizard page or "Next" on the previous one. This function has no effect.

Specified by:
pageShown in interface WizardPage

pageBack

public void pageBack()
Invoked when user clicks on the "Back" wizard button. This function has no effect.

Specified by:
pageBack in interface WizardPage

loadAccount

public void loadAccount(ProtocolProviderService protocolProvider)
Fills the Host, Port and Strategy fields in this panel with the data comming from the given protocolProvider.

Parameters:
protocolProvider - The ProtocolProviderService to load the data from.

actionPerformed

public void actionPerformed(ActionEvent e)
Handles the action of the button.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - The event generated when the button is pressed.

populateStrategies

public void populateStrategies()
Start the thread which will populate the Strategies List


autoSelectStrategy

public void autoSelectStrategy()
Automatic selection of a strategy


setStrategies

public void setStrategies(List<net.java.dict4j.Strategy> strategies)
Parameters:
strategies -

progressMessage

public void progressMessage(String message)
Informs the user of the current status of the search Should only be called by the thread

Parameters:
message - Search status

strategiesSearchComplete

public void strategiesSearchComplete()
Informs the wizard that the search of the strategies is complete. Should only be called by the thread


strategiesSearchFailure

public void strategiesSearchFailure(String reason,
                                    net.java.dict4j.DictException de)
Informs the wizard that the search of the strategies is a failure Should only be called by the thread

Parameters:
reason - Reason message
de - Exception thrown

setStrategyButtonEnable

public void setStrategyButtonEnable(boolean e)
Enables or disable the Next Button and the Strategy Button

Parameters:
e - TRUE enables - FALSE disables

getSimpleForm

public Object getSimpleForm()

isFirstAccount

public boolean isFirstAccount()
Indicates if this is the first dict account

Returns:
TRUE if this is the first dict account - FALSE otherwise

isCommitted

public boolean isCommitted()

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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