From 0cfc06a0847c11cc26edb44f6432a6f15fe27d21 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Wed, 25 May 2011 10:06:23 +0000 Subject: Moves some special properties in the ExtendedAccountRegistrationWizard interface. --- .../account/EmptyAccountRegistrationWizard.java | 21 ++++++---------- .../impl/gui/main/account/NewAccountDialog.java | 13 ++++++---- .../AimAccountRegistrationWizard.java | 17 +++---------- .../DictAccountRegistrationWizard.java | 17 +++---------- .../FacebookAccountRegistrationWizard.java | 12 ++++++--- .../GibberishAccountRegistrationWizard.java | 17 +++---------- .../GoogleTalkAccountRegistrationWizard.java | 12 ++++++--- .../IcqAccountRegistrationWizard.java | 17 +++---------- .../IppiAccountRegistrationWizard.java | 13 +++++++--- .../IptelAccountRegistrationWizard.java | 13 +++++++--- .../IrcAccountRegistrationWizard.java | 17 +++---------- .../JabberAccountRegistrationWizard.java | 26 ++++++++----------- .../MsnAccountRegistrationWizard.java | 17 +++---------- .../RssAccountRegistrationWizard.java | 17 +++---------- .../InitialAccountRegistrationFrame.java | 11 +++++--- .../Sip2SipAccountRegistrationWizard.java | 13 +++++++--- .../plugin/sipaccregwizz/AccountPanel.java | 8 ++++++ .../plugin/sipaccregwizz/FirstWizardPage.java | 10 ++++++++ .../sipaccregwizz/SIPAccountRegistrationForm.java | 8 ++++++ .../SIPAccountRegistrationWizard.java | 29 +++++++++++++++++----- .../SSHAccountRegistrationWizard.java | 17 +++---------- .../YahooAccountRegistrationWizard.java | 17 +++---------- .../ZeroconfAccountRegistrationWizard.java | 17 +++---------- .../service/gui/AccountRegistrationWizard.java | 14 +++-------- .../service/gui/CreateAccountWindow.java | 5 +++- 25 files changed, 173 insertions(+), 205 deletions(-) (limited to 'src/net/java/sip/communicator') diff --git a/src/net/java/sip/communicator/impl/gui/main/account/EmptyAccountRegistrationWizard.java b/src/net/java/sip/communicator/impl/gui/main/account/EmptyAccountRegistrationWizard.java index 46ec5e3..ed5d593 100644 --- a/src/net/java/sip/communicator/impl/gui/main/account/EmptyAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/impl/gui/main/account/EmptyAccountRegistrationWizard.java @@ -126,11 +126,15 @@ class EmptyAccountRegistrationWizard } /** - * Returns our only wizard page. + * 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. * - * @return our only wizard page. + * @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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { return page.getSimpleForm(); } @@ -191,17 +195,6 @@ class EmptyAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - return false; - } - - /** * Empty interface method implementation, unused in the case of the * {@link EmptyAccountRegistrationWizard} */ diff --git a/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java b/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java index cf5ad5c..8d66f96 100644 --- a/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java @@ -341,7 +341,7 @@ public class NewAccountDialog fixedWidthPanel.setMinimumSize(new Dimension(430, 3)); fixedWidthPanel.setMaximumSize(new Dimension(430, 3)); - JComponent simpleWizardForm = (JComponent) wizard.getSimpleForm(); + JComponent simpleWizardForm = (JComponent) wizard.getSimpleForm(false); simpleWizardForm.setOpaque(false); accountPanel.add(simpleWizardForm); @@ -652,13 +652,16 @@ public class NewAccountDialog } /** - * Sets the given wizard as a selected wizard. + * Sets the selected wizard. * - * @param wizard the AccountRegistrationWizard to set as a selected - * wizard + * @param wizard the wizard to select + * @param isCreatedForm indicates if the selected wizard should be opened + * in create account mode */ - public void setSelectedWizard(AccountRegistrationWizard wizard) + public void setSelectedWizard( AccountRegistrationWizard wizard, + boolean isCreateAccount) { networkComboBox.setSelectedItem(wizard); + } } diff --git a/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistrationWizard.java index 54f5200..00ae49a 100644 --- a/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/aimaccregwizz/AimAccountRegistrationWizard.java @@ -379,24 +379,15 @@ public class AimAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { firstWizardPage = new FirstWizardPage(this); diff --git a/src/net/java/sip/communicator/plugin/dictaccregwizz/DictAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/dictaccregwizz/DictAccountRegistrationWizard.java index 9532ac8..59f03eb 100644 --- a/src/net/java/sip/communicator/plugin/dictaccregwizz/DictAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/dictaccregwizz/DictAccountRegistrationWizard.java @@ -448,24 +448,15 @@ public class DictAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { firstWizardPage = new FirstWizardPage(this); diff --git a/src/net/java/sip/communicator/plugin/facebookaccregwizz/FacebookAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/facebookaccregwizz/FacebookAccountRegistrationWizard.java index 5ccf68a..32d7685 100644 --- a/src/net/java/sip/communicator/plugin/facebookaccregwizz/FacebookAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/facebookaccregwizz/FacebookAccountRegistrationWizard.java @@ -66,17 +66,21 @@ public class FacebookAccountRegistrationWizard } /** - * Returns the first wizard page. + * 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. * - * @return the first wizard page. + * @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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { JabberAccountRegistration reg = new JabberAccountRegistration(); setPredefinedProperties(reg); - return getSimpleForm(reg); + return getSimpleForm(reg, isCreateAccount); } /** diff --git a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/GibberishAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/GibberishAccountRegistrationWizard.java index 0d1a6cf..283c884 100644 --- a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/GibberishAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/GibberishAccountRegistrationWizard.java @@ -361,24 +361,15 @@ public class GibberishAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { firstWizardPage = new FirstWizardPage(this); return firstWizardPage.getSimpleForm(); diff --git a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/GoogleTalkAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/GoogleTalkAccountRegistrationWizard.java index 4cdaa0a..9d71af5 100644 --- a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/GoogleTalkAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/GoogleTalkAccountRegistrationWizard.java @@ -63,17 +63,21 @@ public class GoogleTalkAccountRegistrationWizard } /** - * Returns the first wizard page. + * 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. * - * @return the first wizard page. + * @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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { JabberAccountRegistration reg = new JabberAccountRegistration(); setPredefinedProperties(reg); - return getSimpleForm(reg); + return getSimpleForm(reg, isCreateAccount); } /** diff --git a/src/net/java/sip/communicator/plugin/icqaccregwizz/IcqAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/icqaccregwizz/IcqAccountRegistrationWizard.java index 042b472..c32b5cc 100644 --- a/src/net/java/sip/communicator/plugin/icqaccregwizz/IcqAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/icqaccregwizz/IcqAccountRegistrationWizard.java @@ -376,24 +376,15 @@ public class IcqAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { firstWizardPage = new FirstWizardPage(this); diff --git a/src/net/java/sip/communicator/plugin/ippiaccregwizz/IppiAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/ippiaccregwizz/IppiAccountRegistrationWizard.java index d37d780..eb86882 100644 --- a/src/net/java/sip/communicator/plugin/ippiaccregwizz/IppiAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/ippiaccregwizz/IppiAccountRegistrationWizard.java @@ -67,16 +67,21 @@ public class IppiAccountRegistrationWizard } /** - * Returns the simple form. - * @return the simple form + * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { SIPAccountRegistration reg = new SIPAccountRegistration(); setPredefinedProperties(reg); - return getSimpleForm(reg); + return getSimpleForm(reg, isCreateAccount); } /** diff --git a/src/net/java/sip/communicator/plugin/iptelaccregwizz/IptelAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/iptelaccregwizz/IptelAccountRegistrationWizard.java index 5816168..4a9f55d 100644 --- a/src/net/java/sip/communicator/plugin/iptelaccregwizz/IptelAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/iptelaccregwizz/IptelAccountRegistrationWizard.java @@ -61,16 +61,21 @@ public class IptelAccountRegistrationWizard } /** - * Returns the simple form. - * @return the simple form + * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { SIPAccountRegistration reg = new SIPAccountRegistration(); setPredefinedProperties(reg); - return getSimpleForm(reg); + return getSimpleForm(reg, isCreateAccount); } /** diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java index 6f95874..ddcaec3 100644 --- a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java @@ -398,24 +398,15 @@ public class IrcAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { firstWizardPage = new FirstWizardPage(this); diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java index 796216f..218624b 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationWizard.java @@ -606,27 +606,20 @@ public class JabberAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. + * 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. * - * @return true if a sign up form is supported by this wizard, - * false - otherwise + * @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 boolean isSignupSupported() - { - return false; - } - - /** - * Returns the first wizard page. - * - * @return the first wizard page. - */ - public Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { // when creating first wizard page, create and new // AccountRegistration to avoid reusing old instances and // data left from old registrations - return getSimpleForm(new JabberAccountRegistration()); + return getSimpleForm(new JabberAccountRegistration(), isCreateAccount); } /** @@ -635,7 +628,8 @@ public class JabberAccountRegistrationWizard * @param registration the registration object * @return the first wizard page. */ - public Object getSimpleForm(JabberAccountRegistration registration) + public Object getSimpleForm(JabberAccountRegistration registration, + boolean isCreateAccount) { this.registration = registration; diff --git a/src/net/java/sip/communicator/plugin/msnaccregwizz/MsnAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/msnaccregwizz/MsnAccountRegistrationWizard.java index 1c54a8f..8eb4ec9 100644 --- a/src/net/java/sip/communicator/plugin/msnaccregwizz/MsnAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/msnaccregwizz/MsnAccountRegistrationWizard.java @@ -368,24 +368,15 @@ public class MsnAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { firstWizardPage = new FirstWizardPage(this); return firstWizardPage.getSimpleForm(); diff --git a/src/net/java/sip/communicator/plugin/rssaccregwizz/RssAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/rssaccregwizz/RssAccountRegistrationWizard.java index d92af6d..04b702e 100644 --- a/src/net/java/sip/communicator/plugin/rssaccregwizz/RssAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/rssaccregwizz/RssAccountRegistrationWizard.java @@ -330,24 +330,15 @@ public class RssAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { firstWizardPage = new FirstWizardPage(registration, wizardContainer); return firstWizardPage.getSimpleForm(); diff --git a/src/net/java/sip/communicator/plugin/simpleaccreg/InitialAccountRegistrationFrame.java b/src/net/java/sip/communicator/plugin/simpleaccreg/InitialAccountRegistrationFrame.java index 8cbca7f..1d72b33 100644 --- a/src/net/java/sip/communicator/plugin/simpleaccreg/InitialAccountRegistrationFrame.java +++ b/src/net/java/sip/communicator/plugin/simpleaccreg/InitialAccountRegistrationFrame.java @@ -289,7 +289,9 @@ public class InitialAccountRegistrationFrame inputRegisterPanel.add(inputPanel, BorderLayout.NORTH); - if (wizard.isSignupSupported() || wizard.isWebSignupSupported()) + if (((wizard instanceof ExtendedAccountRegistrationWizard) + && ((ExtendedAccountRegistrationWizard) wizard) + .isSignupSupported()) || wizard.isWebSignupSupported()) { String textKey = isPreferredWizard ? "plugin.simpleaccregwizz.SPECIAL_SIGNUP" @@ -310,7 +312,10 @@ public class InitialAccountRegistrationFrame { try { - if (wizard.isSignupSupported()) + if ((wizard + instanceof ExtendedAccountRegistrationWizard) + && ((ExtendedAccountRegistrationWizard) wizard) + .isSignupSupported()) { showCreateAccountWindow(wizard); } @@ -677,7 +682,7 @@ public class InitialAccountRegistrationFrame = SimpleAccountRegistrationActivator .getUIService().getCreateAccountWindow(); - createAccountWindow.setSelectedWizard(wizard); + createAccountWindow.setSelectedWizard(wizard, true); createAccountWindow.setVisible(true); } diff --git a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/Sip2SipAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/Sip2SipAccountRegistrationWizard.java index 4b40269..a6999af 100644 --- a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/Sip2SipAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/Sip2SipAccountRegistrationWizard.java @@ -66,16 +66,21 @@ public class Sip2SipAccountRegistrationWizard } /** - * Returns the simple form. - * @return the simple form + * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { SIPAccountRegistration reg = new SIPAccountRegistration(); setPredefinedProperties(reg); - return getSimpleForm(reg); + return getSimpleForm(reg, isCreateAccount); } /** diff --git a/src/net/java/sip/communicator/plugin/sipaccregwizz/AccountPanel.java b/src/net/java/sip/communicator/plugin/sipaccregwizz/AccountPanel.java index aab4c5b..b65d00f 100644 --- a/src/net/java/sip/communicator/plugin/sipaccregwizz/AccountPanel.java +++ b/src/net/java/sip/communicator/plugin/sipaccregwizz/AccountPanel.java @@ -438,4 +438,12 @@ public class AccountPanel { return isSimpleForm; } + + /** + * Selects the create account button. + */ + void setCreateButtonSelected() + { + createAccountButton.setSelected(true); + } } diff --git a/src/net/java/sip/communicator/plugin/sipaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/sipaccregwizz/FirstWizardPage.java index df7bbcc..e19b45b 100644 --- a/src/net/java/sip/communicator/plugin/sipaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/sipaccregwizz/FirstWizardPage.java @@ -150,4 +150,14 @@ public class FirstWizardPage { return isCommitted; } + + /** + * Returns the SIPAccountRegistrationForm used in this page. + * + * @return the SIPAccountRegistrationForm + */ + SIPAccountRegistrationForm getRegistrationForm() + { + return registrationForm; + } } diff --git a/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationForm.java b/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationForm.java index c4db314..f366e2c 100644 --- a/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationForm.java +++ b/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationForm.java @@ -531,4 +531,12 @@ public class SIPAccountRegistrationForm { return wizard.getCreateAccountLabel(); } + + /** + * Selects the create account button. + */ + void setCreateButtonSelected() + { + accountPanel.setCreateButtonSelected(); + } } diff --git a/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java index f782d46..bcb62ed 100644 --- a/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java @@ -24,7 +24,7 @@ import org.osgi.framework.*; * @author Grigorii Balutsel */ public class SIPAccountRegistrationWizard - implements AccountRegistrationWizard + implements ExtendedAccountRegistrationWizard { /** * The first wizard page. @@ -715,12 +715,28 @@ public class SIPAccountRegistrationWizard } /** - * Returns the simple form. - * @return the simple form + * Sets the create account view of this registration wizard. + */ + public void setCreateAccountView() + { + if (getCreateAccountService() != null) + { + firstWizardPage.getRegistrationForm().setCreateButtonSelected(); + } + } + + /** + * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { - return getSimpleForm(new SIPAccountRegistration()); + return getSimpleForm(new SIPAccountRegistration(), isCreateAccount); } /** @@ -729,7 +745,8 @@ public class SIPAccountRegistrationWizard * @param registration the registration object * @return the simple form */ - public Object getSimpleForm(SIPAccountRegistration registration) + public Object getSimpleForm(SIPAccountRegistration registration, + boolean isCreateAccount) { this.registration = registration; diff --git a/src/net/java/sip/communicator/plugin/sshaccregwizz/SSHAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/sshaccregwizz/SSHAccountRegistrationWizard.java index faf0c28..58e4ed0 100644 --- a/src/net/java/sip/communicator/plugin/sshaccregwizz/SSHAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/sshaccregwizz/SSHAccountRegistrationWizard.java @@ -349,24 +349,15 @@ public class SSHAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { firstWizardPage = new FirstWizardPage(registration, wizardContainer); return firstWizardPage.getSimpleForm(); diff --git a/src/net/java/sip/communicator/plugin/yahooaccregwizz/YahooAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/yahooaccregwizz/YahooAccountRegistrationWizard.java index 8a54e63..e425520 100644 --- a/src/net/java/sip/communicator/plugin/yahooaccregwizz/YahooAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/yahooaccregwizz/YahooAccountRegistrationWizard.java @@ -376,24 +376,15 @@ public class YahooAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { firstWizardPage = new FirstWizardPage(this); diff --git a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/ZeroconfAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/ZeroconfAccountRegistrationWizard.java index f7ad175..947f750 100644 --- a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/ZeroconfAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/ZeroconfAccountRegistrationWizard.java @@ -403,24 +403,15 @@ public class ZeroconfAccountRegistrationWizard } /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported() - { - 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 * 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 Object getSimpleForm() + public Object getSimpleForm(boolean isCreateAccount) { // when creating first wizard page, create and new // AccountRegistration to avoid reusing old instances and diff --git a/src/net/java/sip/communicator/service/gui/AccountRegistrationWizard.java b/src/net/java/sip/communicator/service/gui/AccountRegistrationWizard.java index 0aba34a..c1bf3bc 100644 --- a/src/net/java/sip/communicator/service/gui/AccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/service/gui/AccountRegistrationWizard.java @@ -164,14 +164,6 @@ public interface AccountRegistrationWizard public void webSignup() throws UnsupportedOperationException; /** - * Indicates if a sign up form is supported by this wizard. - * - * @return true if a sign up form is supported by this wizard, - * false - otherwise - */ - public boolean isSignupSupported(); - - /** * Returns the preferred dimensions of this wizard. * * @return the preferred dimensions of this wizard. @@ -211,8 +203,10 @@ public interface AccountRegistrationWizard * 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 Object getSimpleForm(); + public Object getSimpleForm(boolean isCreateAccount); } diff --git a/src/net/java/sip/communicator/service/gui/CreateAccountWindow.java b/src/net/java/sip/communicator/service/gui/CreateAccountWindow.java index f972e0f..8dadbae 100644 --- a/src/net/java/sip/communicator/service/gui/CreateAccountWindow.java +++ b/src/net/java/sip/communicator/service/gui/CreateAccountWindow.java @@ -24,6 +24,9 @@ public interface CreateAccountWindow * Sets the selected wizard. * * @param wizard the wizard to select + * @param isCreatedForm indicates if the selected wizard should be opened + * in create account mode */ - public void setSelectedWizard(AccountRegistrationWizard wizard); + public void setSelectedWizard( AccountRegistrationWizard wizard, + boolean isCreateAccount); } -- cgit v1.1