Project

General

Profile

« Previous | Next » 

Revision 144153b3

Added by Patrick Plitzner almost 8 years ago

Trim code #3102

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/EditPasswordElement.java
1 1
// $Id$
2 2
/**
3 3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
4
* European Distributed Institute of Taxonomy
5 5
* http://www.e-taxonomy.eu
6
* 
6
*
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
......
40 40
	private Button button;
41 41

  
42 42
	private ConversationHolder conversation;
43
	
44
	/**
45
	 * @param formFactory
46
	 * @param formElement
47
	 */
43

  
48 44
	public EditPasswordElement(CdmFormFactory formFactory,
49 45
			ICdmFormElement formElement, String labelString, User user, ConversationHolder conversation) {
50 46
		super(formFactory, formElement);
51
		
47

  
52 48
		this.conversation = conversation;
53 49
		this.user = user;
54
		
50

  
55 51
		Label label = formFactory.createLabel(getLayoutComposite(), null);
56 52
		addControl(label);
57
		
53

  
58 54
		String buttonLabelString = (labelString != null) ? labelString : "Change Password";
59
		
55

  
60 56
		button = formFactory.createButton(getLayoutComposite(), buttonLabelString, SWT.PUSH);
61 57
		button.setLayoutData(LayoutConstants.RIGHT());
62 58
		addControl(button);
63
		
59

  
64 60
		button.addSelectionListener(this);
65 61
	}
66 62

  
67
	/* (non-Javadoc)
68
	 * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
69
	 */
70 63
	@Override
71 64
	public void widgetSelected(SelectionEvent e) {
72 65
		if(!CdmStore.getService(IUserService.class).userExists(user.getUsername())) {
73 66
			MessagingUtils.warningDialog("Username does not exist", this, "Please create or save user '" + user.getUsername() + "' before changing password");
74 67
		} else {
75 68
			PasswordWizard wizard = new PasswordWizard(user, conversation);
76
			WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);		
69
			WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);
77 70
			dialog.open();
78 71
		}
79 72
	}
80 73

  
81
	/* (non-Javadoc)
82
	 * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
83
	 */
84 74
	@Override
85 75
	public void widgetDefaultSelected(SelectionEvent e) {}
86 76

  
87
	/* (non-Javadoc)
88
	 * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
89
	 */
90 77
	@Override
91 78
	public void update(CdmDataChangeMap arg0) {}
92 79

  
93
	/* (non-Javadoc)
94
	 * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
95
	 */
96 80
	@Override
97 81
	public ConversationHolder getConversationHolder() {
98 82
		return conversation;

Also available in: Unified diff