3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.ui
.password
;
13 import org
.eclipse
.jface
.wizard
.WizardDialog
;
14 import org
.eclipse
.swt
.SWT
;
15 import org
.eclipse
.swt
.events
.SelectionEvent
;
16 import org
.eclipse
.swt
.events
.SelectionListener
;
17 import org
.eclipse
.swt
.widgets
.Button
;
18 import org
.eclipse
.swt
.widgets
.Label
;
20 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
21 import eu
.etaxonomy
.cdm
.api
.conversation
.IConversationEnabled
;
22 import eu
.etaxonomy
.cdm
.model
.common
.User
;
23 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeMap
;
24 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractCdmFormElement
;
25 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
26 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
27 import eu
.etaxonomy
.taxeditor
.ui
.element
.LayoutConstants
;
31 * @created Mar 10, 2011
34 public class EditPasswordElement
extends AbstractCdmFormElement
implements SelectionListener
, IConversationEnabled
{
37 private Button button
;
39 private ConversationHolder conversation
;
45 public EditPasswordElement(CdmFormFactory formFactory
,
46 ICdmFormElement formElement
, String labelString
, User user
, ConversationHolder conversation
) {
47 super(formFactory
, formElement
);
49 this.conversation
= conversation
;
52 Label label
= formFactory
.createLabel(getLayoutComposite(), null);
55 String buttonLabelString
= (labelString
!= null) ? labelString
: "Change Password";
57 button
= formFactory
.createButton(getLayoutComposite(), buttonLabelString
, SWT
.PUSH
);
58 button
.setLayoutData(LayoutConstants
.RIGHT());
61 button
.addSelectionListener(this);
65 * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
68 public void widgetSelected(SelectionEvent e
) {
69 PasswordWizard wizard
= new PasswordWizard(user
, conversation
);
70 WizardDialog dialog
= new WizardDialog(getLayoutComposite().getShell(), wizard
);
76 * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
79 public void widgetDefaultSelected(SelectionEvent e
) {}
82 * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
85 public void update(CdmDataChangeMap arg0
) {}
88 * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
91 public ConversationHolder
getConversationHolder() {