Pre-selects the protocol provider corresponding to the default protocol in the add contact dialog.

cusax-fix
Yana Stamcheva 15 years ago
parent 87b95d7fb3
commit ff20df76eb

@ -85,11 +85,10 @@ service.gui.CALL_NOT_SUPPORTING_PARTICIPANT=This call only supports participants
service.gui.CANCEL=&Cancel
service.gui.CHAT=Chat
service.gui.CHANGE_FONT=Change font
service.gui.CHANGE_NICKNAME=Change nickname...
service.gui.CHANGE_NICKNAME_LABEL=In the field below, you can enter your new nickname.
service.gui.CHANGE_ROOM_SUBJECT=Change room's subject...
service.gui.CHANGE_ROOM_SUBJECT_LABEL=In the field below, you can enter the new subject for this room.
service.gui.CHANGE_VIDEO_QUALITY=Change remote video quality
service.gui.CHANGE_NICKNAME=Change nickname...
service.gui.CHANGE_NICKNAME_LABEL=In the field below, you can enter your new nickname.
service.gui.CHAT_ROOM_ALREADY_JOINED=The {0} chat room is already joined.
service.gui.CHAT_ROOM_CONFIGURATION={0} chat room configuration
service.gui.CHAT_ROOM_CONFIGURATION_FAILED=Failed to obtain the {0} chat room configuration form.
@ -220,7 +219,6 @@ service.gui.GRANT_MEMBERSHIP=Grant membership
service.gui.GRANT_VOICE=Grant voice
service.gui.GUEST=visitor
service.gui.HANG_UP=Hang up
service.gui.HD_QUALITY=HD video
service.gui.HELP=&Help
service.gui.HIDE=Hide
service.gui.HIDE_OFFLINE_CONTACTS=Hide offline contacts
@ -273,7 +271,6 @@ service.gui.LOGIN_GENERAL_ERROR=An error occurred while logging in with account:
service.gui.LOGIN_INTERNAL_ERROR=An error occurred while logging in with account: User name: {0}, Server name: {1}. This is most probably an internal application error. Please report the problem to our developers mailing list (dev@jitsi.java.net).
service.gui.LOGIN_INVALID_PROPERTIES_ERROR=Unable to log in with account: User name: {0}, Server name: {1}, due to an account configuration problem. Please check your account configuration.
service.gui.LOGOFF_NOT_SUCCEEDED=An error occurred while logging off with the following account: User name: {0}, Server name: {1}.
service.gui.LOW_QUALITY=Low quality
service.gui.MEMBER=member
service.gui.MESSAGE=Message:
service.gui.MISSED_CALLS_TOOL_TIP=Missed calls from:
@ -318,7 +315,6 @@ service.gui.NO_GROUP_CHAT_ACCOUNT_AVAILABLE=No accounts, supporting multi user c
service.gui.NO_ONLINE_TELEPHONY_ACCOUNT=At least one online telephony account is needed in order to make a call. Please login to one of your telephony accounts and try again.
service.gui.NON_EMPTY_CHAT_WINDOW_CLOSE=You're trying to close a chat with a non-sent message. Are you sure you want to close this chat?
service.gui.NON_EXISTING_USER_ID=The {0} server does not recognize specified user id.
service.gui.SD_QUALITY=Standard quality
service.gui.OFFLINE=Offline
service.gui.OK=&OK
service.gui.OLDER_CALLS=Older calls
@ -434,7 +430,6 @@ service.gui.TRANSFER_CALL_TITLE=Transfer Call
service.gui.TRANSFER_CALL_TO=Transfer to:
service.gui.TRANSPARENCY_NOT_ENABLED=Transparency is not supported by your current configuration.
service.gui.TYPE_YOUR_REQUEST=Type your request here
service.gui.UNABLE_TO_CHANGE_VIDEO_QUALITY=We were not able to change video quality for this call.
service.gui.UNMUTE=Unmute
service.gui.USER_IDENTIFIER=User identifier:
service.gui.USER_EXISTS_ERROR=This user already exists on the selected network. Please choose another user or network.
@ -608,6 +603,14 @@ impl.ldap.SEARCH_BASE=Search base
impl.ldap.SCOPE=Scope
impl.ldap.WRONG_CREDENTIALS=Wrong credentials for LDAP directory {0}
# Address book plugin
plugin.addrbook.ADDRESS_BOOKS=Address book
plugin.addrbook.ENABLE_MACOSX_ADDRESSBOOK=Enable MacOSX Address Book search
plugin.addrbook.ENABLE_MICROSOFT_OUTLOOK=Enable Microsoft Outlook search
plugin.addrbook.DESCRIPTION=If enabled everything you type in the search field \
of the contact list will be also searched in your system address book and all \
matching contacts from your address book will appear in your contact list.
# Google Contacts
impl.googlecontacts.CONFIG_FORM_TITLE=Google Contacts
impl.googlecontacts.NEW=New
@ -643,6 +646,7 @@ plugin.contactinfo.CONTACT_SUMMARY_DESCRIPTION=Summary of contact info for
plugin.contactinfo.CONTACT_EXTENDED_DESCRIPTION=Extended contact info for
plugin.contactinfo.NOT_SPECIFIED=[Not specified]
plugin.contactinfo.USER_PICTURES=User pictures
plugin.contactinfo.USER_STATUS_MESSAGE=Status Message
# aimaccregwizz
plugin.aimaccregwizz.PROTOCOL_NAME=AIM
@ -722,8 +726,6 @@ plugin.generalconfig.ERROR_PORT_NUMBER=Wrong port number
plugin.generalconfig.CHECK_FOR_UPDATES=Check for updates on startup
plugin.generalconfig.STARTUP_CONFIG=Startup
plugin.generalconfig.LEAVE_CHATROOM_ON_WINDOW_CLOSE=Leave chat rooms when closing window
plugin.generalconfig.REMOVE_SPECIAL_PHONE_SYMBOLS=Remove special symbols before callng phone numbers
plugin.generalconfig.SIP_CALL_CONFIG=SIP configuration
# gibberish accregwizz
plugin.gibberishaccregwizz.PROTOCOL_NAME=Gibberish
@ -1186,6 +1188,9 @@ plugin.chatconfig.replacement.TITLE=Image/Video:
plugin.chatconfig.replacement.ENABLE_SMILEY_STATUS=Enable smiley replacement
plugin.chatconfig.replacement.ENABLE_REPLACEMENT_STATUS=Enable Image/Video replacement
plugin.chatconfig.replacement.REPLACEMENT_SOURCES=Sources:
plugin.chatconfig.spellcheck.TITLE=SpellCheck
plugin.spellcheck.LANG=Language
plugin.spellcheck.EDIT_PERSONAL_DICT=Edit
#provisioning plugin
plugin.provisioning.PROVISIONING=Provisioning

