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
.handler
;
13 import org
.eclipse
.core
.commands
.AbstractHandler
;
14 import org
.eclipse
.core
.commands
.ExecutionEvent
;
15 import org
.eclipse
.core
.commands
.ExecutionException
;
16 import org
.eclipse
.core
.commands
.IHandler
;
17 import org
.eclipse
.jface
.wizard
.WizardDialog
;
19 import eu
.etaxonomy
.cdm
.model
.common
.User
;
20 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
21 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
23 import eu
.etaxonomy
.taxeditor
.ui
.password
.PasswordWizard
;
26 * <p>ShowLoginWindowHandler class.</p>
29 * @created Aug 7, 2009
32 public class OpenPasswordWizzardHandler
extends AbstractHandler
implements IHandler
{
35 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
39 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
41 Object principal
= CdmStore
.getCurrentAuthentiation().getPrincipal();
43 if(principal
instanceof User
){
45 PasswordWizard wizard
= new PasswordWizard((User
)principal
, null);
46 WizardDialog dialog
= new WizardDialog(AbstractUtility
.getShell(), wizard
);
51 // should never happen, log an error
52 MessagingUtils
.error(OpenPasswordWizzardHandler
.class, "The principal currently authenticated is not a eu.etaxonomy.cdm.model.common.User", null);