Skip to main content
summaryrefslogtreecommitdiffstats
blob: 0047efc3c70458d676c7abdfe85817ad903cd522 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*******************************************************************************
 * Copyright (c) 2003, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.j2ee.internal.wizard;

import org.eclipse.jst.j2ee.application.internal.operations.J2EEUtilityJarListImportDataModelProvider;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
import org.eclipse.wst.project.facet.IProductConstants;
import org.eclipse.wst.project.facet.ProductManager;


/**
 * <p>
 * Used to import Utility Jars into several Eclipse workbench configurations. These can be extracted
 * as editable projects, binary projects, linked resources in the EAR module or actual resources in
 * the EAR module.
 * </p>
 */
public final class J2EEUtilityJarImportWizardNew extends J2EEArtifactImportWizard{

	/**
	 * <p>
	 * Constant used to identify the key of the page of the Wizard which allows users to define the
	 * type of import they would like to carry out.
	 * </p>
	 */
	private static final String IMPORT_TYPE = "IMPORT_TYPE"; //$NON-NLS-1$

	/**
	 * <p>
	 * Constant used to identify the key of the page of the Wizard that allows users to select jar
	 * files for import
	 * </p>
	 */
	private static final String SELECT_JARS = "SELECT_JARS"; //$NON-NLS-1$
 

	/**
	 * <p>
	 * The default constructor. Creates a wizard with no selection, no model instance, and no
	 * operation instance. The model and operation will be created as needed.
	 * </p>
	 */
	public J2EEUtilityJarImportWizardNew() {
		super();
		setWindowTitle(J2EEUIMessages.getResourceString("38")); //$NON-NLS-1$
	}

	/**
	 * <p>
	 * The model is used to prepopulate the wizard controls and interface with the operation.
	 * </p>
	 * 
	 * @param model
	 *            The model parameter is used to pre-populate wizard controls and interface with the
	 *            operation
	 */
	public J2EEUtilityJarImportWizardNew(IDataModel model) {
		super(model);
		setWindowTitle(J2EEUIMessages.getResourceString("38")); //$NON-NLS-1$
	}

	/**
	 * <p>
	 * Adds the following pages:
	 * <ul>
	 * <li>{@link J2EEUtilityJarImportTypePageNew}as the main wizard page ({@link #IMPORT_TYPE})
	 * <li>{@link J2EEUtilityJarImportPageNew}as the main wizard page ({@link #SELECT_JARS})
	 * </ul>
	 * </p>
	 */
	@Override
	public void doAddPages() {
		this.addPage(new J2EEUtilityJarImportTypePageNew(getDataModel(), IMPORT_TYPE, getSelection()));
		this.addPage(new J2EEUtilityJarImportPageNew(getDataModel(), SELECT_JARS));
	}

	@Override
	protected IDataModelProvider getDefaultProvider() {
		return new J2EEUtilityJarListImportDataModelProvider();
	}
	
	@Override
	protected String getFinalPerspectiveID() {
        return ProductManager.getProperty(IProductConstants.FINAL_PERSPECTIVE_UTILITY);
	}

}

Back to the top