Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst')
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/Logger.java107
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.java123
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.properties11
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebPreferences.java83
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java138
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WebDevelopmentPerspective.java92
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/AbstractOpenWizardAction.java68
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenCSSWizardAction.java25
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenHTMLWizardAction.java25
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenJSWizardAction.java24
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.java698
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.properties1
-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/IWstWebUIContextIds.java21
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/NewProjectDataModelFacetWizard.java505
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebFacetInstallPage.java69
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectFirstPage.java41
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectWizard.java62
-rw-r--r--plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/facetcreationpagemessages.properties1
19 files changed, 0 insertions, 2146 deletions
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/Logger.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/Logger.java
deleted file mode 100644
index e3357cc33..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/Logger.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.web.ui.internal;
-
-
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.web.ui"; //$NON-NLS-1$
- /**
- * true if both platform and this plugin are in debug mode
- */
- public static final boolean DEBUG = Platform.inDebugMode() && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.web.ui/debug")); //$NON-NLS-1$ //$NON-NLS-2$
-
- /*
- * Keep our own copy in case we want to add other severity levels
- */
- public static final int OK = IStatus.OK;
- public static final int INFO = IStatus.INFO;
- public static final int WARNING = IStatus.WARNING;
- public static final int ERROR = IStatus.ERROR;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- private static void _log(int level, String message, Throwable exception) {
- Status statusObj = new Status(level, PLUGIN_ID, level, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Write a message to the log with the given severity level
- *
- * @param level
- * ERROR, WARNING, INFO, OK
- * @param message
- * message to add to the log
- */
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- /**
- * Writes a message and exception to the log with the given severity level
- *
- * @param level
- * ERROR, WARNING, INFO, OK
- * @param message
- * message to add to the log
- * @param exception
- * exception to add to the log
- */
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- /**
- * Writes the exception as an error in the log along with an accompanying
- * message
- *
- * @param message
- * message to add to the log
- * @param exception
- * exception to add to the log
- */
- public static void logException(String message, Throwable exception) {
- _log(IStatus.ERROR, message, exception);
- }
-
- /**
- * Writes the exception as an error in the log
- *
- * @param exception
- * exception to add to the log
- */
- public static void logException(Throwable exception) {
- _log(IStatus.ERROR, exception.getMessage(), exception);
- }
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.java
deleted file mode 100644
index 7a5926057..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.java
+++ /dev/null
@@ -1,123 +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;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMarkerResolution;
-import org.eclipse.ui.IMarkerResolutionGenerator;
-import org.eclipse.ui.views.markers.WorkbenchMarkerResolution;
-import org.eclipse.wst.common.componentcore.internal.ModuleMigratorManager;
-import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
-
-/**
- * This has been deprecated since WTP 3.1.2 and will be deleted post WTP 3.2.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=292934
- * @deprecated
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-public final class ModuleCoreValidatorMarkerResolutions
-
- implements IMarkerResolutionGenerator
-
-{
- public IMarkerResolution[] getResolutions( IMarker marker )
- {
- return new IMarkerResolution[]
- {
- new ModuleCoreMigrationResolution( marker )
- };
- }
-
- private class ModuleCoreMigrationResolution extends WorkbenchMarkerResolution
-
- {
- private final IMarker theMarker;
- private final String MARKERTYPE = "org.eclipse.wst.common.modulecore.ModuleCoreValidatorMarker"; //$NON-NLS-1$
-
- public ModuleCoreMigrationResolution( IMarker marker )
- {
- this.theMarker = marker;
- }
-
- public String getLabel()
- {
- return Resources.migrateMetaData;
- }
-
-
-
- public void run( IMarker marker )
- {
-
- IProject proj = marker.getResource().getProject();
-
- try
- {
- ModuleMigratorManager manager = ModuleMigratorManager.getManager(proj);
- if (!manager.isMigrating() && !ResourcesPlugin.getWorkspace().isTreeLocked())
- manager.migrateOldMetaData(proj,true);
- }
- catch( Exception e )
- {
- WSTWebUIPlugin.logError(e);
- }
- }
-
- public String getDescription() {
- return Resources.migrateMetaData;
- }
-
- public Image getImage() {
- return null;
- }
-
- @Override
- public IMarker[] findOtherMarkers(IMarker[] markers) {
- List marks = new ArrayList();
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- try {
- if (marker.getType().equals(MARKERTYPE) && !(marker.equals(theMarker)))
- marks.add(marker);
- } catch (CoreException e) {
- WSTWebUIPlugin.logError(e);
- }
- }
- return (IMarker[])marks.toArray(new IMarker[marks.size()]);
- }
-
- }
-
- private static final class Resources
-
- extends NLS
-
- {
- public static String migrateMetaData;
-
- static
- {
- initializeMessages( ModuleCoreValidatorMarkerResolutions.class.getName(),
- Resources.class );
- }
- }
-
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.properties b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.properties
deleted file mode 100644
index 4491dfe0b..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/ModuleCoreValidatorMarkerResolutions.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 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
-###############################################################################
-migrateMetaData=Migrate metadata
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 931f9ef08..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebPreferences.java
+++ /dev/null
@@ -1,83 +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;
-
-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 5e37665c6..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * 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.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.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import java.lang.Throwable;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class WSTWebUIPlugin extends AbstractUIPlugin {
-
- public static final String PLUGIN_ID = "org.eclipse.wst.web.ui"; //$NON-NLS-1$
-
- // 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
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- 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 imageURL = getImageURL(key, getBundle());
- if (imageURL==null)
- imageURL = getPNGImageURL(key, getBundle());
- if (imageURL != null)
- imageDescriptor = ImageDescriptor.createFromURL(imageURL);
- 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.log(Logger.WARNING, "Load_Image_Error_", exception); //$NON-NLS-1$
- continue;
- }
- }
- return null;
- }
-
- /**
- * This gets a .png from the icons folder.
- */
- public static URL getPNGImageURL(String key, Bundle bundle) {
- String gif = "/" + key + ".png"; //$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.log(Logger.WARNING, "Load_Image_Error_", exception); //$NON-NLS-1$
- continue;
- }
- }
- return null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static WSTWebUIPlugin getDefault() {
- return plugin;
- }
- public static IStatus createStatus(int severity, String message, Throwable exception) {
- return new Status(severity, PLUGIN_ID, message, exception);
- }
- public static IStatus createStatus(int severity, String message) {
- return createStatus(severity, message, null);
- }
- public static void logError(Throwable exception) {
- Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( createStatus(IStatus.ERROR, exception.getMessage(), exception));
- }
- public static void logError(CoreException exception) {
- Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( exception.getStatus() );
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WebDevelopmentPerspective.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WebDevelopmentPerspective.java
deleted file mode 100644
index 2445ff188..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WebDevelopmentPerspective.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.search.ui.NewSearchUI;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.progress.IProgressConstants;
-import org.eclipse.wst.project.facet.IProductConstants;
-import org.eclipse.wst.project.facet.ProductManager;
-
-public class WebDevelopmentPerspective implements IPerspectiveFactory {
-
- public static final String ID = "org.eclipse.wst.web.ui.webDevPerspective"; //$NON-NLS-1$
-
- protected static final String TOP_LEFT_LOCATION = "topLeft"; //$NON-NLS-1$
- protected static final String BOTTOM_LEFT_LOCATION = "bottomLeft"; //$NON-NLS-1$
- protected static final String BOTTOM_RIGHT_LOCATION = "bottomRight"; //$NON-NLS-1$
- protected static final String TOP_RIGHT_LOCATION = "topRight"; //$NON-NLS-1$
- protected static final String BOTTOM_LOCATION = "bottom"; //$NON-NLS-1$
-
- // view id's
- protected static String ID_PROJECT_EXPLORER = "org.eclipse.ui.navigator.ProjectExplorer"; //$NON-NLS-1$
- protected static final String ID_SERVER = "org.eclipse.wst.server.ui.ServersView"; //$NON-NLS-1$
- protected static String ID_WST_SNIPPETS_VIEW = "org.eclipse.wst.common.snippets.internal.ui.SnippetsView"; //$NON-NLS-1$
-
- public WebDevelopmentPerspective() {
- super();
- //If preference exists for alternate view, replace.
- String viewerID = ProductManager.getProperty(IProductConstants.ID_PERSPECTIVE_HIERARCHY_VIEW);
- if (viewerID != null) {
- // verify that the view actually exists
- if (PlatformUI.getWorkbench().getViewRegistry().find(viewerID) != null){
- ID_PROJECT_EXPLORER = viewerID;
- }
- }
- }
-
- /*
- *____ ________________ _____
- *| | | |
- *| P | | O |
- *| R | ED | u |
- *| o | | t |
- *| j | | l |
- *| |________________| i |
- *| E | | n |
- *| X | PROB/SERV/PROP | e |
- *|_P__|________________|_____|
- *
- */
- public void createInitialLayout(IPageLayout layout) {
- // everything is based off the editor area
- String editorArea = layout.getEditorArea();
-
- // LEFT Area (Project Explorer)
- IFolderLayout topLeft = layout.createFolder(TOP_LEFT_LOCATION,
- IPageLayout.LEFT, 0.25f, editorArea);
- topLeft.addView(ID_PROJECT_EXPLORER);
- topLeft.addPlaceholder(IPageLayout.ID_RES_NAV);
-
- // TOP RIGHT Area (Outline)
- IFolderLayout topRight = layout.createFolder(TOP_RIGHT_LOCATION,
- IPageLayout.RIGHT, 0.80f, editorArea);
- topRight.addView(IPageLayout.ID_OUTLINE);
- topRight.addView(ID_WST_SNIPPETS_VIEW);
-
- // BOTTOM Area (Problems, Server, Properties)
- IFolderLayout bottom = layout.createFolder(BOTTOM_LOCATION,
- IPageLayout.BOTTOM, 0.70f, editorArea);
- bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
- bottom.addView(ID_SERVER);
- bottom.addView(IPageLayout.ID_PROP_SHEET);
- bottom.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID);
- bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
- bottom.addPlaceholder(IPageLayout.ID_BOOKMARKS);
- bottom.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
- bottom.addPlaceholder(IPageLayout.ID_TASK_LIST);
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/AbstractOpenWizardAction.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/AbstractOpenWizardAction.java
deleted file mode 100644
index 809dfe254..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/AbstractOpenWizardAction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.IWorkbenchWizard;
-
-public abstract class AbstractOpenWizardAction implements IWorkbenchWindowActionDelegate
-{
-
- private IWorkbenchWindow window;
-
- public AbstractOpenWizardAction()
- {
- super();
- }
-
- public void dispose()
- {
- }
-
- public void init( IWorkbenchWindow window )
- {
- this.window = window;
- }
-
- abstract public void run( IAction action );
-
- public void selectionChanged( IAction action, ISelection selection )
- {
- }
-
- protected void openWizardDialog( IWorkbenchWizard wizard )
- {
- ISelection selection = window.getSelectionService().getSelection();
-
- if ( selection instanceof IStructuredSelection )
- {
- wizard.init( window.getWorkbench(), (IStructuredSelection) selection );
- }
- else
- {
- wizard.init( window.getWorkbench(), StructuredSelection.EMPTY );
- }
-
- Shell parent = window.getShell();
- WizardDialog dialog = new WizardDialog( parent, wizard );
-
- dialog.create();
- dialog.open();
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenCSSWizardAction.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenCSSWizardAction.java
deleted file mode 100644
index 2527044b6..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenCSSWizardAction.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.wst.css.ui.internal.wizard.NewCSSWizard;
-
-public class OpenCSSWizardAction extends AbstractOpenWizardAction
-{
-
- @Override
- public void run( IAction action )
- {
- openWizardDialog( new NewCSSWizard() );
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenHTMLWizardAction.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenHTMLWizardAction.java
deleted file mode 100644
index b009c15af..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenHTMLWizardAction.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard;
-
-public class OpenHTMLWizardAction extends AbstractOpenWizardAction
-{
-
- @Override
- public void run( IAction action )
- {
- openWizardDialog( new NewHTMLWizard() );
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenJSWizardAction.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenJSWizardAction.java
deleted file mode 100644
index 0e4bb24da..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/actions/OpenJSWizardAction.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.actions;
-
-import org.eclipse.jface.action.IAction;
-
-public class OpenJSWizardAction extends AbstractOpenWizardAction
-{
-
- @Override
- public void run( IAction action )
- {
- openWizardDialog( new org.eclipse.wst.jsdt.internal.ui.wizards.NewJSWizard() );
- }
-
-}
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 4aa87c5ae..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.java
+++ /dev/null
@@ -1,698 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2011 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.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.SortedSet;
-
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-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.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.WorkingSetGroup;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-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.frameworks.internal.operations.IProjectCreationPropertiesNew;
-import org.eclipse.wst.common.frameworks.internal.ui.NewProjectGroup;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IPreset;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.events.IProjectFacetsChangedEvent;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
-import org.eclipse.wst.common.project.facet.core.util.AbstractFilter;
-import org.eclipse.wst.common.project.facet.core.util.FilterEvent;
-import org.eclipse.wst.common.project.facet.core.util.IFilter;
-import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
-import org.eclipse.wst.common.project.facet.ui.PresetSelectionPanel;
-import org.eclipse.wst.project.facet.ProductManager;
-import org.eclipse.wst.server.ui.ServerUIUtil;
-import org.eclipse.wst.web.internal.ResourceHandler;
-import org.eclipse.wst.web.internal.facet.RuntimePresetMappingRegistry;
-
-public class DataModelFacetCreationWizardPage extends DataModelWizardPage implements IFacetProjectCreationDataModelProperties {
-
- private static final String NULL_RUNTIME = "NULL_RUNTIME"; //$NON-NLS-1$
- private static final String MRU_RUNTIME_STORE = "MRU_RUNTIME_STORE"; //$NON-NLS-1$
-
- protected static final String RESOURCE_WORKING_SET = "org.eclipse.ui.resourceWorkingSetPage"; //$NON-NLS-1$
- protected static final String JAVA_WORKING_SET = "org.eclipse.jdt.ui.JavaWorkingSetPage"; //$NON-NLS-1$
-
- protected IProjectFacet primaryProjectFacet = null;
- protected Combo primaryVersionCombo = null;
-
- protected WorkingSetGroup workingSetGroup;
-
- private List<IFacetedProjectListener> facetedProjectListeners = new ArrayList<IFacetedProjectListener>();
-
- protected Set<IProjectFacetVersion> getFacetConfiguration( final IProjectFacetVersion primaryFacetVersion )
- {
- final Set<IProjectFacetVersion> config = new HashSet<IProjectFacetVersion>();
-
- for( IProjectFacet fixedFacet : this.fpjwc.getFixedProjectFacets() )
- {
- if( fixedFacet == primaryFacetVersion.getProjectFacet() )
- {
- config.add( primaryFacetVersion );
- }
- else
- {
- config.add( this.fpjwc.getHighestAvailableVersion( fixedFacet ) );
- }
- }
-
- return config;
- }
-
- private static final String[] VALIDATION_PROPERTIES =
- {
- IProjectCreationPropertiesNew.PROJECT_NAME,
- IProjectCreationPropertiesNew.PROJECT_LOCATION,
- FACET_RUNTIME,
- FACETED_PROJECT_WORKING_COPY
- };
-
- protected static GridData gdhfill() {
- return new GridData(GridData.FILL_HORIZONTAL);
- }
-
- protected static GridData hspan( final GridData gd,
- final int span )
- {
- gd.horizontalSpan = span;
- return gd;
- }
-
- @Override
- 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);
- createServerTargetComposite(top);
- createPrimaryFacetComposite(top);
- createPresetPanel(top);
- return top;
- }
-
- private String getPrimaryFacetCompositeLabel()
- {
- final StringBuilder buf = new StringBuilder();
- boolean firstWord = true;
-
- for( String word : primaryProjectFacet.getLabel().split( " " ) ) //$NON-NLS-1$
- {
- if( firstWord )
- {
- buf.append( word );
- firstWord = false;
- }
- else
- {
- buf.append( ' ' );
-
- if( word.length() == 1 || ! Character.isUpperCase( word.charAt( 1 ) ) )
- {
- buf.append( Character.toLowerCase( word.charAt( 0 ) ) );
- buf.append( word.substring( 1 ) );
- }
- else
- {
- buf.append( word );
- }
- }
- }
-
- buf.append( ' ' );
- buf.append( Messages.FACET_VERSION );
-
- return buf.toString();
- }
-
- protected void createPrimaryFacetComposite(Composite top) {
- primaryProjectFacet = ProjectFacetsManager.getProjectFacet( getModuleTypeID() );
- if (primaryProjectFacet.getVersions().size() <= 1){
- //there is no need to create this section if there is only one
- //facet version to choose from (e.g. utility and static web)
- return;
- }
-
- final Group group = new Group( top, SWT.NONE );
- group.setLayoutData( gdhfill() );
- group.setLayout( new GridLayout( 1, false ) );
- group.setText( getPrimaryFacetCompositeLabel() );
-
- primaryVersionCombo = new Combo( group, SWT.BORDER | SWT.READ_ONLY );
- primaryVersionCombo.setLayoutData( gdhfill() );
- updatePrimaryVersions();
-
- primaryVersionCombo.addSelectionListener
- (
- new SelectionAdapter()
- {
- @Override
- public void widgetSelected( final SelectionEvent e )
- {
- handlePrimaryFacetVersionSelectedEvent();
- }
- }
- );
-
- IFacetedProjectListener fpjwcListenerForPrimaryFacetCombo = new IFacetedProjectListener() {
- public void handleEvent(IFacetedProjectEvent event) {
- if(event.getType() == IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED){
- //this block is to update the combo when the underlying facet version changes
- IProjectFacetsChangedEvent actionEvent = (IProjectFacetsChangedEvent)event;
- Set<IProjectFacetVersion> changedVersions = actionEvent.getFacetsWithChangedVersions();
-
- boolean foundComboVersion = false;
- for(Iterator <IProjectFacetVersion> iterator = changedVersions.iterator(); iterator.hasNext() && !foundComboVersion;){
- IProjectFacetVersion next = iterator.next();
- if(next.getProjectFacet().equals(primaryProjectFacet)){
- foundComboVersion = true;
- final IProjectFacetVersion selectedVersion = next;
- Display.getDefault().asyncExec(new Runnable(){
- public void run() {
- String selectedText = primaryVersionCombo.getItem(primaryVersionCombo.getSelectionIndex());
- if(!selectedText.equals(selectedVersion.getVersionString())){
- String [] items = primaryVersionCombo.getItems();
- int selectedVersionIndex = -1;
- for(int i=0;i<items.length && selectedVersionIndex == -1; i++){
- if(items[i].equals(selectedVersion.getVersionString())){
- selectedVersionIndex = i;
- primaryVersionCombo.select(selectedVersionIndex);
- }
- }
- }
- }
- });
- }
- }
- } else if(event.getType() == IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED){
- //this block updates the items in the combo when the runtime changes
- Display.getDefault().asyncExec(new Runnable(){
- public void run() {
- updatePrimaryVersions();
- }
- });
- }
- }
-
- };
- this.facetedProjectListeners.add(fpjwcListenerForPrimaryFacetCombo);
- fpjwc.addListener(fpjwcListenerForPrimaryFacetCombo, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED, IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
- }
-
- protected IProjectFacet getPrimaryFacet()
- {
- return this.primaryProjectFacet;
- }
-
- public IProjectFacetVersion getPrimaryFacetVersion()
- {
- IProjectFacetVersion fv = null;
-
- if( this.primaryProjectFacet.getVersions().size() > 1 )
- {
- final int selectedIndex = this.primaryVersionCombo.getSelectionIndex();
-
- if( selectedIndex != -1 )
- {
- final String fvstr = this.primaryVersionCombo.getItem( selectedIndex );
- fv = this.primaryProjectFacet.getVersion( fvstr );
- }
- }
- else
- {
- fv = this.primaryProjectFacet.getDefaultVersion();
- }
-
- return fv;
- }
-
- protected void handlePrimaryFacetVersionSelectedEvent()
- {
- final IProjectFacetVersion fv = getPrimaryFacetVersion();
- if( fv != null )
- {
- String presetID = null;
- IRuntime runtime = (IRuntime)model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME);
- if(runtime != null){
- if(runtime.getRuntimeComponents().size() > 0){
- IRuntimeComponent runtimeComponent = runtime.getRuntimeComponents().get(0);
- String facetRuntimeTypeID = runtimeComponent.getRuntimeComponentType().getId();
- String facetRuntimeVersion = runtimeComponent.getRuntimeComponentVersion().getVersionString();
- String facetID = fv.getProjectFacet().getId();
- String facetVersion = fv.getVersionString();
- presetID = RuntimePresetMappingRegistry.INSTANCE.getPresetID(facetRuntimeTypeID, facetRuntimeVersion, facetID, facetVersion);
- }
- }
-
- if( presetID == null )
- {
- final Set<IProjectFacetVersion> facets = getFacetConfiguration( fv );
- this.fpjwc.setProjectFacets( facets );
- }
- else
- { // setting the facets prior to setting the preset is to let the dynamic presets adjust
- final Set<IProjectFacetVersion> facets = getFacetConfiguration( fv );
- this.fpjwc.setProjectFacets( facets );
- this.fpjwc.setSelectedPreset(presetID);
-
- }
- }
- }
-
- protected void updatePrimaryVersions(){
- IProjectFacetVersion selectedVersion = fpjwc.getProjectFacetVersion(primaryProjectFacet);
- SortedSet<IProjectFacetVersion> initialVersions = fpjwc.getAvailableVersions(primaryProjectFacet);
- String [] items = new String[initialVersions.size()];
- int i=0;
- int selectedVersionIndex = -1;
- for(Iterator <IProjectFacetVersion> iterator = initialVersions.iterator(); iterator.hasNext(); i++){
- items[i] = iterator.next().getVersionString();
- if(selectedVersionIndex == -1 && items[i].equals(selectedVersion.getVersionString())){
- selectedVersionIndex = i;
- }
- }
- primaryVersionCombo.clearSelection();
- primaryVersionCombo.setItems(items);
- primaryVersionCombo.select(selectedVersionIndex);
- }
-
- public static class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.web.ui.internal.wizards.facetcreationpagemessages"; //$NON-NLS-1$
-
- public static String FACET_VERSION;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
- }
-
- protected void createPresetPanel(Composite top) {
- final IFacetedProjectWorkingCopy fpjwc
- = ( (ModifyFacetedProjectWizard) getWizard() ).getFacetedProjectWorkingCopy();
-
- final IFilter<IPreset> filter = new AbstractFilter<IPreset>()
- {
- {
- IFacetedProjectListener fpjwcListenerForPreset = new IFacetedProjectListener()
- {
- public void handleEvent( final IFacetedProjectEvent event )
- {
- handleProjectFacetsChangedEvent( (IProjectFacetsChangedEvent) event );
- }
- };
- facetedProjectListeners.add(fpjwcListenerForPreset);
- fpjwc.addListener(fpjwcListenerForPreset, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED );
- }
-
- public boolean check( final IPreset preset )
- {
- final IProjectFacetVersion primaryFacetVersion = getPrimaryFacetVersion();
- return preset.getProjectFacets().contains( primaryFacetVersion );
- }
-
- private void handleProjectFacetsChangedEvent( final IProjectFacetsChangedEvent event )
- {
- for( IProjectFacetVersion fv : event.getFacetsWithChangedVersions() )
- {
- if( fv.getProjectFacet() == getPrimaryFacet() )
- {
- final IFilterEvent<IPreset> filterEvent
- = new FilterEvent<IPreset>( this, IFilterEvent.Type.FILTER_CHANGED );
-
- notifyListeners( filterEvent );
- }
- }
- }
- };
-
- final PresetSelectionPanel ppanel = new PresetSelectionPanel( top, fpjwc, filter );
-
- ppanel.setLayoutData( gdhfill() );
- }
-
- public static boolean launchNewRuntimeWizard(Shell shell, IDataModel model) {
- return launchNewRuntimeWizard(shell, model, null);
- }
-
- public static boolean launchNewRuntimeWizard(Shell shell, final IDataModel model, String serverTypeID)
- {
- if( model == null )
- {
- return false;
- }
-
- final DataModelPropertyDescriptor[] preAdditionDescriptors = model.getValidPropertyDescriptors(FACET_RUNTIME);
-
- final boolean[] keepWaiting = { true };
-
- final IDataModelListener listener = new IDataModelListener()
- {
- public void propertyChanged( final DataModelEvent event )
- {
- if( event.getPropertyName().equals( FACET_RUNTIME ) &&
- event.getFlag() == DataModelEvent.VALID_VALUES_CHG )
- {
- synchronized( keepWaiting )
- {
- keepWaiting[ 0 ] = false;
- keepWaiting.notify();
- }
-
- model.removeListener( this );
- }
- }
- };
-
- model.addListener( listener );
-
- boolean isOK = ServerUIUtil.showNewRuntimeWizard(shell, serverTypeID, null);
-
- if( isOK )
- {
- // Do the rest of the processing in a separate thread. Since we are going to block
- // and wait, doing this on the UI thread can cause hangs.
-
- final Thread newRuntimeSelectionThread = new Thread()
- {
- @Override
- public void run()
- {
- // Causes the list of runtimes held by the RuntimeManager to be refreshed and
- // triggers events to listeners on that list.
-
- RuntimeManager.getRuntimes();
-
- // Wait until the list of valid values has updated to include the new runtime.
-
- synchronized( keepWaiting )
- {
- while( keepWaiting[ 0 ] == true )
- {
- try
- {
- keepWaiting.wait();
- }
- catch( InterruptedException e ) {}
- }
- }
-
- // Select the new runtime.
-
- 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 = getNewObject(preAddition, postAddition);
-
- if (newAddition != null) // can this ever be null?
- model.setProperty(FACET_RUNTIME, newAddition);
- }
- };
-
- newRuntimeSelectionThread.start();
-
- return true;
- }
- model.removeListener( listener );
- return false;
- }
-
- public boolean internalLaunchNewRuntimeWizard(Shell shell, IDataModel model) {
- return launchNewRuntimeWizard(shell, model, getModuleTypeID());
- }
-
- protected String getModuleTypeID() {
- return null;
- }
-
- protected Combo serverTargetCombo;
- protected NewProjectGroup projectNameGroup;
- private final IFacetedProjectWorkingCopy fpjwc;
- private final IFacetedProjectListener fpjwcListener;
-
- public DataModelFacetCreationWizardPage(IDataModel dataModel, String pageName)
- {
- super(dataModel, pageName);
-
- this.fpjwc = (IFacetedProjectWorkingCopy) this.model.getProperty( FACETED_PROJECT_WORKING_COPY );
-
- this.fpjwcListener = new IFacetedProjectListener()
- {
- public void handleEvent( final IFacetedProjectEvent event )
- {
- final Runnable runnable = new Runnable()
- {
- public void run()
- {
- validatePage();
- }
- };
-
- getContainer().getShell().getDisplay().asyncExec( runnable );
- }
- };
-
- this.fpjwc.addListener( this.fpjwcListener, IFacetedProjectEvent.Type.VALIDATION_PROBLEMS_CHANGED );
- }
-
- protected void createServerTargetComposite(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- group.setText(ResourceHandler.TargetRuntime);
- group.setLayoutData(gdhfill());
- group.setLayout(new GridLayout(2, false));
- serverTargetCombo = new Combo(group, SWT.BORDER | SWT.READ_ONLY);
- serverTargetCombo.setLayoutData(gdhfill());
- Button newServerTargetButton = new Button(group, SWT.NONE);
- newServerTargetButton.setText(Resources.newRuntimeButton);
- GridDataFactory.defaultsFor(newServerTargetButton).applyTo(newServerTargetButton);
- newServerTargetButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (!internalLaunchNewRuntimeWizard(getShell(), model)) {
- //Bugzilla 135288
- //setErrorMessage(ResourceHandler.InvalidServerTarget);
- }
- }
- });
- Control[] deps = new Control[]{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);
- }
-
- @Override
- protected String[] getValidationPropertyNames()
- {
- return VALIDATION_PROPERTIES;
- }
-
- @Override
- public void dispose() {
- super.dispose();
- if (projectNameGroup != null)
- projectNameGroup.dispose();
-
- this.fpjwc.removeListener( this.fpjwcListener );
- for (IFacetedProjectListener listener:this.facetedProjectListeners){
- fpjwc.removeListener(listener);
- }
- model = null;
-
- }
-
- @Override
- public void storeDefaultSettings() {
- IDialogSettings settings = getDialogSettings();
- DataModelFacetCreationWizardPage.saveRuntimeSettings(settings, model);
- }
-
- @Override
- public void restoreDefaultSettings() {
- IDialogSettings settings = getDialogSettings();
- DataModelFacetCreationWizardPage.restoreRuntimeSettings(settings, model);
- }
-
- public static void saveRuntimeSettings(IDialogSettings settings, IDataModel model){
- if (settings != null) {
- String[] mruRuntimeArray = settings.getArray(MRU_RUNTIME_STORE);
- List mruRuntimes = new ArrayList();
- if(mruRuntimeArray != null)
- mruRuntimes.addAll(Arrays.asList(mruRuntimeArray));
-
- IRuntime runtime = (IRuntime) model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME);
- String runtimeName = runtime == null ? NULL_RUNTIME : runtime.getName();
-
- if (mruRuntimes.contains(runtimeName)) {
- mruRuntimes.remove(runtimeName);
- }
- mruRuntimes.add(0, runtimeName);
- while (mruRuntimes.size() > 5) {
- mruRuntimes.remove(5);
- }
- mruRuntimeArray = new String[mruRuntimes.size()];
- for (int i = 0; i < mruRuntimeArray.length; i++) {
- mruRuntimeArray[i] = (String) mruRuntimes.get(i);
- }
- settings.put(MRU_RUNTIME_STORE, mruRuntimeArray);
- }
- }
-
- public static void restoreRuntimeSettings(IDialogSettings settings, IDataModel model){
- if (settings != null) {
- if (!model.isPropertySet(IFacetProjectCreationDataModelProperties.FACET_RUNTIME)) {
- boolean runtimeSet = false;
- String[] mruRuntimeArray = settings.getArray(MRU_RUNTIME_STORE);
- DataModelPropertyDescriptor[] descriptors = model.getValidPropertyDescriptors(IFacetProjectCreationDataModelProperties.FACET_RUNTIME);
- List mruRuntimes = new ArrayList();
- if (mruRuntimeArray == null) {
- List defRuntimes = ProductManager.getDefaultRuntimes();
- for (Iterator iter = defRuntimes.iterator(); iter.hasNext();)
- mruRuntimes.add(((IRuntime) iter.next()).getName());
- } else {
- mruRuntimes.addAll(Arrays.asList(mruRuntimeArray));
- }
- if (!mruRuntimes.isEmpty()) {
- for (int i = 0; i < mruRuntimes.size() && !runtimeSet; i++) {
- for (int j = 0; j < descriptors.length-1 && !runtimeSet; j++) {
- if (mruRuntimes.get(i).equals(((IRuntime)descriptors[j].getPropertyValue()).getName())) {
- model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, descriptors[j].getPropertyValue());
- runtimeSet = true;
- }
- }
- if(!runtimeSet && mruRuntimes.get(i).equals(NULL_RUNTIME)){
- model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, descriptors[descriptors.length -1].getPropertyValue());
- runtimeSet = true;
- }
- }
- }
- if (!runtimeSet && descriptors.length > 0) {
- model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, descriptors[0].getPropertyValue());
- }
- }
- }
- }
-
-
- /**
- * Find first newObject that is not in the oldObjects array (using "==").
- *
- * @param oldObjects
- * @param newObjects
- * @return first newObject not found in oldObjects, or <code>null</code> if all found.
- *
- * @since 1.0.0
- */
- private static Object getNewObject(Object[] oldObjects, Object[] newObjects) {
- if (oldObjects != null && newObjects != null && oldObjects.length < newObjects.length) {
- for (int i = 0; i < newObjects.length; i++) {
- boolean found = false;
- Object object = newObjects[i];
- for (int j = 0; j < oldObjects.length; j++) {
- if (oldObjects[j] == object) {
- found = true;
- break;
- }
- }
- if (!found)
- return object;
- }
- }
- if (oldObjects == null && newObjects != null && newObjects.length == 1)
- return newObjects[0];
- return null;
- }
-
- protected WorkingSetGroup createWorkingSetGroup(Composite composite,
- IStructuredSelection selection, String[] supportedWorkingSetTypes) {
- if (workingSetGroup != null)
- return workingSetGroup;
- workingSetGroup = new WorkingSetGroup(composite, selection,
- supportedWorkingSetTypes);
- return workingSetGroup;
- }
-
- protected WorkingSetGroup createWorkingSetGroupPanel(Composite composite, String[] workingSetTypes) {
- IStructuredSelection structuredSelection = null;
- ISelection currentSelection = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getSelectionService()
- .getSelection();
- if (currentSelection instanceof IStructuredSelection) {
- structuredSelection = (IStructuredSelection) currentSelection;
- }
- WorkingSetGroup group = createWorkingSetGroup(composite, structuredSelection, workingSetTypes);
- return group;
- }
-
- public IWorkingSet[] getSelectedWorkingSets() {
- return workingSetGroup == null ? new IWorkingSet[0] : workingSetGroup
- .getSelectedWorkingSets();
- }
-
- private static final class Resources extends NLS
- {
- public static String newRuntimeButton;
-
- static
- {
- initializeMessages( DataModelFacetCreationWizardPage.class.getName(), Resources.class );
- }
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.properties b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.properties
deleted file mode 100644
index 8f54320eb..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/DataModelFacetCreationWizardPage.properties
+++ /dev/null
@@ -1 +0,0 @@
-newRuntimeButton = New &Runtime...
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/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 565a9f3b3..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/IWstWebUIContextIds.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.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 6b335852d..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/NewProjectDataModelFacetWizard.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 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.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkingSet;
-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.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-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.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-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.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IPreset;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
-import org.eclipse.wst.web.internal.DelegateConfigurationElement;
-import org.eclipse.wst.web.ui.internal.Logger;
-import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
-
-public abstract class NewProjectDataModelFacetWizard extends ModifyFacetedProjectWizard implements INewWizard, IFacetProjectCreationDataModelProperties {
-
- protected IDataModel model = null;
- protected IFacetedProjectTemplate template;
- private IWizardPage[] beginingPages;
- private IConfigurationElement configurationElement;
-
- public NewProjectDataModelFacetWizard(IDataModel model)
- {
- this.model = ( model == null ? createDataModel() : model );
- this.template = getTemplate();
-
- setFacetedProjectWorkingCopy((IFacetedProjectWorkingCopy)this.model.getProperty(FACETED_PROJECT_WORKING_COPY));
- getFacetedProjectWorkingCopy().setFixedProjectFacets( this.template.getFixedProjectFacets() );
- setDefaultPageImageDescriptor(getDefaultPageImageDescriptor());
- setShowFacetsSelectionPage( false );
- }
-
- public NewProjectDataModelFacetWizard()
- {
- this( null );
- }
-
- public IDataModel getDataModel() {
- return model;
- }
-
- protected abstract IDataModel createDataModel();
-
- protected abstract ImageDescriptor getDefaultPageImageDescriptor();
-
- protected abstract IFacetedProjectTemplate getTemplate();
-
- /**
- * Returns the first page that shows up before the facets page. If multiple pages are required,
- * also override {@link #createBeginingPages()}.
- *
- * @return
- */
- protected abstract IWizardPage createFirstPage();
-
- /**
- * Subclasses should override to add more than one page before the facets page. If only one page
- * is required, then use {@link #createFirstPage()}. The default implementation will return the
- * result of {@link #createFirstPage()}.
- *
- * @return
- */
- protected IWizardPage[] createBeginingPages() {
- return new IWizardPage[]{createFirstPage()};
- }
-
- @Override
- public void addPages() {
- beginingPages = createBeginingPages();
- for (int i = 0; i < beginingPages.length; i++) {
- addPage(beginingPages[i]);
- }
-
- super.addPages();
-
- getFacetedProjectWorkingCopy().addListener
- (
- new IFacetedProjectListener()
- {
- public void handleEvent( final IFacetedProjectEvent event )
- {
- facetSelectionChangedEvent();
- }
- },
- IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED
- );
- }
-
- @Override
- public void createPageControls(Composite container) {
- super.createPageControls(container);
-
- final IPreset preset = this.template.getInitialPreset();
- final IRuntime runtime = (IRuntime) model.getProperty( FACET_RUNTIME );
-
- if( preset == null )
- {
- // If no preset is specified, select the runtime and it's default
- // facets.
-
- setRuntimeAndDefaultFacets( runtime );
- }
- else
- {
- // If preset is specified, select the runtime only if supports all
- // of the facets included in the preset.
-
- getFacetedProjectWorkingCopy().setSelectedPreset( preset.getId() );
-
- boolean supports = false;
-
- if( runtime != null )
- {
- supports = true;
-
- for( Iterator itr = preset.getProjectFacets().iterator(); itr.hasNext(); )
- {
- final IProjectFacetVersion fv = (IProjectFacetVersion) itr.next();
-
- if( ! runtime.supports( fv ) )
- {
- supports = false;
- break;
- }
- }
- }
-
- if( supports )
- {
- getFacetedProjectWorkingCopy().setTargetedRuntimes( Collections.singleton( runtime ) );
- }
- else
- {
- model.setProperty( FACET_RUNTIME, null );
- }
- }
-
- synchRuntimes();
- }
-
- @Override
- public IWizardPage[] getPages() {
- final IWizardPage[] base = super.getPages();
- final IWizardPage[] pages = new IWizardPage[base.length + beginingPages.length];
-
- for (int i = 0; i < beginingPages.length; i++) {
- pages[i] = beginingPages[i];
- }
-
- System.arraycopy(base, 0, pages, beginingPages.length, base.length);
-
- return pages;
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- }
-
- protected void synchRuntimes()
- {
- final Boolean[] suppressBackEvents = { Boolean.FALSE };
-
- 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())) {
- if( ! suppressBackEvents[ 0 ].booleanValue() ) {
- IRuntime runtime = (IRuntime) event.getProperty();
- setRuntimeAndDefaultFacets( runtime );
- }
- }
- }
- }
- });
-
- getFacetedProjectWorkingCopy().addListener
- (
- new IFacetedProjectListener()
- {
- public void handleEvent( final IFacetedProjectEvent event )
- {
- suppressBackEvents[ 0 ] = Boolean.TRUE;
- model.setProperty(FACET_RUNTIME, getFacetedProjectWorkingCopy().getPrimaryRuntime());
- suppressBackEvents[ 0 ] = Boolean.FALSE;
- }
- },
- IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED
- );
- }
-
- protected void setRuntimeAndDefaultFacets( final IRuntime runtime )
- {
- final IFacetedProjectWorkingCopy dm = getFacetedProjectWorkingCopy();
-
- dm.setTargetedRuntimes( Collections.<IRuntime>emptySet() );
-
- if( runtime != null )
- {
- final Set<IProjectFacetVersion> minFacets = new HashSet<IProjectFacetVersion>();
-
- try
- {
- for( IProjectFacet f : dm.getFixedProjectFacets() )
- {
- minFacets.add( f.getLatestSupportedVersion( runtime ) );
- }
- }
- catch( CoreException e )
- {
- throw new RuntimeException( e );
- }
-
- dm.setProjectFacets( minFacets );
-
- dm.setTargetedRuntimes( Collections.singleton( runtime ) );
- }
-
- dm.setSelectedPreset( FacetedProjectFramework.DEFAULT_CONFIGURATION_PRESET_ID );
- }
-
- public String getProjectName() {
- return model.getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME);
- }
-
- @Override
- protected void performFinish(final IProgressMonitor monitor)
-
- throws CoreException
-
- {
- monitor.beginTask("", 10); //$NON-NLS-1$
- storeDefaultSettings();
- try {
- super.performFinish(new SubProgressMonitor(monitor, 8));
-
- try {
- getFacetProjectNotificationOperation().execute(new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- String msg = e.getMessage();
- if( msg == null ) msg = ""; //$NON-NLS-1$
- final IStatus st = new Status( IStatus.ERROR, WSTWebUIPlugin.PLUGIN_ID, 0, msg, e );
- throw new CoreException( st );
- }
- } finally {
- monitor.done();
- }
- }
-
- @Override
- public boolean performFinish() {
- if (super.performFinish() == false) {
- return false;
- }
-
- try {
- postPerformFinish();
- } catch (InvocationTargetException e) {
- Logger.logException(e);
- }
-
- return true;
- }
-
- /**
- * <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 no 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() {
- return null;
- }
-
- /**
- * {@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 {
- String projName = getProjectName();
- IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projName);
- IWorkbench workbench = WSTWebUIPlugin.getDefault().getWorkbench();
-
- // add to the selected working sets
- if (newProject != null &&
- beginingPages != null &&
- beginingPages.length > 0 &&
- beginingPages[0] instanceof DataModelFacetCreationWizardPage) {
- DataModelFacetCreationWizardPage mainPage = (DataModelFacetCreationWizardPage) beginingPages[0];
- IWorkingSet[] workingSets = mainPage.getSelectedWorkingSets();
- workbench.getWorkingSetManager().addToWorkingSets(newProject, workingSets);
- }
-
- // open the "final" perspective
- if (getFinalPerspectiveID() != null && getFinalPerspectiveID().length() > 0) {
- final IConfigurationElement element = new DelegateConfigurationElement(configurationElement) {
- @Override
- 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);
-
- // select and reveal
- BasicNewResourceWizard.selectAndReveal(newProject, workbench.getActiveWorkbenchWindow());
- }
-
- protected IDataModelOperation getFacetProjectNotificationOperation() {
- return new DataModelPausibleOperationImpl(new AbstractDataModelOperation(this.model) {
- @Override
- public String getID() {
- return NewProjectDataModelFacetWizard.class.getName();
- }
-
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return AbstractDataModelProvider.OK_STATUS;
- }
- });
- }
-
- /**
- * 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
- */
- protected void facetSelectionChangedEvent() {
- Set actions = getFacetedProjectWorkingCopy().getProjectFacetActions();
- 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);
- }
-
- 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();
- }
-
- @Override
- public void dispose() {
- if(this.model != null){
- this.model.dispose();
- }
- super.dispose();
- }
-
-}
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 f4e92869f..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebFacetInstallPage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.web.ui.internal.wizards;
-
-import org.eclipse.jface.dialogs.Dialog;
-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);
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[]{CONTEXT_ROOT, CONTENT_DIR};
- }
-
- @Override
- 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);
- Dialog.applyDialogFont(parent);
-
- return composite;
- }
-
-}
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 ec05607e4..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectFirstPage.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.wst.web.ui.internal.wizards;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-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);
- }
-
- @Override
- protected String getModuleTypeID() {
- return IModuleConstants.WST_WEB_MODULE;
- }
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- final Composite top = super.createTopLevelComposite(parent);
- createWorkingSetGroupPanel(top, new String[] { RESOURCE_WORKING_SET });
- return top;
- }
-
-}
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 874967243..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/SimpleWebProjectWizard.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.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.IProductConstants;
-import org.eclipse.wst.project.facet.ProductManager;
-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);
- }
-
- @Override
- protected IDataModel createDataModel() {
- return DataModelFactory.createDataModel(new SimpleWebFacetProjectCreationDataModelProvider());
- }
-
- @Override
- protected ImageDescriptor getDefaultPageImageDescriptor() {
- return WSTWebUIPlugin.getDefault().getImageDescriptor("newwprj_wiz"); //$NON-NLS-1$
- }
-
- @Override
- protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("template.wst.web"); //$NON-NLS-1$
- }
-
- @Override
- protected IWizardPage createFirstPage() {
- return new SimpleWebProjectFirstPage(model, "first.page"); //$NON-NLS-1$
- }
-
- @Override
- protected String getFinalPerspectiveID() {
- return ProductManager.getProperty(IProductConstants.FINAL_PERSPECTIVE_STATICWEB);
- }
-
-}
diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/facetcreationpagemessages.properties b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/facetcreationpagemessages.properties
deleted file mode 100644
index 08afb68ce..000000000
--- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/wizards/facetcreationpagemessages.properties
+++ /dev/null
@@ -1 +0,0 @@
-FACET_VERSION= &version \ No newline at end of file

Back to the top