Moves some special properties in the ExtendedAccountRegistrationWizard interface.

cusax-fix
Yana Stamcheva 15 years ago
parent 28ee92fa77
commit 0cfc06a084

@ -126,11 +126,15 @@ public String getProtocolName()
}
/**
* 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();
}
@ -190,17 +194,6 @@ public boolean isWebSignupSupported()
return false;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - otherwise
*/
public boolean isSignupSupported()
{
return false;
}
/**
* Empty interface method implementation, unused in the case of the
* {@link EmptyAccountRegistrationWizard}

@ -341,7 +341,7 @@ private void loadSelectedWizard(AccountRegistrationWizard wizard)
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 void run()
}
/**
* Sets the given wizard as a selected wizard.
* Sets the selected wizard.
*
* @param wizard the <tt>AccountRegistrationWizard</tt> 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);
}
}

@ -378,25 +378,16 @@ public boolean isWebSignupSupported()
return true;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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);

@ -447,25 +447,16 @@ public boolean isWebSignupSupported()
return false;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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);

@ -66,17 +66,21 @@ public Iterator<WizardPage> getPages()
}
/**
* 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);
}
/**

@ -360,25 +360,16 @@ public boolean isWebSignupSupported()
return false;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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();

@ -63,17 +63,21 @@ public Iterator<WizardPage> getPages()
}
/**
* 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);
}
/**

@ -375,25 +375,16 @@ public boolean isWebSignupSupported()
return true;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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);

@ -67,16 +67,21 @@ public Iterator<WizardPage> getPages()
}
/**
* 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);
}
/**

@ -61,16 +61,21 @@ public Iterator<WizardPage> getPages()
}
/**
* 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);
}
/**

@ -397,25 +397,16 @@ public boolean isWebSignupSupported()
return false;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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);

@ -606,27 +606,20 @@ public boolean isWebSignupSupported()
}
/**
* 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 <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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 Object getSimpleForm()
* @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;

@ -367,25 +367,16 @@ public boolean isWebSignupSupported()
return true;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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();

@ -329,25 +329,16 @@ public boolean isWebSignupSupported()
return false;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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();

@ -289,7 +289,9 @@ public AccountRegistrationPanel(
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 void mousePressed(MouseEvent e)
{
try
{
if (wizard.isSignupSupported())
if ((wizard
instanceof ExtendedAccountRegistrationWizard)
&& ((ExtendedAccountRegistrationWizard) wizard)
.isSignupSupported())
{
showCreateAccountWindow(wizard);
}
@ -677,7 +682,7 @@ private void showCreateAccountWindow(AccountRegistrationWizard wizard)
= SimpleAccountRegistrationActivator
.getUIService().getCreateAccountWindow();
createAccountWindow.setSelectedWizard(wizard);
createAccountWindow.setSelectedWizard(wizard, true);
createAccountWindow.setVisible(true);
}

@ -66,16 +66,21 @@ public Iterator<WizardPage> getPages()
}
/**
* 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);
}
/**

@ -438,4 +438,12 @@ boolean isSimpleForm()
{
return isSimpleForm;
}
/**
* Selects the create account button.
*/
void setCreateButtonSelected()
{
createAccountButton.setSelected(true);
}
}

@ -150,4 +150,14 @@ public boolean isCommitted()
{
return isCommitted;
}
/**
* Returns the SIPAccountRegistrationForm used in this page.
*
* @return the SIPAccountRegistrationForm
*/
SIPAccountRegistrationForm getRegistrationForm()
{
return registrationForm;
}
}

@ -531,4 +531,12 @@ protected String getCreateAccountLabel()
{
return wizard.getCreateAccountLabel();
}
/**
* Selects the create account button.
*/
void setCreateButtonSelected()
{
accountPanel.setCreateButtonSelected();
}
}

@ -24,7 +24,7 @@
* @author Grigorii Balutsel
*/
public class SIPAccountRegistrationWizard
implements AccountRegistrationWizard
implements ExtendedAccountRegistrationWizard
{
/**
* The first wizard page.
@ -715,12 +715,28 @@ public boolean isSignupSupported()
}
/**
* 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 Object getSimpleForm()
* @param registration the registration object
* @return the simple form
*/
public Object getSimpleForm(SIPAccountRegistration registration)
public Object getSimpleForm(SIPAccountRegistration registration,
boolean isCreateAccount)
{
this.registration = registration;

@ -348,25 +348,16 @@ public boolean isWebSignupSupported()
return false;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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();

@ -375,25 +375,16 @@ public boolean isWebSignupSupported()
return true;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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);

@ -402,25 +402,16 @@ public boolean isWebSignupSupported()
return false;
}
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - 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

@ -163,14 +163,6 @@ public ProtocolProviderService signin( String userName,
*/
public void webSignup() throws UnsupportedOperationException;
/**
* Indicates if a sign up form is supported by this wizard.
*
* @return <tt>true</tt> if a sign up form is supported by this wizard,
* <tt>false</tt> - otherwise
*/
public boolean isSignupSupported();
/**
* Returns the preferred dimensions of this wizard.
*
@ -211,8 +203,10 @@ public ProtocolProviderService signin( String userName,
* 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);
}

@ -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);
}

Loading…
Cancel
Save