Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.gui
Class AccountRegistrationWizard

java.lang.Object
  extended by net.java.sip.communicator.service.gui.AccountRegistrationWizard
Direct Known Subclasses:
AimAccountRegistrationWizard, DictAccountRegistrationWizard, EmptyAccountRegistrationWizard, ExtendedAccountRegistrationWizard, GibberishAccountRegistrationWizard, IcqAccountRegistrationWizard, IrcAccountRegistrationWizard, JabberAccountRegistrationWizard, MsnAccountRegistrationWizard, RssAccountRegistrationWizard, SSHAccountRegistrationWizard, YahooAccountRegistrationWizard, ZeroconfAccountRegistrationWizard

public abstract class AccountRegistrationWizard
extends Object

The AccountRegistrationWizard is meant to provide a wizard which will guide the user through a protocol account registration. Each AccountRegistrationWizard should provide a set of WizardPages, an icon, the name and the description of the corresponding protocol.

Note that the AccountRegistrationWizard is NOT a real wizard, it doesn't handle wizard events. Each UI Service implementation should provide its own wizard UI control, which should manage all the events, panels and buttons, etc.

It depends on the wizard implementation in the UI for whether or not a summary will be shown to the user before "Finish".

Author:
Yana Stamcheva

Constructor Summary
AccountRegistrationWizard()
           
 
Method Summary
 void accountRemoved(ProtocolProviderService protocolProvider)
          Indicates that the account corresponding to the given protocolProvider has been removed.
abstract  Object getFirstPageIdentifier()
          Returns the identifier of the first account registration wizard page.
 String getForgotPasswordLink()
          Returns the forgot password link if one exists.
 String getForgotPasswordLinkName()
          Returns the forgot password link name.
abstract  byte[] getIcon()
          Returns the protocol icon that will be shown on the left of the protocol name in the list, where user will choose the protocol to register to.
abstract  Object getLastPageIdentifier()
          Returns the identifier of the last account registration wizard page.
abstract  byte[] getPageImage()
          Returns the image that will be shown on the left of the wizard pages.
abstract  Iterator<WizardPage> getPages()
          Returns the set of WizardPage-s for this wizard.
abstract  String getProtocolDescription()
          Returns a short description of the protocol that will be shown on the right of the protocol name in the list, where user will choose the protocol to register to.
abstract  String getProtocolName()
          Returns the protocol display name that will be shown in the list, where user will choose the protocol to register to.
abstract  Object getSimpleForm(boolean isCreateAccount)
          Returns a simple account registration form that would be the first form shown to the user.
abstract  Dimension getSize()
          Returns the preferred dimensions of this wizard.
abstract  Iterator<Map.Entry<String,String>> getSummary()
          Returns a set of key-value pairs that will represent the summary for this wizard.
abstract  String getUserNameExample()
          Returns an example string, which should indicate to the user how the user name should look like.
 WizardContainer getWizardContainer()
          Returns the wizard container, where all pages are added.
 boolean isHidden()
          Indicates if a wizard is hidden.
 boolean isModification()
          Indicates if this wizard is modifying an existing account or is creating a new one.
 boolean isPreferredProtocol()
          Indicates if this wizard is for the preferred protocol.
 boolean isSimpleFormEnabled()
          Indicates whether this wizard enables the simple "sign in" form shown when the user opens the application for the first time.
 boolean isWebSignupSupported()
          Returns true if the web sign up is supported by the current implementation, false - otherwise.
abstract  void loadAccount(ProtocolProviderService protocolProvider)
          Loads all data concerning the given ProtocolProviderService.
 void setModification(boolean isModification)
          Sets the modification property to indicate if this wizard is opened for a modification.
protected  void setWizardContainer(WizardContainer wizardContainer)
          Sets the wizard container, where all pages are added.
abstract  ProtocolProviderService signin()
          Defines the operations that will be executed when the user clicks on the wizard "Signin" button.
abstract  ProtocolProviderService signin(String userName, String password)
          Defines the operations that will be executed when the user clicks on the wizard "Signin" button.
 void webSignup()
          Defines the operation that will be executed when user clicks on the "Sign up" link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountRegistrationWizard

public AccountRegistrationWizard()
Method Detail

getIcon

public abstract byte[] getIcon()
Returns the protocol icon that will be shown on the left of the protocol name in the list, where user will choose the protocol to register to.

Returns:
a short description of the protocol.

getPageImage

public abstract byte[] getPageImage()
Returns the image that will be shown on the left of the wizard pages.

Returns:
the image that will be shown on the left of the wizard pages

getProtocolName

public abstract String getProtocolName()
Returns the protocol display name that will be shown in the list, where user will choose the protocol to register to.

Returns:
the protocol name.

getProtocolDescription

public abstract String getProtocolDescription()
Returns a short description of the protocol that will be shown on the right of the protocol name in the list, where user will choose the protocol to register to.

