PROTOCOL_PROPERTY_NAME --> PROTOCOL

cusax-fix
Emil Ivov 20 years ago
parent 3f6e547b51
commit 4bcb29977e

@ -26,43 +26,43 @@
public class IcqAccRegWizzActivator implements BundleActivator {
public static BundleContext bundleContext;
private static Logger logger = Logger.getLogger(
IcqAccRegWizzActivator.class.getName());
/**
* Starts this bundle.
*/
public void start(BundleContext bc) throws Exception {
bundleContext = bc;
ServiceReference uiServiceRef = bundleContext
.getServiceReference(UIService.class.getName());
UIService uiService
UIService uiService
= (UIService) bundleContext.getService(uiServiceRef);
AccountRegistrationWizardContainer wizardContainer
= uiService.getAccountRegWizardContainer();
IcqAccountRegistrationWizard icqWizard
= new IcqAccountRegistrationWizard(wizardContainer);
wizardContainer.addAccountRegistrationWizard(icqWizard);
}
public void stop(BundleContext bundleContext) throws Exception {
}
public static ProtocolProviderFactory getIcqProtocolProviderFactory() {
ServiceReference[] serRefs = null;
String osgiFilter = "("
+ ProtocolProviderFactory.PROTOCOL_PROPERTY_NAME
+ ProtocolProviderFactory.PROTOCOL
+ "="+ProtocolNames.ICQ+")";
try {
serRefs = bundleContext.getServiceReferences(
ProtocolProviderFactory.class.getName(), osgiFilter);

@ -12,25 +12,24 @@
import net.java.sip.communicator.service.gui.AccountRegistrationWizard;
import net.java.sip.communicator.service.gui.WizardContainer;
import net.java.sip.communicator.service.protocol.AccountProperties;
import net.java.sip.communicator.service.protocol.ProtocolProviderFactory;
/**
* The <tt>IcqAccountRegistrationWizard</tt> is an implementation of the
* <tt>AccountRegistrationWizard</tt> for the ICQ protocol. It should allow
* the user to create and configure a new ICQ account.
*
* the user to create and configure a new ICQ account.
*
* @author Yana Stamcheva
*/
public class IcqAccountRegistrationWizard implements AccountRegistrationWizard {
private FirstWizardPage firstWizardPage;
private ArrayList pages = new ArrayList();
private IcqAccountRegistration registration
= new IcqAccountRegistration();
/**
* Creates an instance of <tt>IcqAccountRegistrationWizard</tt>.
* @param wizardContainer the wizard container, where this wizard
@ -38,10 +37,10 @@ public class IcqAccountRegistrationWizard implements AccountRegistrationWizard {
*/
public IcqAccountRegistrationWizard(WizardContainer wizardContainer) {
firstWizardPage = new FirstWizardPage(registration, wizardContainer);
pages.add(firstWizardPage);
pages.add(firstWizardPage);
}
/**
* Implements the <code>AccountRegistrationWizard.getIcon</code> method.
* Returns the icon to be used for this wizard.
@ -78,11 +77,11 @@ public Iterator getPages() {
*/
public Iterator getSummary() {
Hashtable summaryTable = new Hashtable();
summaryTable.put("UIN", registration.getUin());
summaryTable.put("Remember password",
summaryTable.put("Remember password",
new Boolean(registration.isRememberPassword()));
return summaryTable.entrySet().iterator();
}
@ -90,13 +89,13 @@ public Iterator getSummary() {
* Installs the account created through this wizard.
*/
public void finish() {
ProtocolProviderFactory factory
ProtocolProviderFactory factory
= IcqAccRegWizzActivator.getIcqProtocolProviderFactory();
this.installAccount(factory,
this.installAccount(factory,
registration.getUin(), registration.getPassword());
}
/**
* Creates an account for the given user and password.
* @param providerFactory the ProtocolProviderFactory which will create
@ -109,13 +108,12 @@ public void installAccount( ProtocolProviderFactory providerFactory,
String passwd) {
Hashtable accountProperties = new Hashtable();
if(registration.isRememberPassword()) {
accountProperties.put(AccountProperties.PASSWORD, passwd);
accountProperties.put(ProtocolProviderFactory.PASSWORD, passwd);
}
providerFactory.installAccount(
IcqAccRegWizzActivator.bundleContext, user,
accountProperties);
user, accountProperties);
}
}

Loading…
Cancel
Save