import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
*/
@Override
public void widgetSelected(SelectionEvent e) {
- PasswordWizard wizard = new PasswordWizard(user, conversation);
- WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);
-
- dialog.open();
+ if(!CdmStore.getService(IUserService.class).userExists(user.getUsername())) {
+ MessagingUtils.warningDialog("Username does not exist", this, "Please create or save user '" + user.getUsername() + "' before changing password");
+ } else {
+ PasswordWizard wizard = new PasswordWizard(user, conversation);
+ WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);
+ dialog.open();
+ }
}
/* (non-Javadoc)