diff options
Diffstat (limited to 'plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst')
16 files changed, 0 insertions, 887 deletions
diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/ISimpleWebModuleConstants.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/ISimpleWebModuleConstants.java deleted file mode 100644 index e86b07bf0..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/ISimpleWebModuleConstants.java +++ /dev/null @@ -1,21 +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.internal; - - -public interface ISimpleWebModuleConstants -{ - public static final String PLUG_IN_ID = "org.eclipse.wst.web"; //$NON-NLS-1$ - public static final String STATIC_PROJECT_TYPE = "STATIC"; //$NON-NLS-1$ - public static final String CSS_DIRECTORY = "theme"; //$NON-NLS-1$ - public static final String INFO_DIRECTORY = "WEB-INF"; //$NON-NLS-1$ - public static final String LIBRARY_DIRECTORY = "lib"; //$NON-NLS-1$ - public static final String CLASSES_DIRECTORY = "classes"; //$NON-NLS-1$ -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/IWSTWebPreferences.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/IWSTWebPreferences.java deleted file mode 100644 index 0f4e7aab9..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/IWSTWebPreferences.java +++ /dev/null @@ -1,13 +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.internal; - -public interface IWSTWebPreferences { - String PREF_STATICWEBCONTENT = "org.eclipse.jst.j2ee.preference.staticWebContentName"; //$NON-NLS-1$ -} diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/ResourceHandler.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/ResourceHandler.java deleted file mode 100644 index 439098116..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/ResourceHandler.java +++ /dev/null @@ -1,38 +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.internal; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class ResourceHandler -{ - private static final String BUNDLE_NAME = "staticwebproject";//$NON-NLS-1$ - - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle - .getBundle(BUNDLE_NAME); - - private ResourceHandler() { - //Default constructor - } - - public static String getString(String key) - { - // TODO Auto-generated method stub - try - { - return RESOURCE_BUNDLE.getString(key); - } - catch( MissingResourceException e ) - { - return '!' + key + '!'; - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WSTWebPlugin.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WSTWebPlugin.java deleted file mode 100644 index a5394d9ff..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WSTWebPlugin.java +++ /dev/null @@ -1,66 +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.internal; - -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.wst.validation.internal.plugin.ValidationPlugin; - -/** - * The main plugin class to be used in the desktop. - */ -public class WSTWebPlugin extends Plugin -{ - //The shared instance. - private static WSTWebPlugin plugin; - - private WSTWebPreferences preferences; - - public static final String PLUGIN_ID = "com.ibm.etools.webtools.staticwebproject"; //$NON-NLS-1$ - public static final String VALIDATION_BUILDER_ID = ValidationPlugin.VALIDATION_BUILDER_ID; // 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 WSTWebPlugin() { - super(); - plugin = this; - } - - /** - * Returns the shared instance. - */ - public static WSTWebPlugin getDefault() - { - return plugin; - } - - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - protected void initializeDefaultPluginPreferences() { - getWSTWebPreferences().initializeDefaultPreferences(); - } - /** - * @return Returns the preferences. - */ - public WSTWebPreferences getWSTWebPreferences() { - if (this.preferences == null) - this.preferences = new WSTWebPreferences(this); - return this.preferences; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WSTWebPreferences.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WSTWebPreferences.java deleted file mode 100644 index fd5256a05..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/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.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/static_web_project/org/eclipse/wst/web/internal/WebPropertiesUtil.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WebPropertiesUtil.java deleted file mode 100644 index 7a3cc4303..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WebPropertiesUtil.java +++ /dev/null @@ -1,106 +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.internal; - -import java.util.StringTokenizer; - -public class WebPropertiesUtil { - private static final char[] BAD_CHARS = {'/', '\\', ':'}; - /** - * @param project - * org.eclipse.core.resources.IProject - */ - /** - * Returns a error message that states whether a context root is valid or not returns null if - * context root is fine - * - * @return java.lang.String - * @param contextRoot - * java.lang.String - */ - public static String validateContextRoot(String contextRoot) { - - if (contextRoot == null) - return null; - - String errorMessage = null; - - String name = contextRoot; - if (name.equals("") || name == null) { //$NON-NLS-1$ - // this was added because the error message shouldnt be shown initially. It should be - // shown only if context root field is edited to - errorMessage = ResourceHandler.getString("StaticWebProjectWizardBasePage.Page_Title"); //$NON-NLS-1$ - - //errorMessage = ProjectSupportResourceHandler.getString("Context_Root_cannot_be_empty_2"); //$NON-NLS-1$ - return errorMessage; - } - - /******************************************************************************************* - * // JZ - fix to defect 204264, "/" is valid in context root if (name.indexOf("//") != -1) { - * //$NON-NLS-1$ errorMessage = "// are invalid characters in a resource name"; return - * errorMessage; - * } - ******************************************************************************************/ - - if (name.trim().equals(name)) { - StringTokenizer stok = new StringTokenizer(name, "."); //$NON-NLS-1$ - outer : while (stok.hasMoreTokens()) { - String token = stok.nextToken(); - for (int i = 0; i < token.length(); i++) { - if (!(token.charAt(i) == '_') && !(token.charAt(i) == '-') && !(token.charAt(i) == '/') && Character.isLetterOrDigit(token.charAt(i)) == false) { - if (Character.isWhitespace(token.charAt(i))) { - //Removed because context roots can contain white space - //errorMessage = - // ResourceHandler.getString("_Context_root_cannot_conta_UI_");//$NON-NLS-1$ - // = " Context root cannot contain whitespaces." - } else { - errorMessage = ResourceHandler.getString("StaticWebProjectWizardBasePage.Page_Title"); //$NON-NLS-1$ - - //errorMessage = ProjectSupportResourceHandler.getString("The_character_is_invalid_in_a_context_root", new Object[]{(new Character(token.charAt(i))).toString()}); //$NON-NLS-1$ - break outer; - } - } - } - } - } // en/ end of if(name.trim - else - errorMessage = ResourceHandler.getString("StaticWebProjectWizardBasePage.Page_Title"); //$NON-NLS-1$ - //errorMessage = ProjectSupportResourceHandler.getString("Names_cannot_begin_or_end_with_whitespace_5"); //$NON-NLS-1$ - - return errorMessage; - } - - - /** - * Return true if the string contains any of the characters in the array. - */ - private static boolean contains(String str, char[] chars) { - for (int i = 0; i < chars.length; i++) { - if (str.indexOf(chars[i]) != -1) - return true; - } - return false; - } - - - public static String validateFolderName(String folderName) { - if (folderName.length() == 0) - return ResourceHandler.getString("StaticWebProjectWizardBasePage.Page_Title"); //$NON-NLS-1$ - - //return ProjectSupportResourceHandler.getString("Folder_name_cannot_be_empty_2"); //$NON-NLS-1$ - - if (contains(folderName, BAD_CHARS)) - return ResourceHandler.getString("StaticWebProjectWizardBasePage.Page_Title"); //$NON-NLS-1$ - - //return ProjectSupportResourceHandler.getString("Folder_name_is_not_valid", new Object[]{folderName}); //$NON-NLS-1$ - - return null; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/IStaticWebModuleArtifact.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/IStaticWebModuleArtifact.java deleted file mode 100644 index 49ee452b4..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/IStaticWebModuleArtifact.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.eclipse.wst.web.internal.deployables; - - -public interface IStaticWebModuleArtifact { - -} diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployable.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployable.java deleted file mode 100644 index 81a213ebb..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployable.java +++ /dev/null @@ -1,101 +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.internal.deployables; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.IModuleType; -import org.eclipse.wst.server.core.util.IStaticWeb; -import org.eclipse.wst.server.core.util.ProjectModule; - -public class StaticWebDeployable extends ProjectModule implements IStaticWeb { - - public StaticWebDeployable(IProject project) { - super(project); -// setWebNature(getStaticWebNature()); - } - - public String getFactoryId() { - return "org.eclipse.jst.j2ee.internal.internal.internal.web.deployables.static"; //$NON-NLS-1$ - } - - /** - * Returns true if this deployable currently exists, and false if it has been deleted or moved - * and is no longer represented by this deployable. - * - * @return boolean - */ - public boolean exists() { - if (getProject() == null || !getProject().exists()) - return false; - return true; - } - - public String getContextRoot() { - //TODO switch to components API -// IStaticWebNature nature = getStaticWebNature(); -// if (nature != null) -// return nature.getContextRoot(); - return null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.core.util.ProjectModule#getRootFolder() - */ - public IPath getRootFolder() { - // TODO fix up for components -// return getStaticWebNature().getRootPublishableFolder().getProjectRelativePath(); - return null; - } - - public String getType() { - return "web.static"; //$NON-NLS-1$ - } - - public String getVersion() { - return "1.0"; //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.wst.server.core.IModule#validate(org.eclipse.core.runtime.IProgressMonitor) - */ - public IStatus validate(IProgressMonitor monitor) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.server.core.IModule#getModuleType() - */ - public IModuleType getModuleType() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.server.core.IModule#getChildModules(org.eclipse.core.runtime.IProgressMonitor) - */ - public IModule[] getChildModules(IProgressMonitor monitor) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - // TODO Auto-generated method stub - return null; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory.java deleted file mode 100644 index 23676b073..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory.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.internal.deployables; - -import java.util.ArrayList; -import java.util.Iterator; - -import org.eclipse.core.resources.IProject; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.model.ModuleDelegate; -import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate; - -public class StaticWebDeployableFactory extends ProjectModuleFactoryDelegate { - private static final String ID = "org.eclipse.wst.web.internal.deployables.static"; //$NON-NLS-1$ - protected ArrayList moduleDelegates = new ArrayList(); - - /* - * @see DeployableProjectFactoryDelegate#getFactoryID() - */ - public String getFactoryId() { - return ID; - } - - /** - * Returns true if the project represents a deployable project of this type. - * - * @param project - * org.eclipse.core.resources.IProject - * @return boolean - */ - protected boolean isValidModule(IProject project) { - return false; - } - - /** - * Creates the deployable project for the given project. - * - * @param project - * org.eclipse.core.resources.IProject - * @return com.ibm.etools.server.core.model.IDeployableProject - */ - protected IModule createModule(IProject project) { - //TODO use components API -// try { -// IModule deployable = null; -// StaticWebDeployable projectModule = null; -// if (project.hasNature(ISimpleWebNatureConstants.STATIC_NATURE_ID)) { -// IBaseWebNature nature = (IBaseWebNature) project.getNature(ISimpleWebNatureConstants.STATIC_NATURE_ID); -// deployable = nature.getModule(); -// if (deployable == null) { -// projectModule = new StaticWebDeployable(nature.getProject()); -// deployable = createModule(projectModule.getId(), projectModule.getName(), projectModule.getType(), projectModule.getVersion(), projectModule.getProject()); -// nature.setModule(deployable); -// projectModule.initialize(deployable); -// //deployable = projectModule.getModule(); -// } -// moduleDelegates.add(projectModule); -// return deployable; -// } -// } catch (Exception e) { -// //Ignore -// } - return null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModuleDelegate(org.eclipse.wst.server.core.IModule) - */ - public ModuleDelegate getModuleDelegate(IModule module) { - for (Iterator iter = moduleDelegates.iterator(); iter.hasNext();) { - ModuleDelegate element = (ModuleDelegate) iter.next(); - if (module == element.getModule()) - return element; - } - return null; - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModules() - */ - public IModule[] getModules() { - if (projects == null || projects.isEmpty()) - cacheModules(); - int i = 0; - Iterator modules = projects.keySet().iterator(); - IModule[] modulesArray = new IModule[projects.size()]; - while (modules.hasNext()) { - IModule[] module = null; - IProject project = (IProject) modules.next(); - module = (IModule[])projects.get(project); - modulesArray[i++] = module[0]; - } - return modulesArray; - - } - - /* (non-Javadoc) - * @see org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate#createModules(org.eclipse.core.resources.IProject) - */ - protected IModule[] createModules(IProject project) { - IModule mod = createModule(project); - if (mod == null) - return new IModule[0]; - return new IModule[] {mod}; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployableObjectAdapter.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployableObjectAdapter.java deleted file mode 100644 index e514f80f2..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployableObjectAdapter.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.wst.web.internal.deployables; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.wst.server.core.IModuleArtifact; -import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate; - -public class StaticWebDeployableObjectAdapter extends ModuleArtifactAdapterDelegate implements IAdapterFactory - -{ - - public StaticWebDeployableObjectAdapter() { - super(); - } - - public Object getAdapter(Object adaptableObject, Class adapterType) { - return null; - } - - public Class[] getAdapterList() { - return new Class[]{IStaticWebModuleArtifact.class}; - } - - public IModuleArtifact getModuleArtifact(Object obj) { - return StaticWebDeployableObjectAdapterUtil.getModuleObject(obj); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployableObjectAdapterUtil.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployableObjectAdapterUtil.java deleted file mode 100644 index e7a98d999..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/deployables/StaticWebDeployableObjectAdapterUtil.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Created on Feb 21, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.wst.web.internal.deployables; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.wst.server.core.IModuleArtifact; - -public class StaticWebDeployableObjectAdapterUtil { - - //private final static String[] extensionsToExclude = new String[]{"sql", "xmi"}; //$NON-NLS-1$ //$NON-NLS-2$ - static String J2EE_NATURE_ID = "org.eclipse.jst.j2ee.web.WebNature"; //$NON-NLS-1$ - static String INFO_DIRECTORY = "WEB-INF"; //$NON-NLS-1$ -// public static IBaseWebNature getRuntime(IProject project) { -// if (project == null) -// return null; -// try { -// IBaseWebNature nature; -// if (project.hasNature(J2EE_NATURE_ID)) -// nature = (IBaseWebNature) project.getNature(J2EE_NATURE_ID); -// else -// nature = (IBaseWebNature) project.getNature("org.eclipse.wst.web.StaticWebNature"); -// return nature; -// } catch (CoreException e) { -// return null; -// } -// } - - public static IModuleArtifact getModuleObject(Object obj) { - IResource resource = null; - if (obj instanceof IResource) - resource = (IResource) obj; - else if (obj instanceof IAdaptable) - resource = (IResource) ((IAdaptable) obj).getAdapter(IResource.class); - if (resource == null) - return null; - return null; - //TODO use components API - // find deployable -// IBaseWebNature webNature = getRuntime(resource.getProject()); -// if (webNature == null || !(webNature instanceof StaticWebNatureRuntime)) -// return null; -// -// if (resource instanceof IProject) -// return new WebResource(getModule(webNature), new Path("")); //$NON-NLS-1$ -// -// // determine path -// IPath rootPath = webNature.getRootPublishableFolder().getProjectRelativePath(); -// IPath resourcePath = resource.getProjectRelativePath(); -// -// // Check to make sure the resource is under the webApplication directory -// if (resourcePath.matchingFirstSegments(rootPath) != rootPath.segmentCount()) -// return null; -// -// // Do not allow resource under the web-inf directory -// resourcePath = resourcePath.removeFirstSegments(rootPath.segmentCount()); -// if (resourcePath.segmentCount() > 1 && resourcePath.segment(0).equals(INFO_DIRECTORY)) -// return null; -// -// if (shouldExclude(resource)) -// return null; -// -// // return Web resource type -// return new WebResource(getModule(webNature), resourcePath); - - } - - /** - * Method shouldExclude. - * - * @param resource - * @return boolean - */ -// private static boolean shouldExclude(IResource resource) { -// String fileExt = resource.getFileExtension(); -// -// // Exclude files of certain extensions -// for (int i = 0; i < extensionsToExclude.length; i++) { -// String extension = extensionsToExclude[i]; -// if (extension.equalsIgnoreCase(fileExt)) -// return true; -// } -// return false; -// } - -// protected static IModule getModule(IBaseWebNature nature) { -// IModule deployable = nature.getModule(); -// if (deployable != null) -// return deployable; -// -// IProject project = nature.getProject(); -// Iterator iterator = Arrays.asList(ServerUtil.getModules("web.static")).iterator(); //$NON-NLS-1$ //$NON-NLS-2$ -// while (iterator.hasNext()) { -// deployable = (IModule) iterator.next(); -// if (deployable != null) { -// if ((deployable).getProject().equals(project)) -// return deployable; -// } -// } -// return null; -// } - - -} diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/ILibModule.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/ILibModule.java deleted file mode 100644 index a8df74739..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/ILibModule.java +++ /dev/null @@ -1,26 +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.internal.operation; - -import org.eclipse.core.resources.IProject; - -//TODO DELETE jsholl -/** - * @deprecated - * - */ -public interface ILibModule { - String getJarName(); - - String getProjectName(); - - String getURI(); - - IProject getProject(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/ISimpleWebModuleCreationDataModelProperties.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/ISimpleWebModuleCreationDataModelProperties.java deleted file mode 100644 index a421c97e6..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/ISimpleWebModuleCreationDataModelProperties.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004, 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.internal.operation; - -import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationProperties; - -public interface ISimpleWebModuleCreationDataModelProperties extends IProjectCreationProperties{ - -} diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/LibModule.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/LibModule.java deleted file mode 100644 index 7227399eb..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/LibModule.java +++ /dev/null @@ -1,73 +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.internal.operation; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.wst.web.internal.ISimpleWebModuleConstants; -import org.eclipse.wst.web.internal.WSTWebPlugin; - -/** - * @deprecated - * - */ -public class LibModule implements ILibModule { - protected static final IPath LIB_PATH = new Path(ISimpleWebModuleConstants.INFO_DIRECTORY).append(ISimpleWebModuleConstants.LIBRARY_DIRECTORY); - - private String jarName; - private String projectName; - - public LibModule(String jarName, String projectName) { - this.jarName = jarName; - this.projectName = projectName; - } - - /* - * @see ILibModule#getJarName() - */ - public String getJarName() { - return jarName; - } - - /* - * @see ILibModule#getProjectName() - */ - public String getProjectName() { - return projectName; - } - - /* - * @see ILibModule#getProject() - */ - public IProject getProject() { - return (IProject) WSTWebPlugin.getWorkspace().getRoot().findMember(projectName); - } - - /** - * @see ILibModule#getURI() - */ - public String getURI() { - return IPath.SEPARATOR + LIB_PATH.append(getJarName()).toString(); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - if (obj == null || !(obj instanceof ILibModule)) { - return false; - } - ILibModule module = (ILibModule) obj; - return getJarName().equals(module.getJarName()) && getProjectName().equals(module.getProjectName()) && getURI().equals(module.getURI()) && getProject().equals(module.getProject()); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/SimpleWebModuleCreationDataModelProvider.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/SimpleWebModuleCreationDataModelProvider.java deleted file mode 100644 index fd3d1b21b..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/SimpleWebModuleCreationDataModelProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004, 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.internal.operation; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; -import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModelProvider; - -public class SimpleWebModuleCreationDataModelProvider extends ProjectCreationDataModelProvider { - - public SimpleWebModuleCreationDataModelProvider() { - super(); - } - - public void init() { - super.init(); - } - - public IDataModelOperation getDefaultOperation() { - return new SimpleWebModuleCreationOperation(getDataModel()); - } - -} diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/SimpleWebModuleCreationOperation.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/SimpleWebModuleCreationOperation.java deleted file mode 100644 index 60f9d887f..000000000 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/operation/SimpleWebModuleCreationOperation.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004, 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.internal.operation; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationOperation; -import org.eclipse.wst.web.internal.ISimpleWebModuleConstants; -import org.eclipse.wst.web.internal.WSTWebPlugin; - -public class SimpleWebModuleCreationOperation extends ProjectCreationOperation implements ISimpleWebModuleCreationDataModelProperties { - - public SimpleWebModuleCreationOperation(IDataModel dataModel) { - super(dataModel); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - IStatus status = super.execute(monitor, info); - - IProject project = (IProject) model.getProperty(PROJECT); - IFolder webContentFolder = project.getFolder(getWebContentFolderPreference()); - try { - if (!webContentFolder.exists()) - webContentFolder.create(true, true, null); - - IFolder cssFolder = project.getFolder(webContentFolder.getProjectRelativePath().append(ISimpleWebModuleConstants.CSS_DIRECTORY)); - - if (!cssFolder.exists()) - cssFolder.create(true, true, null); - } catch (CoreException e) { - e.printStackTrace(); - } - if (monitor.isCanceled()) - throw new OperationCanceledException(); - return status; - } - - private String getWebContentFolderPreference() { - // TODO implement - String webContentFolder = WSTWebPlugin.getDefault().getWSTWebPreferences().getStaticWebContentFolderName(); - return webContentFolder; - } -} |