Returns:
a short description of the protocol.

getUserNameExample

public abstract String getUserNameExample()
Returns an example string, which should indicate to the user how the user name should look like. For example: john@jabber.org.

Returns:
an example string, which should indicate to the user how the user name should look like.

loadAccount

public abstract void loadAccount(ProtocolProviderService protocolProvider)
Loads all data concerning the given ProtocolProviderService. This method is meant to be used when a modification in an already created account is needed.

Parameters:
protocolProvider - The ProtocolProviderService to load data from.

getPages

public abstract Iterator<WizardPage> getPages()
Returns the set of WizardPage-s for this wizard.

Returns:
the set of WizardPage-s for this wizard.

getFirstPageIdentifier

public abstract Object getFirstPageIdentifier()
Returns the identifier of the first account registration wizard page. This method is meant to be used by the wizard container to determine, which is the first page to show to the user.

Returns:
the identifier of the first account registration wizard page

getLastPageIdentifier

public abstract Object getLastPageIdentifier()
Returns the identifier of the last account registration wizard page. This method is meant to be used by the wizard container to determine which is the page to show before the summary page (of course if there's a summary).

Returns:
the identifier of the last account registration wizard page

getSummary

public abstract Iterator<Map.Entry<String,String>> getSummary()
Returns a set of key-value pairs that will represent the summary for this wizard.

Returns:
a set of key-value pairs that will represent the summary for this wizard.

signin

public abstract ProtocolProviderService signin()
                                        throws OperationFailedException
Defines the operations that will be executed when the user clicks on the wizard "Signin" button.

Returns:
the created ProtocolProviderService corresponding to the new account
Throws:
OperationFailedException - if the operation didn't succeed

signin

public abstract ProtocolProviderService signin(String userName,
                                               String password)
                                        throws OperationFailedException
Defines the operations that will be executed when the user clicks on the wizard "Signin" button.

Parameters:
userName - the user name to sign in with
password - the password to sign in with
Returns:
the created ProtocolProviderService corresponding to the new account
Throws:
OperationFailedException - if the operation didn't succeed

accountRemoved

public void accountRemoved(ProtocolProviderService protocolProvider)
Indicates that the account corresponding to the given protocolProvider has been removed.

Parameters:
protocolProvider - the protocol provider that has been removed

isWebSignupSupported

public boolean isWebSignupSupported()
Returns true if the web sign up is supported by the current implementation, false - otherwise.

Returns:
true if the web sign up is supported by the current implementation, false - otherwise

webSignup

public void webSignup()
               throws UnsupportedOperationException
Defines the operation that will be executed when user clicks on the "Sign up" link.

Throws:
UnsupportedOperationException - if the web sign up operation is not supported by the current implementation.

getForgotPasswordLinkName

public String getForgotPasswordLinkName()
Returns the forgot password link name.

Returns:
the forgot password link name

getForgotPasswordLink

public String getForgotPasswordLink()
Returns the forgot password link if one exists.

Returns:
the forgot password link

getSize

public abstract Dimension getSize()
Returns the preferred dimensions of this wizard.

Returns:
the preferred dimensions of this wizard.

getSimpleForm

public abstract Object getSimpleForm(boolean isCreateAccount)
Returns a simple account registration form that would be the first form shown to the user. Only if the user needs more settings she'll choose to open the advanced wizard, consisted by all pages.

Parameters:
isCreateAccount - indicates if the simple form should be opened as a create account form or as a login form
Returns:
a simple account registration form

setModification

public void setModification(boolean isModification)
Sets the modification property to indicate if this wizard is opened for a modification.

Parameters:
isModification - indicates if this wizard is opened for modification or for creating a new account.

isModification

public boolean isModification()
Indicates if this wizard is modifying an existing account or is creating a new one.

Returns:
true to indicate that this wizard is currently in modification mode, false - otherwise.

isSimpleFormEnabled

public boolean isSimpleFormEnabled()
Indicates whether this wizard enables the simple "sign in" form shown when the user opens the application for the first time. The simple "sign in" form allows user to configure her account in one click, just specifying her username and password and leaving any other configuration as by default.

Returns:
true if the simple "Sign in" form is enabled or false otherwise.

getWizardContainer

public WizardContainer getWizardContainer()
Returns the wizard container, where all pages are added.

Returns:
the wizard container, where all pages are added

setWizardContainer

protected void setWizardContainer(WizardContainer wizardContainer)
Sets the wizard container, where all pages are added.

Parameters:
wizardContainer - the wizard container, where all pages are added

isPreferredProtocol

public boolean isPreferredProtocol()
Indicates if this wizard is for the preferred protocol.

Returns:
true if this wizard corresponds to the preferred protocol, otherwise returns false

isHidden

public boolean isHidden()
Indicates if a wizard is hidden. This may be used if we don't want that a wizard appears in the list of available networks.

Returns:
true to indicate that a wizard is hidden, false otherwise

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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