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
.user
.wizard
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.eclipse
.core
.commands
.operations
.IUndoableOperation
;
15 import org
.eclipse
.core
.runtime
.Status
;
16 import org
.eclipse
.jface
.wizard
.Wizard
;
18 import eu
.etaxonomy
.cdm
.model
.common
.User
;
19 import eu
.etaxonomy
.taxeditor
.operations
.CreateUserOperation
;
20 import eu
.etaxonomy
.taxeditor
.operations
.EditUserOperation
;
21 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
22 import eu
.etaxonomy
.taxeditor
.user
.view
.UserManagerView
;
29 public class UserWizard
extends Wizard
{
30 private static final Logger logger
= Logger
.getLogger(UserWizard
.class);
32 private UserWizardPage page
;
33 private UserManagerView view
;
34 private boolean createMode
;
36 public UserWizard(UserManagerView view
){
38 setWindowTitle("User Wizard");
42 public UserWizard(UserManagerView view
, User user
){
51 * @see org.eclipse.jface.wizard.Wizard#addPages()
54 public void addPages() {
57 page
= new UserWizardPage(user
);
64 * @see org.eclipse.jface.wizard.Wizard#performFinish()
67 public boolean performFinish() {
69 IUndoableOperation operation
;
71 operation
= new CreateUserOperation("Create User",
72 StoreUtil
.getUndoContext(), page
.getUser(), view
, view
);
74 operation
= new EditUserOperation("Edit User",
75 StoreUtil
.getUndoContext(), page
.getUser(), view
, view
);
78 return StoreUtil
.executeOperation(operation
) == Status
.OK_STATUS ?
true : false;