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
.account
.user
.wizard
;
13 import org
.eclipse
.core
.runtime
.Status
;
14 import org
.eclipse
.jface
.wizard
.Wizard
;
16 import eu
.etaxonomy
.cdm
.model
.common
.User
;
17 import eu
.etaxonomy
.taxeditor
.account
.user
.operation
.CreateUserOperation
;
18 import eu
.etaxonomy
.taxeditor
.account
.user
.operation
.EditUserOperation
;
19 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPostOperation
;
20 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
21 import eu
.etaxonomy
.taxeditor
.view
.user
.UserView
;
24 * <p>UserWizard class.</p>
30 public class UserWizard
extends Wizard
{
32 private UserWizardPage page
;
33 private UserView view
;
34 private boolean createMode
;
37 * <p>Constructor for UserWizard.</p>
39 * @param view a {@link eu.etaxonomy.taxeditor.view.user.UserView} object.
41 public UserWizard(UserView view
){
43 setWindowTitle("User Wizard");
48 * <p>Constructor for UserWizard.</p>
50 * @param view a {@link eu.etaxonomy.taxeditor.view.user.UserView} object.
51 * @param user a {@link eu.etaxonomy.cdm.model.common.User} object.
53 public UserWizard(UserView view
, User user
){
62 * @see org.eclipse.jface.wizard.Wizard#addPages()
66 public void addPages() {
69 page
= new UserWizardPage(user
);
76 * @see org.eclipse.jface.wizard.Wizard#performFinish()
80 public boolean performFinish() {
82 AbstractPostOperation operation
;
84 operation
= new CreateUserOperation("Create User",
85 StoreUtil
.getUndoContext(), page
.getUser(), view
, view
);
87 operation
= new EditUserOperation("Edit User",
88 StoreUtil
.getUndoContext(), page
.getUser(), view
, view
);
91 return StoreUtil
.executeOperation(operation
) == Status
.OK_STATUS ?
true : false;