29 |
29 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
30 |
30 |
|
31 |
31 |
/**
|
32 |
|
* <p>UserWizardPage class.</p>
|
33 |
|
*
|
34 |
32 |
* @author n.hoffmann
|
35 |
33 |
* @created 02.07.2009
|
36 |
34 |
* @version 1.0
|
37 |
35 |
*/
|
38 |
36 |
public class PasswordWizardPage extends AbstractCdmEntityWizardPage<User> implements ModifyListener{
|
39 |
37 |
|
40 |
|
/** Constant <code>NAME="USER_WIZARD_PAGE"</code> */
|
41 |
38 |
public static final String NAME = "USER_WIZARD_PAGE";
|
42 |
39 |
|
43 |
40 |
private TextWithLabelElement text_oldPassword;
|
... | ... | |
47 |
44 |
|
48 |
45 |
private final UniqueUserNameValidator uniqueUsernameValidator;
|
49 |
46 |
|
50 |
|
/**
|
51 |
|
* @param formFactory
|
52 |
|
* @param conversation
|
53 |
|
* @param entity
|
54 |
|
*/
|
55 |
47 |
protected PasswordWizardPage(CdmFormFactory formFactory,
|
56 |
48 |
ConversationHolder conversation, User entity) {
|
57 |
49 |
super(formFactory, conversation, entity);
|
... | ... | |
60 |
52 |
uniqueUsernameValidator = new UniqueUserNameValidator();
|
61 |
53 |
}
|
62 |
54 |
|
63 |
|
/* (non-Javadoc)
|
64 |
|
* @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#createControl(org.eclipse.swt.widgets.Composite)
|
65 |
|
*/
|
66 |
55 |
@Override
|
67 |
56 |
public void createControl(Composite parent) {
|
68 |
57 |
Composite control = formFactory.createComposite(parent);
|
... | ... | |
89 |
78 |
}
|
90 |
79 |
|
91 |
80 |
|
92 |
|
/* (non-Javadoc)
|
93 |
|
* @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement)
|
94 |
|
*/
|
95 |
81 |
@Override
|
96 |
82 |
public AbstractCdmDetailElement<User> createElement(
|
97 |
83 |
ICdmFormElement rootElement) {
|
... | ... | |
99 |
85 |
return null;
|
100 |
86 |
}
|
101 |
87 |
|
102 |
|
/* (non-Javadoc)
|
103 |
|
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
|
104 |
|
*/
|
105 |
88 |
/** {@inheritDoc} */
|
106 |
89 |
@Override
|
107 |
90 |
public void modifyText(ModifyEvent e) {
|
... | ... | |
126 |
109 |
private static final String USER_EXISTS = "Username already exists";
|
127 |
110 |
private static final String NAME_TO_SHORT = "Username is empty";
|
128 |
111 |
|
129 |
|
/* (non-Javadoc)
|
130 |
|
* @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
|
131 |
|
*/
|
132 |
112 |
@Override
|
133 |
113 |
public String isValid(String newText) {
|
134 |
114 |
// query for username
|
... | ... | |
153 |
133 |
private static final String TO_SHORT = "Password has to have at least " + PW_MIN_LENGTH + " characters";
|
154 |
134 |
private static final String NO_MATCH = "The passwords do not match";
|
155 |
135 |
|
156 |
|
/* (non-Javadoc)
|
157 |
|
* @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
|
158 |
|
*/
|
159 |
136 |
@Override
|
160 |
137 |
public String isValid(String newText) {
|
161 |
138 |
if(newText.length() < PW_MIN_LENGTH){
|
... | ... | |
180 |
157 |
|
181 |
158 |
}
|
182 |
159 |
|
183 |
|
/**
|
184 |
|
* @return
|
185 |
|
*/
|
186 |
160 |
public String getOldPassword() {
|
187 |
161 |
return text_oldPassword.getText();
|
188 |
162 |
}
|
189 |
163 |
|
190 |
|
/**
|
191 |
|
* @return
|
192 |
|
*/
|
193 |
164 |
public String getNewPassword() {
|
194 |
165 |
return text_password.getText();
|
195 |
166 |
}
|
Trim code #3102