@ -27,7 +27,7 @@
* @author Emil Ivov
*/
class EmptyAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
/**
* The only page we need in this wizard, containing a prompt for the user
@ -167,48 +167,12 @@ public String getUserNameExample()
return "";
}
/**
* Empty interface method implementation, unused in the case of the
* {@link EmptyAccountRegistrationWizard}
*/
public boolean isModification()
{
return false;
}
/**
* Empty interface method implementation, unused in the case of the
* {@link EmptyAccountRegistrationWizard}
*/
public boolean isSimpleFormEnabled()
{
return true;
}
/**
* Empty interface method implementation, unused in the case of the
* {@link EmptyAccountRegistrationWizard}
*/
public boolean isWebSignupSupported()
{
return false;
}
/**
* Empty interface method implementation, unused in the case of the
* {@link EmptyAccountRegistrationWizard}
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
}
/**
* Empty interface method implementation, unused in the case of the
* {@link EmptyAccountRegistrationWizard}
*/
public void setModification(boolean isModification)
{
}
/**
@ -229,17 +193,4 @@ public ProtocolProviderService signin(String userName, String password)
{
return null;
}
/**
* Empty interface method implementation, unused in the case of the
* {@link EmptyAccountRegistrationWizard}
*/
public void webSignup() throws UnsupportedOperationException {}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -19,8 +19,7 @@
import net.java.sip.communicator.impl.gui.main.*;
import net.java.sip.communicator.impl.gui.main.contactlist.addgroup.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.contactlist.event.MetaContactEvent;
import net.java.sip.communicator.service.contactlist.event.MetaContactListAdapter;
import net.java.sip.communicator.service.contactlist.event.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
@ -282,6 +281,9 @@ public void itemStateChanged(ItemEvent e)
continue;
accountCombo.addItem(provider);
if (isPreferredProvider(provider.getAccountID()))
accountCombo.setSelectedItem(provider);
}
// if we have only select account option and only one account
@ -655,4 +657,27 @@ public void loadSkin()
imageLabel.setVerticalAlignment(JLabel.TOP);
}
/**
* Returns the first <tt>ProtocolProviderService</tt> implementation
* corresponding to the preferred protocol
*
* @return the <tt>ProtocolProviderService</tt> corresponding to the
* preferred protocol
*/
private boolean isPreferredProvider(AccountID accountID)
{
String preferredProtocolProp
= accountID.getAccountPropertyString(
ProtocolProviderFactory.IS_PREFERRED_PROTOCOL);
if (preferredProtocolProp != null
&& preferredProtocolProp.length() > 0
&& Boolean.parseBoolean(preferredProtocolProp))
{
return true;
}
return false;
}
}

