/******************************************************************************* * Copyright (c) 2003, 2004 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.servlet.ui; import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin; import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPluginIcons; import org.eclipse.jst.j2ee.internal.web.archive.operations.WebModuleExportDataModel; import org.eclipse.jst.j2ee.internal.web.archive.operations.WebModuleExportOperation; import org.eclipse.jst.j2ee.ui.J2EEArtifactExportWizard; import org.eclipse.jst.servlet.ui.internal.wizard.WARExportPage; import org.eclipse.ui.IExportWizard; import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel; /** *

* Wizard used to export J2EE Web Application module structures * from the Eclipse Workbench to a deployable Web Application * Archive *.war file. *

*/ public final class WebModuleExportWizard extends J2EEArtifactExportWizard implements IExportWizard { /** *

* 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. *

*/ public WebModuleExportWizard() { super(); } /** *

* The model is used to prepopulate the wizard controls * and interface with the operation. *

* @param model The model parameter is used to pre-populate wizard controls and interface with the operation */ public WebModuleExportWizard(WebModuleExportDataModel model) { super(model); } /** * {@inheritDoc} * *

* Overridden to return an {@link EnterpriseApplicationImportDataModel}. *

* * @see org.eclipse.wst.common.frameworks.internal.ui.wizard.WTPWizard#createDefaultModel() */ protected WTPOperationDataModel createDefaultModel() { return new WebModuleExportDataModel(); } /** * {@inheritDoc} * *

* Returns an {@link WebModuleExportOperation} using the model either * supplied in the constructor or created from {@link #createDefaultModel()}. *

* @return Returns the operation to be executed when the Wizard completes. */ protected WTPOperation createOperation() { return new WebModuleExportOperation(getSpecificModel()); } /** *

* Adds the following pages: *

*

*/ public void addPages() { addPage(new WARExportPage(getSpecificModel(), MAIN_PG, getSelection())); } /** * {@inheritDoc} * *

* Sets up the default wizard page image. *

*/ protected void doInit() { setDefaultPageImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(J2EEUIPluginIcons.WEB_EXPORT_WIZARD_BANNER)); } private WebModuleExportDataModel getSpecificModel() { return (WebModuleExportDataModel) getModel(); } }