Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui')
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebPreferences.java81
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java94
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.java157
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetInstallPage.java52
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/IProductConstants.java45
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/IWstWebUIContextIds.java11
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/NewProjectDataModelFacetWizard.java367
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleContextRootComposite.java117
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebFacetInstallPage.java55
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebModuleCreationWizard.java67
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebModuleWizardBasePage.java167
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectFirstPage.java17
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectWizard.java41
13 files changed, 0 insertions, 1271 deletions
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebPreferences.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebPreferences.java
deleted file mode 100644
index 84b5514b9..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebPreferences.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************************************
- * 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.wst.web.ui.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-
-public class WSTWebPreferences {
- public interface Keys {
- final static String STATIC_WEB_CONTENT = "org.eclipse.jst.j2ee.preference.staticWebContentName"; //$NON-NLS-1$
- }
- public interface Values {
- final static String STATIC_WEB_CONTENT = "WebContent"; //$NON-NLS-1$
- }
- public interface Defaults {
- final static String STATIC_WEB_CONTENT = Values.STATIC_WEB_CONTENT;
- }
- private Plugin owner = null;
- private Preferences preferences = null;
- private boolean persistOnChange = false;
-
- public WSTWebPreferences(Plugin owner) {
- this.owner = owner;
- }
- protected void initializeDefaultPreferences() {
- getPreferences().setDefault(Keys.STATIC_WEB_CONTENT, Defaults.STATIC_WEB_CONTENT);
- }
-
- public String getStaticWebContentFolderName() {
- return getPreferences().getString(Keys.STATIC_WEB_CONTENT);
- }
-
- public void setStaticWebContentFolderName(String value) {
- getPreferences().setValue(Keys.STATIC_WEB_CONTENT, value);
- firePreferenceChanged();
- }
-
- public void firePreferenceChanged() {
- if (isPersistOnChange())
- persist();
- }
-
- public void persist() {
- getOwner().savePluginPreferences();
- }
-
- /**
- * @return Returns the persistOnChange.
- */
- public boolean isPersistOnChange() {
- return this.persistOnChange;
- }
-
- /**
- * @param persistOnChange
- * The persistOnChange to set.
- */
- public void setPersistOnChange(boolean persistOnChange) {
- this.persistOnChange = persistOnChange;
- }
-
- private Preferences getPreferences() {
- if (this.preferences == null)
- this.preferences = getOwner().getPluginPreferences();
- return this.preferences;
- }
-
- /**
- * @return Returns the owner.
- */
- private Plugin getOwner() {
- return this.owner;
- }
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java
deleted file mode 100644
index c80119724..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************************************
- * 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.wst.web.ui.internal;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class WSTWebUIPlugin extends AbstractUIPlugin {
- // The shared instance.
- private static WSTWebUIPlugin plugin;
- public static final String[] ICON_DIRS = new String[]{"icons/full/obj16", //$NON-NLS-1$
- "icons/full/ctool16", //$NON-NLS-1$
- "icons/full/wizban", //$NON-NLS-1$
- "icons", //$NON-NLS-1$
- ""}; //$NON-NLS-1$
-
- /**
- * The constructor.
- */
- public WSTWebUIPlugin() {
- super();
- plugin = this;
- }
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * This gets a .gif from the icons folder.
- */
- public ImageDescriptor getImageDescriptor(String key) {
- ImageDescriptor imageDescriptor = null;
- URL gifImageURL = getImageURL(key, getBundle());
- if (gifImageURL != null)
- imageDescriptor = ImageDescriptor.createFromURL(gifImageURL);
- return imageDescriptor;
- }
- /**
- * This gets a .gif from the icons folder.
- */
- public static URL getImageURL(String key, Bundle bundle) {
- String gif = "/" + key + ".gif"; //$NON-NLS-1$ //$NON-NLS-2$
- IPath path = null;
- for (int i = 0; i < ICON_DIRS.length; i++) {
- path = new Path(ICON_DIRS[i]).append(gif);
- if (bundle.getEntry(path.toString()) == null)
- continue;
- try {
- return new URL(bundle.getEntry("/"), path.toString()); //$NON-NLS-1$
- } catch (MalformedURLException exception) {
- Logger.getLogger().logWarning("Load_Image_Error_"); //$NON-NLS-1$
- exception.printStackTrace();
- continue;
- }
- }
- return null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static WSTWebUIPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.java
deleted file mode 100644
index 15ecce43e..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.wst.web.ui.internal.wizards;
-
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationPropertiesNew;
-import org.eclipse.wst.common.frameworks.internal.ui.NewProjectGroup;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.server.ui.ServerUIUtil;
-import org.eclipse.wst.web.internal.ResourceHandler;
-
-public class DataModelFacetCreationWizardPage extends DataModelWizardPage implements IFacetProjectCreationDataModelProperties {
-
- private static final String LAST_RUNTIME_STORE = "LAST_RUNTIME"; //$NON-NLS-1$
-
- protected static GridData gdhfill() {
- return new GridData(GridData.FILL_HORIZONTAL);
- }
-
- protected Composite createTopLevelComposite(Composite parent) {
- Composite top = new Composite(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(top, getInfopopID());
- top.setLayout(new GridLayout());
- top.setLayoutData(new GridData(GridData.FILL_BOTH));
- createProjectGroup(top);
- Composite composite = new Composite(top, SWT.NONE);
- composite.setLayoutData(gdhfill());
- GridLayout layout = new GridLayout(3, false);
- composite.setLayout(layout);
- createServerTargetComposite(composite);
- return top;
- }
-
- public static boolean launchNewRuntimeWizard(Shell shell, IDataModel model) {
- DataModelPropertyDescriptor[] preAdditionDescriptors = model.getValidPropertyDescriptors(FACET_RUNTIME);
- boolean isOK = ServerUIUtil.showNewRuntimeWizard(shell, "", ""); //$NON-NLS-1$ //$NON-NLS-2$
- if (isOK && model != null) {
-
- DataModelPropertyDescriptor[] postAdditionDescriptors = model.getValidPropertyDescriptors(FACET_RUNTIME);
- Object[] preAddition = new Object[preAdditionDescriptors.length];
- for (int i = 0; i < preAddition.length; i++) {
- preAddition[i] = preAdditionDescriptors[i].getPropertyValue();
- }
- Object[] postAddition = new Object[postAdditionDescriptors.length];
- for (int i = 0; i < postAddition.length; i++) {
- postAddition[i] = postAdditionDescriptors[i].getPropertyValue();
- }
- Object newAddition = ProjectUtilities.getNewObject(preAddition, postAddition);
-
- model.notifyPropertyChange(FACET_RUNTIME, IDataModel.VALID_VALUES_CHG);
- if (newAddition != null)
- model.setProperty(FACET_RUNTIME, newAddition);
- else
- return false;
- }
- return isOK;
- }
-
- protected Combo serverTargetCombo;
- protected NewProjectGroup projectNameGroup;
-
- public DataModelFacetCreationWizardPage(IDataModel dataModel, String pageName) {
- super(dataModel, pageName);
- }
-
- protected void createServerTargetComposite(Composite parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(ResourceHandler.TargetRuntime);
- serverTargetCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- serverTargetCombo.setLayoutData(gdhfill());
- Button newServerTargetButton = new Button(parent, SWT.NONE);
- newServerTargetButton.setText(ResourceHandler.NewDotDotDot);
- newServerTargetButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (!launchNewRuntimeWizard(getShell(), model)) {
- setErrorMessage(ResourceHandler.InvalidServerTarget);
- }
- }
- });
- Control[] deps = new Control[]{label, newServerTargetButton};
- synchHelper.synchCombo(serverTargetCombo, FACET_RUNTIME, deps);
- if (serverTargetCombo.getSelectionIndex() == -1 && serverTargetCombo.getVisibleItemCount() != 0)
- serverTargetCombo.select(0);
- }
-
- protected void createProjectGroup(Composite parent) {
- IDataModel nestedProjectDM = model.getNestedModel(NESTED_PROJECT_DM);
- nestedProjectDM.addListener(this);
- projectNameGroup = new NewProjectGroup(parent, nestedProjectDM);
- }
-
- protected String[] getValidationPropertyNames() {
- return new String[]{IProjectCreationPropertiesNew.PROJECT_NAME, IProjectCreationPropertiesNew.PROJECT_LOCATION, FACET_RUNTIME};
- }
-
- public void dispose() {
- super.dispose();
- if (projectNameGroup != null)
- projectNameGroup.dispose();
- }
-
- public void storeDefaultSettings() {
- IDialogSettings settings = getDialogSettings();
- if (settings != null) {
- IRuntime runtime = (IRuntime) model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME);
- String runtimeName = runtime == null ? "" : runtime.getName(); //$NON-NLS-1$
- settings.put(LAST_RUNTIME_STORE, runtimeName);
- }
- }
-
- public void restoreDefaultSettings() {
- IDialogSettings settings = getDialogSettings();
- if (settings != null) {
- if (!model.isPropertySet(IFacetProjectCreationDataModelProperties.FACET_RUNTIME)) {
- boolean runtimeSet = false;
- String lastRuntimeName = settings.get(LAST_RUNTIME_STORE);
- DataModelPropertyDescriptor[] descriptors = model.getValidPropertyDescriptors(IFacetProjectCreationDataModelProperties.FACET_RUNTIME);
- if (lastRuntimeName != null) {
- for (int i = 0; i < descriptors.length && !runtimeSet; i++) {
- if (lastRuntimeName.equals(descriptors[i].getPropertyDescription())) {
- model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, descriptors[i].getPropertyValue());
- runtimeSet = true;
- }
- }
- }
- if (!runtimeSet && descriptors.length > 0) {
- model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, descriptors[0].getPropertyValue());
- }
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetInstallPage.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetInstallPage.java
deleted file mode 100644
index da031f5cc..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetInstallPage.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.wst.web.ui.internal.wizards;
-
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetInstallDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
-import org.eclipse.wst.common.project.facet.ui.IWizardContext;
-
-public abstract class DataModelFacetInstallPage extends DataModelWizardPage implements IFacetWizardPage, IFacetInstallDataModelProperties {
-
- public DataModelFacetInstallPage(String pageName) {
- // TODO figure out a better way to do this without compromising the IDataModelWizard
- // framework.
- super(DataModelFactory.createDataModel(new AbstractDataModelProvider() {
- }), pageName);
- }
-
- protected static GridData gdhfill() {
- return new GridData(GridData.FILL_HORIZONTAL);
- }
-
- public void setWizardContext(IWizardContext context) {
- // Intentionally empty
- }
-
- public void transferStateToConfig() {
- // Intentionally empty
- }
-
- public void setConfig(final Object config) {
- model.removeListener(this);
- synchHelper.dispose();
-
- model = (IDataModel) config;
- model.addListener(this);
- synchHelper = initializeSynchHelper(model);
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/IProductConstants.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/IProductConstants.java
deleted file mode 100644
index 014853dd9..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/IProductConstants.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2005 BEA Systems, Inc.
- * 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:
- * Konstantin Komissarchik - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.web.ui.internal.wizards;
-
-/**
- * These constants define the set of properties that this pluging expects to
- * be available via <code>IProduct.getProperty(String)</code>. The status of
- * this interface and the facilities offered is highly provisional.
- * Productization support will be reviewed and possibly modified in future
- * releases.
- *
- * @see org.eclipse.core.runtime.IProduct#getProperty(String)
- */
-
-public interface IProductConstants
-{
- /**
- * <p>Alters the final perspective used by the following new project
- * wizards:</p>
- *
- * <ul>
- * <li>EJB -> EJB Project</li>
- * <li>J2EE -> Application Client Project</li>
- * <li>J2EE -> Connector Project</li>
- * <li>J2EE -> Enterprise Application Project</li>
- * <li>J2EE -> Utility Project</li>
- * <li>Web -> Dynamic Web Project</li>
- * <li>Web -> Static Web Project</li>
- * </ul>
- *
- * The default value is: org.eclipse.jst.j2ee.J2EEPerspective.
- */
-
- public static final String FINAL_PERSPECTIVE
- = "j2eeNewProjectFinalPerspective"; //$NON-NLS-1$
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/IWstWebUIContextIds.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/IWstWebUIContextIds.java
deleted file mode 100644
index bb98c49c2..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/IWstWebUIContextIds.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.eclipse.wst.web.ui.internal.wizards;
-
-public interface IWstWebUIContextIds {
-
- public static final String PLUGIN_WST_WEB_UI = "org.eclipse.wst.web.ui."; //$NON-NLS-1$
-
- public static final String NEW_STATIC_WEB_PROJECT_PAGE1 = PLUGIN_WST_WEB_UI + "webw2000"; //$NON-NLS-1$
- public static final String NEW_STATIC_WEB_PROJECT_PAGE2 = PLUGIN_WST_WEB_UI + "webw2100"; //$NON-NLS-1$
- public static final String NEW_STATIC_WEB_PROJECT_PAGE3 = PLUGIN_WST_WEB_UI + "webw2200"; //$NON-NLS-1$
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/NewProjectDataModelFacetWizard.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/NewProjectDataModelFacetWizard.java
deleted file mode 100644
index f36d15ebc..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/NewProjectDataModelFacetWizard.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.wst.web.ui.internal.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProduct;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
-import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.componentcore.internal.operation.FacetProjectCreationOperation;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action.Type;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.ui.AddRemoveFacetsWizard;
-import org.eclipse.wst.common.project.facet.ui.internal.ConflictingFacetsFilter;
-import org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPanel;
-import org.eclipse.wst.web.internal.DelegateConfigurationElement;
-import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
-
-public abstract class NewProjectDataModelFacetWizard extends AddRemoveFacetsWizard implements INewWizard, IFacetProjectCreationDataModelProperties {
-
- protected IDataModel model = null;
- private final IFacetedProjectTemplate template;
- private IWizardPage firstPage;
- private IConfigurationElement configurationElement;
-
- public NewProjectDataModelFacetWizard(IDataModel model) {
- super(null);
- this.model = model;
- template = getTemplate();
- this.setDefaultPageImageDescriptor(getDefaultPageImageDescriptor());
- }
-
- public NewProjectDataModelFacetWizard() {
- super(null);
- model = createDataModel();
- template = getTemplate();
- this.setDefaultPageImageDescriptor(getDefaultPageImageDescriptor());
- }
-
- public IDataModel getDataModel() {
- return model;
- }
-
- protected abstract IDataModel createDataModel();
-
- protected abstract ImageDescriptor getDefaultPageImageDescriptor();
-
- protected abstract IFacetedProjectTemplate getTemplate();
-
- protected abstract IWizardPage createFirstPage();
-
- public void addPages() {
- firstPage = createFirstPage();
- addPage(firstPage);
-
- super.addPages();
- final Set fixed = this.template.getFixedProjectFacets();
-
- this.facetsSelectionPage.setFixedProjectFacets(fixed);
-
- this.facetsSelectionPage.addSelectedFacetsChangedListener(new Listener() {
- public void handleEvent(Event event) {
- facetSelectionChangedEvent(event);
- }
- });
-
- // Disabling this as it interfers with the facet selection based on the
- // runtime.
-
- /*
- * Set facetVersions = new HashSet(); FacetDataModelMap map = (FacetDataModelMap)
- * model.getProperty(FACET_DM_MAP); for (Iterator iterator = map.values().iterator();
- * iterator.hasNext();) { IDataModel model = (IDataModel) iterator.next();
- * facetVersions.add(model.getProperty(IFacetDataModelProperties.FACET_VERSION)); }
- * this.facetsSelectionPage.setInitialSelection(facetVersions);
- */
-
-
- final ConflictingFacetsFilter filter = new ConflictingFacetsFilter(fixed);
-
- this.facetsSelectionPage.setFilters(new FacetsSelectionPanel.IFilter[]{filter});
-
- IRuntime runtime = (IRuntime) model.getProperty(FACET_RUNTIME);
- if (runtime != null)
- setRuntime(runtime);
- synchRuntimes();
- }
-
- public IWizardPage[] getPages() {
- final IWizardPage[] base = super.getPages();
- final IWizardPage[] pages = new IWizardPage[base.length + 1];
-
- pages[0] = this.firstPage;
- System.arraycopy(base, 0, pages, 1, base.length);
-
- return pages;
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- }
-
- protected void synchRuntimes() {
- model.addListener(new IDataModelListener() {
- public void propertyChanged(DataModelEvent event) {
- if (IDataModel.VALUE_CHG == event.getFlag() || IDataModel.DEFAULT_CHG == event.getFlag()) {
- if (FACET_RUNTIME.equals(event.getPropertyName())) {
- IRuntime runtime = (IRuntime) event.getProperty();
- if (runtime != getRuntime()) {
- setRuntime(runtime);
- }
- }
- }
- }
- });
-
- addRuntimeListener(new Listener() {
- public void handleEvent(final Event event) {
- model.setProperty(FACET_RUNTIME, getRuntime());
- }
- });
- }
-
- public String getProjectName() {
- return model.getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME);
- }
-
- protected void performFinish(final IProgressMonitor monitor)
-
- throws CoreException
-
- {
- monitor.beginTask("", 10);
- storeDefaultSettings();
- try {
- FacetProjectCreationOperation operation = new FacetProjectCreationOperation(model);
- this.fproj = operation.createProject(new SubProgressMonitor(monitor, 2));
-
- super.performFinish(new SubProgressMonitor(monitor, 8));
-
- final Set fixed = this.template.getFixedProjectFacets();
- this.fproj.setFixedProjectFacets(fixed);
-
- try {
- postPerformFinish();
- } catch (InvocationTargetException e) {
- Logger.getLogger().logError(e);
- }
- } finally {
- monitor.done();
- }
- }
-
- /**
- * <p>
- * Override to return the final perspective ID (if any). The final perspective ID can be
- * hardcoded by the subclass or determined programmatically (possibly using the value of a field
- * on the Wizard's WTP Operation Data Model).
- * </p>
- * <p>
- * The default implementation returns the J2EE perspective id unless
- * overriden by product definition via the "wtp.project.final.perspective"
- * property.
- * </p>
- *
- * @return Returns the ID of the Perspective which is preferred by this wizard upon completion.
- */
-
- protected String getFinalPerspectiveID()
- {
- final IProduct product = Platform.getProduct();
- String perspective = null;
- if (product != null)
- perspective = product.getProperty( IProductConstants.FINAL_PERSPECTIVE );
- if(perspective == null)
- perspective = "org.eclipse.jst.j2ee.J2EEPerspective"; //$NON-NLS-1$
- return perspective;
- }
-
- /**
- * {@inheritDoc}
- *
- * <p>
- * The configuration element is saved to use when the wizard completes in order to change the
- * current perspective using either (1) the value specified by {@link #getFinalPerspectiveID()}
- * or (2) the value specified by the finalPerspective attribute in the Wizard's configuration
- * element.
- * </p>
- *
- * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
- * java.lang.String, java.lang.Object)
- */
- public final void setInitializationData(IConfigurationElement aConfigurationElement, String aPropertyName, Object theData) throws CoreException {
- configurationElement = aConfigurationElement;
- doSetInitializeData(aConfigurationElement, aPropertyName, theData);
-
- }
-
- /**
- * <p>
- * Override method for clients that wish to take advantage of the information provided by
- * {@see #setInitializationData(IConfigurationElement, String, Object)}.
- * </p>
- *
- * @param aConfigurationElement
- * The configuration element provided from the templated method.
- * @param aPropertyName
- * The property name provided from the templated method.
- * @param theData
- * The data provided from the templated method.
- */
- protected void doSetInitializeData(IConfigurationElement aConfigurationElement, String aPropertyName, Object theData) {
- // Default do nothing
- }
-
- /**
- * <p>
- * Returns the an id component used for Activity filtering.
- * </p>
- *
- * <p>
- * The Plugin ID is determined from the configuration element specified in
- * {@see #setInitializationData(IConfigurationElement, String, Object)}.
- * </p>
- *
- * @return Returns the plugin id associated with this wizard
- */
- public final String getPluginId() {
- return (configurationElement != null) ? configurationElement.getDeclaringExtension().getNamespace() : ""; //$NON-NLS-1$
- }
-
- /**
- *
- * <p>
- * Invoked after the user has clicked the "Finish" button of the wizard. The default
- * implementation will attempt to update the final perspective to the value specified by
- * {@link #getFinalPerspectiveID() }
- * </p>
- *
- * @throws InvocationTargetException
- *
- * @see org.eclipse.wst.common.frameworks.internal.ui.wizard.WTPWizard#postPerformFinish()
- */
- protected void postPerformFinish() throws InvocationTargetException {
-
- if (getFinalPerspectiveID() != null && getFinalPerspectiveID().length() > 0) {
-
- IConfigurationElement element = new DelegateConfigurationElement(configurationElement) {
- public String getAttribute(String aName) {
- if (aName.equals("finalPerspective")) { //$NON-NLS-1$
- return getFinalPerspectiveID();
- }
- return super.getAttribute(aName);
- }
- };
- BasicNewProjectResourceWizard.updatePerspective(element);
- } else
- BasicNewProjectResourceWizard.updatePerspective(configurationElement);
- String projName = getProjectName();
- BasicNewResourceWizard.selectAndReveal(ProjectUtilities.getProject(projName), WSTWebUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
- }
-
- /**
- * Need to keep the model in sync with the UI. This method will pickup changes coming from the
- * UI and push them into the model
- *
- * @param event
- */
- protected void facetSelectionChangedEvent(Event event) {
- Set actions = this.facetsSelectionPage.getActions();
- Iterator iterator = actions.iterator();
- Set activeIds = new HashSet();
- while (iterator.hasNext()) {
- IFacetedProject.Action action = (IFacetedProject.Action) iterator.next();
- String id = action.getProjectFacetVersion().getProjectFacet().getId();
- activeIds.add(id);
- }
- // First handle all the actions tracked by IDataModels
- FacetDataModelMap dataModelMap = (FacetDataModelMap) model.getProperty(FACET_DM_MAP);
- iterator = dataModelMap.keySet().iterator();
- while (iterator.hasNext()) {
- String id = (String) iterator.next();
- IDataModel configDM = (IDataModel) dataModelMap.get(id);
- boolean active = activeIds.contains(id);
- configDM.setBooleanProperty(IFacetDataModelProperties.SHOULD_EXECUTE, active);
- activeIds.remove(id);
- }
- // Now handle the actions not tracked by IDataModels
- FacetActionMap actionMap = (FacetActionMap) model.getProperty(FACET_ACTION_MAP);
- actionMap.clear();
- iterator = actions.iterator();
- while (iterator.hasNext()) {
- IFacetedProject.Action action = (IFacetedProject.Action) iterator.next();
- String id = action.getProjectFacetVersion().getProjectFacet().getId();
- if (activeIds.contains(id)) {
- actionMap.add(action);
- }
- }
- model.notifyPropertyChange(FACET_RUNTIME, IDataModel.VALID_VALUES_CHG);
- }
-
- public Object getConfig(IProjectFacetVersion fv, Type type, String pjname) throws CoreException {
- FacetDataModelMap map = (FacetDataModelMap) model.getProperty(FACET_DM_MAP);
- IDataModel configDM = (IDataModel) map.get(fv.getProjectFacet().getId());
- if (configDM == null) {
- final Object config = fv.createActionConfig(type, pjname);
- if (config == null || !(config instanceof IDataModel))
- return null;
- configDM = (IDataModel) config;
- map.add(configDM);
- }
- configDM.setProperty(IFacetDataModelProperties.FACET_VERSION, fv);
- return configDM;
- }
-
- protected void storeDefaultSettings() {
- IWizardPage[] pages = getPages();
- for (int i = 0; i < pages.length; i++)
- storeDefaultSettings(pages[i], i);
- }
-
- /**
- * Subclasses may override if they need to do something special when storing the default
- * settings for a particular page.
- *
- * @param page
- * @param pageIndex
- */
- protected void storeDefaultSettings(IWizardPage page, int pageIndex) {
- if (page instanceof DataModelWizardPage)
- ((DataModelWizardPage) page).storeDefaultSettings();
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleContextRootComposite.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleContextRootComposite.java
deleted file mode 100644
index 73d857e7a..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleContextRootComposite.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/***************************************************************************************************
- * 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.wst.web.ui.internal.wizards;
-
-import java.util.Vector;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.web.internal.ResourceHandler;
-import org.eclipse.wst.web.internal.WebPropertiesUtil;
-
-public class SimpleContextRootComposite extends Composite {
- protected Text contextRootField;
- private String errorMessage = null;
-
- // listeners interested in the event when the context root
- // value is modified.
- private java.util.List modifyListeners;
-
- protected Listener contextRootModifyListener = new Listener() {
- public void handleEvent(Event e) {
- if (contextRootField != null)
- contextRootModified();
- }
- };
-
- public SimpleContextRootComposite(Composite parent) {
- super(parent, SWT.NONE);
- createControls();
- modifyListeners = new Vector(1);
- }
-
- protected void createControls() {
- // container specification group
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- data.horizontalSpan = 2;
- setLayoutData(data);
-
- // New Context Root Label
- Label contextRootLabel = new Label(this, SWT.CHECK);
- contextRootLabel.setText(ResourceHandler.StaticContextRootComposite_Context_Root_Label);
-
- // New Context Root Entryfield
- contextRootField = new Text(this, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- data.grabExcessHorizontalSpace = true;
- contextRootField.setLayoutData(data);
-
- contextRootField.addListener(SWT.Modify, contextRootModifyListener);
-
- }
-
- public String getContextRoot() {
- return contextRootField.getText();
- }
-
- public void setEnabled(boolean enabled) {
- if (contextRootField != null)
- contextRootField.setEnabled(enabled);
- }
-
- protected void contextRootModified() {
- errorMessage = WebPropertiesUtil.validateContextRoot(getContextRoot());
- // notify listeners
- Event e = new Event();
- e.type = SWT.Modify;
- e.widget = contextRootField;
- for (int i = 0; i < modifyListeners.size(); i++) {
- ((Listener) modifyListeners.get(i)).handleEvent(e);
- }
- }
-
- public void setContextRoot(String cr) {
- contextRootField.setText(cr);
- }
-
- /**
- * There is a default context root validation listener provided by the
- * composite, adding external listeners will replace the default listener.
- */
- public void addModifyListener(Listener l) {
- modifyListeners.add(l);
- }
-
- public void removeModifyListener(Listener l) {
- modifyListeners.remove(l);
- }
-
- /**
- * validate the context root value and return the error message
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public boolean setFocus() {
- return contextRootField.setFocus();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebFacetInstallPage.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebFacetInstallPage.java
deleted file mode 100644
index 6d9f28cad..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebFacetInstallPage.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.wst.web.ui.internal.wizards;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.project.facet.ISimpleWebFacetInstallDataModelProperties;
-import org.eclipse.wst.web.internal.ResourceHandler;
-
-public class SimpleWebFacetInstallPage extends DataModelFacetInstallPage implements ISimpleWebFacetInstallDataModelProperties {
-
- private Label configFolderLabel;
- private Text configFolder;
- private Label contextRootLabel;
- private Text contextRoot;
-
- public SimpleWebFacetInstallPage() {
- super("simpleweb.facet.install.page"); //$NON-NLS-1$
- setTitle(ResourceHandler.StaticWebProjectWizardBasePage_Page_Title);
- setDescription(ResourceHandler.ConfigureSettings);
- }
-
- protected String[] getValidationPropertyNames() {
- return new String[]{CONTENT_DIR};
- }
-
- protected Composite createTopLevelComposite(Composite parent) {
- setInfopopID(IWstWebUIContextIds.NEW_STATIC_WEB_PROJECT_PAGE3);
- final Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(1, false));
-
- this.contextRootLabel = new Label(composite, SWT.NONE);
- this.contextRootLabel.setText(ResourceHandler.StaticContextRootComposite_Context_Root_Label);
- this.contextRootLabel.setLayoutData(gdhfill());
-
- this.contextRoot = new Text(composite, SWT.BORDER);
- this.contextRoot.setLayoutData(gdhfill());
- this.contextRoot.setData("label", this.contextRootLabel); //$NON-NLS-1$
- synchHelper.synchText(contextRoot, CONTEXT_ROOT, new Control[]{contextRootLabel});
-
- configFolderLabel = new Label(composite, SWT.NONE);
- configFolderLabel.setText(ResourceHandler.StaticWebSettingsPropertiesPage_Web_Content_Label);
- configFolderLabel.setLayoutData(gdhfill());
-
- configFolder = new Text(composite, SWT.BORDER);
- configFolder.setLayoutData(gdhfill());
- configFolder.setData("label", configFolderLabel); //$NON-NLS-1$
- synchHelper.synchText(configFolder, CONTENT_DIR, null);
-
- return composite;
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebModuleCreationWizard.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebModuleCreationWizard.java
deleted file mode 100644
index fd27c5a38..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebModuleCreationWizard.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/***************************************************************************************************
- * 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.wst.web.ui.internal.wizards;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard;
-import org.eclipse.wst.web.internal.ResourceHandler;
-import org.eclipse.wst.web.internal.operation.SimpleWebModuleCreationDataModelProvider;
-import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
-
-public class SimpleWebModuleCreationWizard extends DataModelWizard implements IExecutableExtension, INewWizard {
-
- public SimpleWebModuleCreationWizard(IDataModel model) {
- super(model);
- }
-
- public SimpleWebModuleCreationWizard() {
- super();
- }
-
- protected IDataModelProvider getDefaultProvider() {
- return new SimpleWebModuleCreationDataModelProvider();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.Wizard#addPages()
- */
- public void doAddPages() {
- addPage(new SimpleWebModuleWizardBasePage(getDataModel(), "page1")); //$NON-NLS-1$
- }
-
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- setWindowTitle(ResourceHandler.StaticWebProjectCreationWizard_Wizard_Title);
- setDefaultPageImageDescriptor(WSTWebUIPlugin.getDefault().getImageDescriptor("newwprj_wiz")); //$NON-NLS-1$
- }
-
-// protected void postPerformFinish() throws InvocationTargetException {
-// IWizardRegistry newWizardRegistry = WorkbenchPlugin.getDefault().getNewWizardRegistry();
-//
-// IWizardDescriptor descriptor = newWizardRegistry.findWizard(getWizardID());
-//
-// if(descriptor instanceof WorkbenchWizardElement)
-// BasicNewProjectResourceWizard.updatePerspective(((WorkbenchWizardElement)descriptor).getConfigurationElement());
-// IWorkbenchWindow window = WSTWebPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
-// IProject project = ((SimpleWebModuleCreationDataModel) model).getTargetProject();
-// BasicNewResourceWizard.selectAndReveal(project, window);
-// }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebModuleWizardBasePage.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebModuleWizardBasePage.java
deleted file mode 100644
index 9b3e9724d..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebModuleWizardBasePage.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/***************************************************************************************************
- * 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.wst.web.ui.internal.wizards;
-
-import java.io.File;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPCommonUIResourceHandler;
-import org.eclipse.wst.web.internal.ResourceHandler;
-import org.eclipse.wst.web.internal.WSTWebPlugin;
-import org.eclipse.wst.web.internal.operation.ISimpleWebModuleCreationDataModelProperties;
-
-class SimpleWebModuleWizardBasePage extends DataModelWizardPage implements ISimpleWebModuleCreationDataModelProperties{
- public Text projectNameField = null;
- protected Text locationPathField = null;
- protected Button browseButton = null;
- // constants
- private static final int SIZING_TEXT_FIELD_WIDTH = 305;
- // default values
- private String defProjectNameLabel = WTPCommonUIResourceHandler.Name_; //$NON-NLS-1$
- private String defBrowseButtonLabel = WTPCommonUIResourceHandler.Browse_;//$NON-NLS-1$
- private static final String defDirDialogLabel = "Directory"; //$NON-NLS-1$
-
- public SimpleWebModuleWizardBasePage(IDataModel dataModel, String pageName) {
- super(dataModel, pageName);
- setDescription(ResourceHandler.StaticWebProjectWizardBasePage_Page_Description);
- setTitle(ResourceHandler.StaticWebProjectWizardBasePage_Page_Title);
- ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(WSTWebPlugin.PLUGIN_ID, "icons/full/wizban/newwprj_wiz.gif"); //$NON-NLS-1$
- setImageDescriptor(desc);
- setPageComplete(false);
- }
-
- protected void setSize(Composite composite) {
- if (composite != null) {
- Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- composite.setSize(minSize);
- // set scrollbar composite's min size so page is expandable but has
- // scrollbars when needed
- if (composite.getParent() instanceof ScrolledComposite) {
- ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
- sc1.setMinSize(minSize);
- sc1.setExpandHorizontal(true);
- sc1.setExpandVertical(true);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.ui.wizard.WTPWizardPage#getValidationPropertyNames()
- */
- protected String[] getValidationPropertyNames() {
- return new String[]{PROJECT_NAME};
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.ui.wizard.WTPWizardPage#createTopLevelComposite(org.eclipse.swt.widgets.Composite)
- */
- protected Composite createTopLevelComposite(Composite parent) {
- Composite top = new Composite(parent, SWT.NONE);
- top.setLayout(new GridLayout());
- top.setData(new GridData(GridData.FILL_BOTH));
- Composite composite = new Composite(top, SWT.NONE);
- GridLayout layout = new GridLayout(3, false);
- composite.setLayout(layout);
- buildComposites(composite);
- Composite detail = new Composite(top, SWT.NONE);
- detail.setLayout(new GridLayout());
- detail.setData(new GridData(GridData.FILL_BOTH));
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(top, "com.ibm.etools.webtools.wizards.basic.webw1450"); //$NON-NLS-1$
- return top;
- }
-
- /**
- * Create the controls within this composite
- */
- public void buildComposites(Composite parent) {
- createProjectNameGroup(parent);
- createProjectLocationGroup(parent);
- projectNameField.setFocus();
- }
-
- private void createProjectLocationGroup(Composite parent) {
- // set up location path label
- Label locationPathLabel = new Label(parent, SWT.NONE);
- locationPathLabel.setText(WTPCommonUIResourceHandler.Project_location_);//$NON-NLS-1$
- GridData data = new GridData();
- locationPathLabel.setLayoutData(data);
- // set up location path entry field
- locationPathField = new Text(parent, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = SIZING_TEXT_FIELD_WIDTH;
- locationPathField.setLayoutData(data);
- // set up browse button
- browseButton = new Button(parent, SWT.PUSH);
- browseButton.setText(defBrowseButtonLabel);
- browseButton.setLayoutData((new GridData(GridData.FILL_HORIZONTAL)));
- browseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleLocationBrowseButtonPressed();
- }
- });
- browseButton.setEnabled(true);
- synchHelper.synchText(locationPathField, LOCATION, null);
- }
-
- /**
- * Open an appropriate directory browser
- */
- protected void handleLocationBrowseButtonPressed() {
- DirectoryDialog dialog = new DirectoryDialog(locationPathField.getShell());
- dialog.setMessage(defDirDialogLabel);
- String dirName = model.getStringProperty(LOCATION);
- if ((dirName != null) && (dirName.length() != 0)) {
- File path = new File(dirName);
- if (path.exists()) {
- dialog.setFilterPath(dirName);
- }
- }
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null) {
- model.setProperty(LOCATION, selectedDirectory);
- }
- }
-
- private void createProjectNameGroup(Composite parent) {
- // set up project name label
- Label projectNameLabel = new Label(parent, SWT.NONE);
- projectNameLabel.setText(defProjectNameLabel);
- GridData data = new GridData();
- projectNameLabel.setLayoutData(data);
- // set up project name entry field
- projectNameField = new Text(parent, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = SIZING_TEXT_FIELD_WIDTH;
- projectNameField.setLayoutData(data);
- new Label(parent, SWT.NONE); // pad
- synchHelper.synchText(projectNameField, PROJECT_NAME, new Control[]{projectNameLabel});
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectFirstPage.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectFirstPage.java
deleted file mode 100644
index fc4306260..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectFirstPage.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.wst.web.ui.internal.wizards;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.web.internal.ResourceHandler;
-import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
-
-public class SimpleWebProjectFirstPage extends DataModelFacetCreationWizardPage {
-
- public SimpleWebProjectFirstPage(IDataModel dataModel, String pageName) {
- super(dataModel, pageName);
- setDescription(ResourceHandler.StaticWebProjectWizardBasePage_Page_Description);
- setTitle(ResourceHandler.StaticWebProjectWizardBasePage_Page_Title);
- setImageDescriptor(WSTWebUIPlugin.getDefault().getImageDescriptor("newwprj_wiz")); //$NON-NLS-1$
- setInfopopID(IWstWebUIContextIds.NEW_STATIC_WEB_PROJECT_PAGE1);
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectWizard.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectWizard.java
deleted file mode 100644
index 3184a389e..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectWizard.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.eclipse.wst.web.ui.internal.wizards;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.project.facet.SimpleWebFacetProjectCreationDataModelProvider;
-import org.eclipse.wst.web.internal.ResourceHandler;
-import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
-
-public class SimpleWebProjectWizard extends NewProjectDataModelFacetWizard {
-
- public SimpleWebProjectWizard(IDataModel model) {
- super(model);
- setWindowTitle(ResourceHandler.StaticWebProjectCreationWizard_Wizard_Title);
- }
-
- public SimpleWebProjectWizard() {
- super();
- setWindowTitle(ResourceHandler.StaticWebProjectCreationWizard_Wizard_Title);
- }
-
- protected IDataModel createDataModel() {
- return DataModelFactory.createDataModel(new SimpleWebFacetProjectCreationDataModelProvider());
- }
-
- protected ImageDescriptor getDefaultPageImageDescriptor() {
- return WSTWebUIPlugin.getDefault().getImageDescriptor("newwprj_wiz"); //$NON-NLS-1$
- }
-
- protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("template.wst.web"); //$NON-NLS-1$
- }
-
- protected IWizardPage createFirstPage() {
- return new SimpleWebProjectFirstPage(model, "first.page"); //$NON-NLS-1$
- }
-
-}

Back to the top