@ -22,7 +22,7 @@
* @author Yana Stamcheva
*/
public class AimAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
/**
* The logger.
@ -35,12 +35,8 @@ public class AimAccountRegistrationWizard
private final AimAccountRegistration registration
= new AimAccountRegistration();
private WizardContainer wizardContainer;
private ProtocolProviderService protocolProvider;
private boolean isModification;
/**
* Creates an instance of <tt>AimAccountRegistrationWizard</tt>.
*
@ -48,9 +44,9 @@ public class AimAccountRegistrationWizard
*/
public AimAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer.setFinishButtonText(
wizardContainer.setFinishButtonText(
Resources.getString("service.gui.SIGN_IN"));
}
@ -196,11 +192,11 @@ public ProtocolProviderService installAccount(
accountProperties.put(ProtocolProviderFactory.PASSWORD, passwd);
}
if (isModification)
if (isModification())
{
providerFactory.modifyAccount(protocolProvider, accountProperties);
this.isModification = false;
setModification(false);
return protocolProvider;
}
@ -247,35 +243,13 @@ public ProtocolProviderService installAccount(
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -315,18 +289,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -338,20 +300,6 @@ public String getUserNameExample()
return FirstWizardPage.USER_NAME_EXAMPLE;
}
/**
* 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.
* @return <code>true</code> if the simple "Sign in" form is enabled or
* <code>false</code> otherwise.
*/
public boolean isSimpleFormEnabled()
{
return true;
}
/**
* Defines the operation that will be executed when user clicks on the
* "Sign up" link.
@ -393,11 +341,4 @@ public Object getSimpleForm(boolean isCreateAccount)
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -23,7 +23,7 @@
* @author LITZELMANN Cedric
*/
public class DictAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
private final Logger logger
= Logger.getLogger(DictAccountRegistrationWizard.class);
@ -38,21 +38,11 @@ public class DictAccountRegistrationWizard
*/
private DictAccountRegistration registration = new DictAccountRegistration();
/**
* The container of the wizard.
*/
private WizardContainer wizardContainer;
/**
* The protocole provider.
*/
private ProtocolProviderService protocolProvider;
/**
* Tells us if the is a modification wiazrd or not.
*/
private boolean isModification;
/**
* Creates an instance of <tt>DictAccountRegistrationWizard</tt>.
*
@ -60,7 +50,7 @@ public class DictAccountRegistrationWizard
*/
public DictAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
}
/**
@ -205,11 +195,11 @@ public ProtocolProviderService installAccount(
// Save strategy
accountProperties.put(ProtocolProviderFactory.STRATEGY, strategy);
if (isModification)
if (isModification())
{
providerFactory.uninstallAccount(protocolProvider.getAccountID());
this.protocolProvider = null;
this.isModification = false;
setModification(false);
}
try
@ -255,7 +245,7 @@ public ProtocolProviderService installAccount(
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
@ -264,40 +254,6 @@ public void loadAccount(ProtocolProviderService protocolProvider)
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Sets if this wizard is opened for modification or for creating a
* new account.
*
* @param b <code>True</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public void setModification(boolean b)
{
this.isModification = b;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -347,9 +303,10 @@ private String generateUID()
int nbAccounts = this.getNumberOfAccounts();
String host = this.registration.getHost();
int nbAccountsForHost = this.getNbAccountForHost(host);
if (nbAccounts == 0 || (this.isModification() && nbAccounts == 1) ||
nbAccountsForHost == 0 || (this.isModification() && nbAccountsForHost == 1))
nbAccountsForHost == 0
|| (this.isModification() && nbAccountsForHost == 1))
{
// We create the first account or we edit the onlyone
// Or we create the first account for this server or edit the onlyone
@ -374,7 +331,7 @@ private int getNumberOfAccounts()
return factory.getRegisteredAccounts().size();
}
/**
* Returns the number of account for a given host
* @param hostName the host
@ -427,26 +384,6 @@ public boolean isSimpleFormEnabled()
return false;
}
/**
* Nothing to do here in the case of dictionary.
*/
public void webSignup()
{
throw new UnsupportedOperationException(
"The web sign up is not supproted by the dictionary wizard.");
}
/**
* Returns <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise.
* @return <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise
*/
public boolean isWebSignupSupported()
{
return false;
}
/**
* 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
@ -462,11 +399,4 @@ public Object getSimpleForm(boolean isCreateAccount)
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -23,7 +23,7 @@
* @author Emil Ivov
*/
public class GibberishAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
private final Logger logger
= Logger.getLogger(GibberishAccountRegistrationWizard.class);
@ -40,12 +40,8 @@ public class GibberishAccountRegistrationWizard
private GibberishAccountRegistration registration
= new GibberishAccountRegistration();
private final WizardContainer wizardContainer;
private ProtocolProviderService protocolProvider;
private boolean isModification;
/**
* Creates an instance of <tt>GibberishAccountRegistrationWizard</tt>.
* @param wizardContainer the wizard container, where this wizard
@ -53,9 +49,10 @@ public class GibberishAccountRegistrationWizard
*/
public GibberishAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer.setFinishButtonText(Resources.getString("service.gui.SIGN_IN"));
wizardContainer.setFinishButtonText(
Resources.getString("service.gui.SIGN_IN"));
}
/**
@ -185,11 +182,11 @@ public ProtocolProviderService installAccount(
registration.getPassword());
}
if (isModification)
if (isModification())
{
providerFactory.uninstallAccount(protocolProvider.getAccountID());
this.protocolProvider = null;
this.isModification = false;
setModification(false);
}
try
@ -232,7 +229,7 @@ public ProtocolProviderService installAccount(
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
@ -241,28 +238,6 @@ public void loadAccount(ProtocolProviderService protocolProvider)
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -302,18 +277,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -324,7 +287,6 @@ public String getUserNameExample()
{
return FirstWizardPage.USER_NAME_EXAMPLE;
}
/**
* Indicates whether this wizard enables the simple "sign in" form shown
@ -340,26 +302,6 @@ public boolean isSimpleFormEnabled()
return false;
}
/**
* Nothing to do here in the case of Gibberish.
*/
public void webSignup()
{
throw new UnsupportedOperationException(
"The web sign up is not supproted by the gibberish wizard.");
}
/**
* Returns <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise.
* @return <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise
*/
public boolean isWebSignupSupported()
{
return false;
}
/**
* 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
@ -374,11 +316,4 @@ public Object getSimpleForm(boolean isCreateAccount)
firstWizardPage = new FirstWizardPage(this);
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -22,7 +22,7 @@
* @author Yana Stamcheva
*/
public class IcqAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
/**
* The logger.
@ -34,12 +34,8 @@ public class IcqAccountRegistrationWizard
private IcqAccountRegistration registration = new IcqAccountRegistration();
private WizardContainer wizardContainer;
private ProtocolProviderService protocolProvider;
private boolean isModification;
/**
* Creates an instance of <tt>IcqAccountRegistrationWizard</tt>.
*
@ -47,9 +43,9 @@ public class IcqAccountRegistrationWizard
*/
public IcqAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer
wizardContainer
.setFinishButtonText(Resources.getString("service.gui.SIGN_IN"));
}
@ -197,12 +193,12 @@ public ProtocolProviderService installAccount(
accountProperties.put(ProtocolProviderFactory.PASSWORD, passwd);
}
if (isModification)
if (isModification())
{
providerFactory.modifyAccount( protocolProvider,
accountProperties);
this.isModification = false;
setModification(false);
return protocolProvider;
}
@ -248,7 +244,7 @@ public ProtocolProviderService installAccount(
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
@ -257,28 +253,6 @@ public void loadAccount(ProtocolProviderService protocolProvider)
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -318,18 +292,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -341,20 +303,6 @@ public String getUserNameExample()
return FirstWizardPage.USER_NAME_EXAMPLE;
}
/**
* 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.
* @return <code>true</code> if the simple "Sign in" form is enabled or
* <code>false</code> otherwise.
*/
public boolean isSimpleFormEnabled()
{
return true;
}
/**
* Opens the browser on the account registration page.
*/
@ -390,11 +338,4 @@ public Object getSimpleForm(boolean isCreateAccount)
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -23,7 +23,7 @@
* @author Lionel Ferreira & Michael Tarantino
*/
public class IrcAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
private final Logger logger
= Logger.getLogger(IrcAccountRegistrationWizard.class);
@ -40,12 +40,8 @@ public class IrcAccountRegistrationWizard
private IrcAccountRegistration registration
= new IrcAccountRegistration();
private WizardContainer wizardContainer;
private ProtocolProviderService protocolProvider;
private boolean isModification;
/**
* Creates an instance of <tt>IrcAccountRegistrationWizard</tt>.
* @param wizardContainer the wizard container, where this wizard
@ -53,9 +49,10 @@ public class IrcAccountRegistrationWizard
*/
public IrcAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer.setFinishButtonText(Resources.getString("service.gui.SIGN_IN"));
wizardContainer.setFinishButtonText(
Resources.getString("service.gui.SIGN_IN"));
}
/**
@ -223,11 +220,11 @@ public ProtocolProviderService installAccount(
ProtocolProviderFactory.NO_PASSWORD_REQUIRED,
new Boolean(!registration.isRequiredPassword()).toString());
if (isModification)
if (isModification())
{
providerFactory.uninstallAccount(protocolProvider.getAccountID());
this.protocolProvider = null;
this.isModification = false;
setModification(false);
}
try
@ -270,7 +267,7 @@ public ProtocolProviderService installAccount(
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
@ -279,28 +276,6 @@ public void loadAccount(ProtocolProviderService protocolProvider)
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -321,7 +296,7 @@ public Dimension getSize()
{
return new Dimension(600, 500);
}
/**
* Returns the identifier of the page to show first in the wizard.
* @return the identifier of the page to show first in the wizard.
@ -340,18 +315,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -377,26 +340,6 @@ public boolean isSimpleFormEnabled()
return false;
}
/**
* Nothing to do here in the case of IRC.
*/
public void webSignup()
{
throw new UnsupportedOperationException(
"The web sign up is not supproted by the IRC wizard.");
}
/**
* Returns <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise.
* @return <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise
*/
public boolean isWebSignupSupported()
{
return false;
}
/**
* 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
@ -412,11 +355,4 @@ public Object getSimpleForm(boolean isCreateAccount)
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -24,7 +24,7 @@
* @author Yana Stamcheva
*/
public class JabberAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
/**
* The logger.
@ -53,21 +53,11 @@ public class JabberAccountRegistrationWizard
*/
private JabberAccountRegistration registration;
/**
* The parent wizard container.
*/
private final WizardContainer wizardContainer;
/**
* The <tt>ProtocolProviderService</tt> of this account.
*/
private ProtocolProviderService protocolProvider;
/**
* If the account has been modified.
*/
private boolean isModification;
/**
* Creates an instance of <tt>JabberAccountRegistrationWizard</tt>.
* @param wizardContainer the wizard container, where this wizard
@ -75,9 +65,9 @@ public class JabberAccountRegistrationWizard
*/
public JabberAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer
wizardContainer
.setFinishButtonText(Resources.getString("service.gui.SIGN_IN"));
}
@ -277,6 +267,8 @@ protected ProtocolProviderService installAccount(
Hashtable<String, String> accountProperties
= new Hashtable<String, String>();
accountProperties.put(ProtocolProviderFactory.IS_PREFERRED_PROTOCOL,
Boolean.toString(isPreferredProtocol()));
accountProperties.put(ProtocolProviderFactory.PROTOCOL, getProtocol());
String protocolIconPath = getProtocolIconPath();
if (protocolIconPath != null)
@ -385,12 +377,12 @@ protected ProtocolProviderService installAccount(
accountProperties.put(ProtocolProviderFactory.IS_USE_UPNP,
String.valueOf(registration.isUseUPNP()));
if (isModification)
if (isModification())
{
providerFactory.modifyAccount( protocolProvider,
accountProperties);
this.isModification = false;
setModification(false);
return protocolProvider;
}
@ -451,7 +443,7 @@ protected ProtocolProviderService installAccount(
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
@ -460,28 +452,6 @@ public void loadAccount(ProtocolProviderService protocolProvider)
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -524,18 +494,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -547,17 +505,6 @@ public String getUserNameExample()
return "Ex: johnsmith@jabber.org";
}
/**
* Enables the simple "Sign in" form.
*
* @return <tt>true</tt> if the simple form is enabled and <tt>false</tt>
* otherwise.
*/
public boolean isSimpleFormEnabled()
{
return true;
}
/**
* Parse the server part from the jabber id and set it to server as default
* value. If Advanced option is enabled Do nothing.
@ -714,11 +661,4 @@ protected String getHomeLinkLabel()
{
return null;
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -22,7 +22,7 @@
* @author Yana Stamcheva
*/
public class MsnAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
private final Logger logger
= Logger.getLogger(MsnAccountRegistrationWizard.class);
@ -31,12 +31,8 @@ public class MsnAccountRegistrationWizard
private MsnAccountRegistration registration = new MsnAccountRegistration();
private final WizardContainer wizardContainer;
private ProtocolProviderService protocolProvider;
private boolean isModification;
/**
* Creates an instance of <tt>MsnAccountRegistrationWizard</tt>.
*
@ -44,9 +40,9 @@ public class MsnAccountRegistrationWizard
*/
public MsnAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer
wizardContainer
.setFinishButtonText(Resources.getString("service.gui.SIGN_IN"));
}
@ -189,12 +185,12 @@ public ProtocolProviderService installAccount(
accountProperties.put(ProtocolProviderFactory.PASSWORD, passwd);
}
if (isModification)
if (isModification())
{
providerFactory.modifyAccount( protocolProvider,
accountProperties);
this.isModification = false;
setModification(false);
return protocolProvider;
}
@ -240,7 +236,7 @@ public ProtocolProviderService installAccount(
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
@ -249,28 +245,6 @@ public void loadAccount(ProtocolProviderService protocolProvider)
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -310,18 +284,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -333,20 +295,6 @@ public String getUserNameExample()
return FirstWizardPage.USER_NAME_EXAMPLE;
}
/**
* 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.
* @return <code>true</code> if the simple "Sign in" form is enabled or
* <code>false</code> otherwise.
*/
public boolean isSimpleFormEnabled()
{
return true;
}
/**
* Opens the browser on the registration page for MSN.
*/
@ -381,11 +329,4 @@ public Object getSimpleForm(boolean isCreateAccount)
firstWizardPage = new FirstWizardPage(this);
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -23,7 +23,7 @@
* @author Emil Ivov
*/
public class RssAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
private final Logger logger
= Logger.getLogger(RssAccountRegistrationWizard.class);
@ -40,12 +40,8 @@ public class RssAccountRegistrationWizard
private RssAccountRegistration registration
= new RssAccountRegistration();
private final WizardContainer wizardContainer;
private ProtocolProviderService protocolProvider;
private boolean isModification;
/**
* Creates an instance of <tt>RssAccountRegistrationWizard</tt>.
* @param wizardContainer the wizard container, where this wizard
@ -53,9 +49,9 @@ public class RssAccountRegistrationWizard
*/
public RssAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer
wizardContainer
.setFinishButtonText(Resources.getString("service.gui.ACTIVATE"));
}
@ -107,7 +103,8 @@ public String getProtocolDescription()
public Iterator<WizardPage> getPages()
{
java.util.List<WizardPage> pages = new ArrayList<WizardPage>();
firstWizardPage = new FirstWizardPage(registration, wizardContainer);
firstWizardPage
= new FirstWizardPage(registration, getWizardContainer());
pages.add(firstWizardPage);
@ -226,10 +223,9 @@ public ProtocolProviderService installAccount(
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.protocolProvider = protocolProvider;
isModification = true;
setModification(true);
}
/**
@ -260,30 +256,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Indicates if this wizard is modifying an existing account or is creating
* a new one.
*
* @return <code>true</code> to indicate that this wizard is currently in
* modification mode, <code>false</code> - otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -309,26 +281,6 @@ public boolean isSimpleFormEnabled()
return false;
}
/**
* Nothing to do for RSS here.
*/
public void webSignup()
{
throw new UnsupportedOperationException(
"The web sign up is not supported by the RSS wizard.");
}
/**
* Returns <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise.
* @return <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise
*/
public boolean isWebSignupSupported()
{
return false;
}
/**
* 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
@ -340,14 +292,8 @@ public boolean isWebSignupSupported()
*/
public Object getSimpleForm(boolean isCreateAccount)
{
firstWizardPage = new FirstWizardPage(registration, wizardContainer);
firstWizardPage
= new FirstWizardPage(registration, getWizardContainer());
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -123,7 +123,6 @@ public byte[] getPageImage()
.getImageInBytes(PAGE_IMAGE);
}
/**
* Implements the <code>AccountRegistrationWizard.getProtocolName</code>
* method. Returns the protocol name for this wizard.

@ -24,7 +24,7 @@
* @author Grigorii Balutsel
*/
public class SIPAccountRegistrationWizard
implements ExtendedAccountRegistrationWizard
extends ExtendedAccountRegistrationWizard
{
/**
* The first wizard page.
@ -37,21 +37,11 @@ public class SIPAccountRegistrationWizard
private SIPAccountRegistration registration
= new SIPAccountRegistration();
/**
* The container.
*/
private final WizardContainer wizardContainer;
/**
* The protocol provider.
*/
private ProtocolProviderService protocolProvider;
/**
* Is current wizard run as modification of an existing account.
*/
private boolean isModification;
/**
* The logger.
*/
@ -65,9 +55,9 @@ public class SIPAccountRegistrationWizard
*/
public SIPAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer.setFinishButtonText(
wizardContainer.setFinishButtonText(
Resources.getString("service.gui.SIGN_IN"));
}
@ -522,13 +512,13 @@ else if(serverAddress == null &&
ProtocolProviderFactory.VOICEMAIL_URI,
registration.getVoicemailURI());
if(isModification)
if(isModification())
{
accountProperties.put(ProtocolProviderFactory.USER_ID, userName);
providerFactory.modifyAccount( protocolProvider,
accountProperties);
this.isModification = false;
setModification(false);
return protocolProvider;
}
@ -573,7 +563,7 @@ else if(serverAddress == null &&
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
@ -582,28 +572,6 @@ public void loadAccount(ProtocolProviderService protocolProvider)
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -643,18 +611,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -666,20 +622,6 @@ public String getUserNameExample()
return "Ex: john@voiphone.net or simply \"john\" for no server";
}
/**
* Enables the simple "Sign in" form.
* @return <tt>true</tt> to indicate that the simple form is enabled
*/
public boolean isSimpleFormEnabled()
{
return true;
}
/**
* Sign ups through the web.
*/
public void webSignup() {}
/**
* Returns the name of the web sign up link.
* @return the name of the web sign up link
@ -689,17 +631,6 @@ public String getWebSignupLinkName()
return null;
}
/**
* Returns <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise.
* @return <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise
*/
public boolean isWebSignupSupported()
{
return true;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
@ -819,11 +750,4 @@ protected String getCreateAccountLabel()
{
return Resources.getString("plugin.sipaccregwizz.CREATE_ACCOUNT");
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -32,7 +32,7 @@
* @author Shobhit Jindal
*/
public class SSHAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
private final Logger logger
= Logger.getLogger(SSHAccountRegistrationWizard.class);
@ -41,20 +41,16 @@ public class SSHAccountRegistrationWizard
* The first page of the ssh account registration wizard.
*/
private FirstWizardPage firstWizardPage;
/**
* The object that we use to store details on an account that we will be
* creating.
*/
private SSHAccountRegistration registration
= new SSHAccountRegistration();
private final WizardContainer wizardContainer;
private ProtocolProviderService protocolProvider;
private boolean isModification;
/**
* Creates an instance of <tt>SSHAccountRegistrationWizard</tt>.
* @param wizardContainer the wizard container, where this wizard
@ -62,21 +58,22 @@ public class SSHAccountRegistrationWizard
*/
public SSHAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer.setFinishButtonText(
wizardContainer.setFinishButtonText(
Resources.getString("service.gui.SIGN_IN"));
}
/**
* Implements the <code>AccountRegistrationWizard.getIcon</code> method.
* Returns the icon to be used for this wizard.
* @return byte[]
*/
public byte[] getIcon() {
public byte[] getIcon()
{
return Resources.getImage(Resources.SSH_LOGO);
}
/**
* Implements the <code>AccountRegistrationWizard.getPageImage</code>
* method.
@ -84,48 +81,54 @@ public byte[] getIcon() {
*
* @return byte[] the image used to decorate the wizard page
*/
public byte[] getPageImage() {
public byte[] getPageImage()
{
return Resources.getImage(Resources.PAGE_IMAGE);
}
/**
* Implements the <code>AccountRegistrationWizard.getProtocolName</code>
* method. Returns the protocol name for this wizard.
* @return String
*/
public String getProtocolName() {
public String getProtocolName()
{
return Resources.getString("plugin.sshaccregwizz.PROTOCOL_NAME");
}
/**
* Implements the <code>AccountRegistrationWizard.getProtocolDescription
* </code> method. Returns the description of the protocol for this wizard.
* @return String
*/
public String getProtocolDescription() {
public String getProtocolDescription()
{
return Resources.getString("plugin.sshaccregwizz.PROTOCOL_DESCRIPTION");
}
/**
* Returns the set of pages contained in this wizard.
* @return Iterator
*/
public Iterator<WizardPage> getPages() {
public Iterator<WizardPage> getPages()
{
java.util.List<WizardPage> pages = new ArrayList<WizardPage>();
firstWizardPage = new FirstWizardPage(registration, wizardContainer);
firstWizardPage
= new FirstWizardPage(registration, getWizardContainer());
pages.add(firstWizardPage);
return pages.iterator();
}
/**
* Returns the set of data that user has entered through this wizard.
* @return Iterator
*/
public Iterator<Map.Entry<String, String>> getSummary() {
Hashtable<String, String> summaryTable = new Hashtable<String, String>();
Hashtable<String, String> summaryTable
= new Hashtable<String, String>();
/*
* Hashtable arranges the entries alphabetically so the order
* of appearance is
@ -133,11 +136,10 @@ public Iterator<Map.Entry<String, String>> getSummary() {
* - Port
* - User ID
*/
summaryTable.put("Account ID", registration.getAccountID());
summaryTable.put("Known Hosts", registration.getKnownHostsFile());
summaryTable.put("Identity", registration.getIdentityFile());
return summaryTable.entrySet().iterator();
}
@ -244,13 +246,13 @@ public ProtocolProviderService installAccount(
* @param protocolProvider The <tt>ProtocolProviderService</tt> to load the
* data from.
*/
public void loadAccount(ProtocolProviderService protocolProvider) {
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.protocolProvider = protocolProvider;
this.firstWizardPage.loadAccount(protocolProvider);
isModification = true;
setModification(true);
}
/**
@ -279,30 +281,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Indicates if this wizard is modifying an existing account or is creating
* a new one.
*
* @return <code>true</code> to indicate that this wizard is currently in
* modification mode, <code>false</code> - otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -328,26 +306,6 @@ public boolean isSimpleFormEnabled()
return false;
}
/**
* Nothing to do here in the case of SSH.
*/
public void webSignup()
{
throw new UnsupportedOperationException(
"The web sign up is not supported by the SSH wizard.");
}
/**
* Returns <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise.
* @return <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise
*/
public boolean isWebSignupSupported()
{
return false;
}
/**
* 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
@ -359,14 +317,7 @@ public boolean isWebSignupSupported()
*/
public Object getSimpleForm(boolean isCreateAccount)
{
firstWizardPage = new FirstWizardPage(registration, wizardContainer);
firstWizardPage = new FirstWizardPage(registration, getWizardContainer());
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -22,7 +22,7 @@
* @author Yana Stamcheva
*/
public class YahooAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
private final Logger logger
= Logger.getLogger(YahooAccountRegistrationWizard.class);
@ -32,12 +32,8 @@ public class YahooAccountRegistrationWizard
private YahooAccountRegistration registration =
new YahooAccountRegistration();
private final WizardContainer wizardContainer;
private ProtocolProviderService protocolProvider;
private boolean isModification;
/**
* Creates an instance of <tt>YahooAccountRegistrationWizard</tt>.
*
@ -45,9 +41,9 @@ public class YahooAccountRegistrationWizard
*/
public YahooAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer
wizardContainer
.setFinishButtonText(Resources.getString("service.gui.SIGN_IN"));
}
@ -194,12 +190,12 @@ public ProtocolProviderService installAccount(
accountProperties.put(ProtocolProviderFactory.PASSWORD, passwd);
}
if (isModification)
if (isModification())
{
providerFactory.modifyAccount( protocolProvider,
accountProperties);
this.isModification = false;
setModification(false);
return protocolProvider;
}
@ -245,7 +241,7 @@ public ProtocolProviderService installAccount(
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
@ -254,28 +250,6 @@ public void loadAccount(ProtocolProviderService protocolProvider)
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -315,18 +289,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns an example string, which should indicate to the user how the
* user name should look like.
@ -338,20 +300,6 @@ public String getUserNameExample()
return FirstWizardPage.USER_NAME_EXAMPLE;
}
/**
* 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.
* @return <code>true</code> if the simple "Sign in" form is enabled or
* <code>false</code> otherwise.
*/
public boolean isSimpleFormEnabled()
{
return true;
}
/**
* Defines the operation that will be executed when user clicks on the
* "Sign up" link.
@ -390,11 +338,4 @@ public Object getSimpleForm(boolean isCreateAccount)
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -24,7 +24,7 @@
* @author Maxime Catelin
*/
public class ZeroconfAccountRegistrationWizard
implements AccountRegistrationWizard
extends AccountRegistrationWizard
{
private Logger logger
= Logger.getLogger(ZeroconfAccountRegistrationWizard.class);
@ -41,12 +41,8 @@ public class ZeroconfAccountRegistrationWizard
private ZeroconfAccountRegistration registration
= new ZeroconfAccountRegistration();
private final WizardContainer wizardContainer;
private ProtocolProviderService protocolProvider;
private boolean isModification;
/**
* Creates an instance of <tt>ZeroconfAccountRegistrationWizard</tt>.
* @param wizardContainer the wizard container, where this wizard
@ -54,9 +50,9 @@ public class ZeroconfAccountRegistrationWizard
*/
public ZeroconfAccountRegistrationWizard(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
setWizardContainer(wizardContainer);
this.wizardContainer
wizardContainer
.setFinishButtonText(Resources.getString("service.gui.SIGN_IN"));
}
@ -206,11 +202,11 @@ public ProtocolProviderService installAccount(
accountProperties.put("rememberContacts",
new Boolean(registration.isRememberContacts()).toString());
if (isModification)
if (isModification())
{
providerFactory.uninstallAccount(protocolProvider.getAccountID());
this.protocolProvider = null;
this.isModification = false;
setModification(false);
}
try
@ -254,7 +250,7 @@ public ProtocolProviderService installAccount(
*/
public void loadAccount(ProtocolProviderService protocolProvider)
{
this.isModification = true;
setModification(true);
this.protocolProvider = protocolProvider;
@ -263,28 +259,6 @@ public void loadAccount(ProtocolProviderService protocolProvider)
this.firstWizardPage.loadAccount(protocolProvider);
}
/**
* Indicates if this wizard is opened for modification or for creating a
* new account.
*
* @return <code>true</code> if this wizard is opened for modification and
* <code>false</code> otherwise.
*/
public boolean isModification()
{
return isModification;
}
/**
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Returns the registration object, which will store all the data through
* the wizard.
@ -324,18 +298,6 @@ public Object getLastPageIdentifier()
return firstWizardPage.getIdentifier();
}
/**
* Sets the modification property to indicate if this wizard is opened for
* a modification.
*
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Returns the password label for the simplified account registration form.
* @return the password label for the simplified account registration form.
@ -382,26 +344,6 @@ public boolean isSimpleFormEnabled()
return false;
}
/**
* Nothing to do here in the case of Bonjour.
*/
public void webSignup()
{
throw new UnsupportedOperationException(
"The web sign up is not supported by the Zeroconf wizard.");
}
/**
* Returns <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise.
* @return <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise
*/
public boolean isWebSignupSupported()
{
return false;
}
/**
* 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
@ -421,11 +363,4 @@ public Object getSimpleForm(boolean isCreateAccount)
firstWizardPage = new FirstWizardPage(this);
return firstWizardPage.getSimpleForm();
}
/**
* Indicates that the account corresponding to the given
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider) {}
}

@ -9,6 +9,7 @@
import java.awt.*;
import java.util.*;
import net.java.sip.communicator.service.gui.internal.*;
import net.java.sip.communicator.service.protocol.*;
/**
@ -28,29 +29,36 @@
*
* @author Yana Stamcheva
*/
public interface AccountRegistrationWizard
public abstract class AccountRegistrationWizard
{
/**
* Is current wizard run as modification of an existing account.
*/
private boolean isModification;
private WizardContainer wizardContainer;
/**
* 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.
*
* @return a short description of the protocol.
*/
public byte[] getIcon();
public abstract byte[] getIcon();
/**
* Returns the image that will be shown on the left of the wizard pages.
* @return the image that will be shown on the left of the wizard pages
*/
public byte[] getPageImage();
public abstract byte[] getPageImage();
/**
* Returns the protocol name that will be shown in the list, where user
* will choose the protocol to register to.
* Returns the protocol display name that will be shown in the list,
* where user will choose the protocol to register to.
*
* @return the protocol name.
*/
public String getProtocolName();
public abstract String getProtocolName();
/**
* Returns a short description of the protocol that will be shown on the
@ -59,7 +67,7 @@ public interface AccountRegistrationWizard
*
* @return a short description of the protocol.
*/
public String getProtocolDescription();
public abstract String getProtocolDescription();
/**
* Returns an example string, which should indicate to the user how the
@ -67,7 +75,7 @@ public interface AccountRegistrationWizard
* @return an example string, which should indicate to the user how the
* user name should look like.
*/
public String getUserNameExample();
public abstract String getUserNameExample();
/**
* Loads all data concerning the given <tt>ProtocolProviderService</tt>.
@ -77,7 +85,7 @@ public interface AccountRegistrationWizard
* @param protocolProvider The <tt>ProtocolProviderService</tt> to
* load data from.
*/
public void loadAccount(ProtocolProviderService protocolProvider);
public abstract void loadAccount(ProtocolProviderService protocolProvider);
/**
* Returns the set of <tt>WizardPage</tt>-s for this
@ -86,7 +94,7 @@ public interface AccountRegistrationWizard
* @return the set of <tt>WizardPage</tt>-s for this
* wizard.
*/
public Iterator<WizardPage> getPages();
public abstract Iterator<WizardPage> getPages();
/**
* Returns the identifier of the first account registration wizard page.
@ -95,7 +103,7 @@ public interface AccountRegistrationWizard
*
* @return the identifier of the first account registration wizard page
*/
public Object getFirstPageIdentifier();
public abstract Object getFirstPageIdentifier();
/**
* Returns the identifier of the last account registration wizard page. This
@ -104,7 +112,7 @@ public interface AccountRegistrationWizard
*
* @return the identifier of the last account registration wizard page
*/
public Object getLastPageIdentifier();
public abstract Object getLastPageIdentifier();
/**
* Returns a set of key-value pairs that will represent the summary for
@ -113,7 +121,7 @@ public interface AccountRegistrationWizard
* @return a set of key-value pairs that will represent the summary for
* this wizard.
*/
public Iterator<Map.Entry<String, String>> getSummary();
public abstract Iterator<Map.Entry<String, String>> getSummary();
/**
* Defines the operations that will be executed when the user clicks on
@ -122,7 +130,7 @@ public interface AccountRegistrationWizard
* new account
* @throws OperationFailedException if the operation didn't succeed
*/
public ProtocolProviderService signin()
public abstract ProtocolProviderService signin()
throws OperationFailedException;
/**
@ -135,7 +143,7 @@ public ProtocolProviderService signin()
* new account
* @throws OperationFailedException if the operation didn't succeed
*/
public ProtocolProviderService signin( String userName,
public abstract ProtocolProviderService signin( String userName,
String password)
throws OperationFailedException;
@ -144,7 +152,7 @@ public ProtocolProviderService signin( String userName,
* <tt>protocolProvider</tt> has been removed.
* @param protocolProvider the protocol provider that has been removed
*/
public void accountRemoved(ProtocolProviderService protocolProvider);
public void accountRemoved(ProtocolProviderService protocolProvider) {}
/**
* Returns <code>true</code> if the web sign up is supported by the current
@ -152,7 +160,10 @@ public ProtocolProviderService signin( String userName,
* @return <code>true</code> if the web sign up is supported by the current
* implementation, <code>false</code> - otherwise
*/
public boolean isWebSignupSupported();
public boolean isWebSignupSupported()
{
return false;
}
/**
* Defines the operation that will be executed when user clicks on the
@ -161,14 +172,25 @@ public ProtocolProviderService signin( String userName,
* @throws UnsupportedOperationException if the web sign up operation is
* not supported by the current implementation.
*/
public void webSignup() throws UnsupportedOperationException;
public void webSignup() throws UnsupportedOperationException {}
/**
* Returns the preferred dimensions of this wizard.
*
* @return the preferred dimensions of this wizard.
*/
public Dimension getSize();
public abstract Dimension getSize();
/**
* 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.
*
* @param isCreateAccount indicates if the simple form should be opened as
* a create account form or as a login form
* @return a simple account registration form
*/
public abstract Object getSimpleForm(boolean isCreateAccount);
/**
* Sets the modification property to indicate if this wizard is opened for
@ -177,7 +199,10 @@ public ProtocolProviderService signin( String userName,
* @param isModification indicates if this wizard is opened for modification
* or for creating a new account.
*/
public void setModification(boolean isModification);
public void setModification(boolean isModification)
{
this.isModification = isModification;
}
/**
* Indicates if this wizard is modifying an existing account or is creating
@ -186,7 +211,10 @@ public ProtocolProviderService signin( String userName,
* @return <code>true</code> to indicate that this wizard is currently in
* modification mode, <code>false</code> - otherwise.
*/
public boolean isModification();
public boolean isModification()
{
return isModification;
}
/**
* Indicates whether this wizard enables the simple "sign in" form shown
@ -197,16 +225,48 @@ public ProtocolProviderService signin( String userName,
* @return <code>true</code> if the simple "Sign in" form is enabled or
* <code>false</code> otherwise.
*/
public boolean isSimpleFormEnabled();
public boolean isSimpleFormEnabled()
{
return true;
}
/**
* 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.
* Returns the wizard container, where all pages are added.
*
* @return the wizard container, where all pages are added
*/
public WizardContainer getWizardContainer()
{
return wizardContainer;
}
/**
* Sets the wizard container, where all pages are added.
*
* @param wizardContainer the wizard container, where all pages are added
*/
protected void setWizardContainer(WizardContainer wizardContainer)
{
this.wizardContainer = wizardContainer;
}
/**
* Indicates if this wizard is for the preferred protocol.
*
* @param isCreateAccount indicates if the simple form should be opened as
* a create account form or as a login form
* @return a simple account registration form
* @return <tt>true</tt> if this wizard corresponds to the preferred
* protocol, otherwise returns <tt>false</tt>
*/
public Object getSimpleForm(boolean isCreateAccount);
public boolean isPreferredProtocol()
{
// Check for preferred account through the PREFERRED_ACCOUNT_WIZARD
// property.
String prefWName = GuiServiceActivator.getResources().
getSettingsString("impl.gui.PREFERRED_ACCOUNT_WIZARD");
if(prefWName != null && prefWName.length() > 0
&& prefWName.equals(this.getClass().getName()))
return true;
return false;
}
}

@ -11,7 +11,7 @@
*
* @author Yana Stamcheva
*/
public interface ExtendedAccountRegistrationWizard
public abstract class ExtendedAccountRegistrationWizard
extends AccountRegistrationWizard
{
/**
@ -20,10 +20,10 @@ public interface ExtendedAccountRegistrationWizard
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - otherwise
*/
public boolean isSignupSupported();
public abstract boolean isSignupSupported();
/**
* Sets the create account view of this registration wizard.
*/
public void setCreateAccountView();
public abstract void setCreateAccountView();
}

@ -5,7 +5,8 @@ Bundle-Vendor: sip-communicator.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
net.java.sip.communicator.service.resources
net.java.sip.communicator.service.resources,
net.java.sip.communicator.util
Export-Package: net.java.sip.communicator.service.gui,
net.java.sip.communicator.service.gui.event,
net.java.sip.communicator.service.shutdown

@ -5,10 +5,14 @@
*/
package net.java.sip.communicator.service.gui.internal;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.*;
import org.osgi.framework.*;
/**
* @author Lubomir Marinov
* @author Yana Stamcheva
*/
public class GuiServiceActivator
implements BundleActivator
@ -18,6 +22,12 @@ public class GuiServiceActivator
*/
private static BundleContext bundleContext;
/**
* The <tt>ResourceManagementService</tt>, which gives access to application
* resources.
*/
private static ResourceManagementService resourceService;
/**
* Returns the <tt>BundleContext</tt>.
*
@ -48,4 +58,23 @@ public void stop(BundleContext bundleContext)
if (GuiServiceActivator.bundleContext == bundleContext)
GuiServiceActivator.bundleContext = null;
}
/**
* Returns the <tt>ResourceManagementService</tt>, through which we will
* access all resources.
*
* @return the <tt>ResourceManagementService</tt>, through which we will
* access all resources.
*/
public static ResourceManagementService getResources()
{
if (resourceService == null)
{
resourceService
= ServiceUtils.getService(
bundleContext,
ResourceManagementService.class);
}
return resourceService;
}
}

@ -263,6 +263,11 @@ public abstract class ProtocolProviderFactory
*/
public static final String IS_PROTOCOL_HIDDEN = "IS_PROTOCOL_HIDDEN";
/**
* Indicates if the given account is the preferred account.
*/
public static final String IS_PREFERRED_PROTOCOL = "IS_PREFERRED_PROTOCOL";
/**
* The name of the property that would indicate if a given account is
* currently enabled or disabled.

Loading…
Cancel
Save