diff options
author | cbridgha | 2006-05-12 15:12:00 +0000 |
---|---|---|
committer | cbridgha | 2006-05-12 15:12:00 +0000 |
commit | 41a9040fb7930a17621ceacf48fb738fd7033a5d (patch) | |
tree | f49a1b85bc8fe56b203ff6e17bd4f8fc7f3ea824 /plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration | |
parent | cf4675a4563daa64f5f6b16da2ec499258af474b (diff) | |
download | webtools.javaee-20060512_N.tar.gz webtools.javaee-20060512_N.tar.xz webtools.javaee-20060512_N.zip |
This commit was manufactured by cvs2svn to create tag 'v20060512_N'.v20060512_N
Diffstat (limited to 'plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration')
10 files changed, 0 insertions, 1269 deletions
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/IJavaProjectCreationProperties.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/IJavaProjectCreationProperties.java deleted file mode 100644 index fcd86cf5b..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/IJavaProjectCreationProperties.java +++ /dev/null @@ -1,46 +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.jst.common.jdt.internal.integration; - -import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties; -import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; -import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationProperties; - -/** - * This has been slated for removal post WTP 1.5. Do not use this class/interface - * - * @deprecated - * - * @see IJavaFacetInstallDataModelProperties - */ -public interface IJavaProjectCreationProperties extends IProjectCreationProperties, DoNotUseMeThisWillBeDeletedPost15 { - - /** - * Optional, type String []. These names are relative. - */ - public static final String SOURCE_FOLDERS = "JavaProjectCreationDataModel.SOURCE_FOLDERS"; //$NON-NLS-1$ - /** - * Optional, type Boolean default is True - */ - public static final String CREATE_SOURCE_FOLDERS = "JavaProjectCreationDataModel.CREATE_SOURCE_FOLDERS"; //$NON-NLS-1$ - - - /** - * Optional, type IClasspathEntry[] - */ - public static final String CLASSPATH_ENTRIES = "JavaProjectCreationDataModel.CLASSPATH_ENTRIES"; //$NON-NLS-1$ - - /** - * Optional, type String - */ - public static final String OUTPUT_LOCATION = "JavaProjectCreationDataModel.OUTPUT_LOCATION"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModel.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModel.java deleted file mode 100644 index 19e360d32..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModel.java +++ /dev/null @@ -1,217 +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.jst.common.jdt.internal.integration; - -import java.util.Set; - -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel; -import org.eclipse.wst.common.frameworks.internal.SaveFailedException; -import org.eclipse.wst.common.internal.emf.resource.CompatibilityXMIResource; -import org.eclipse.wst.common.internal.emf.resource.ReferencedResource; -import org.eclipse.wst.common.internal.emf.resource.TranslatorResource; -import org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext; - -public class JavaArtifactEditModel extends ArtifactEditModel implements WorkingCopyProvider { - - private WorkingCopyManager workingCopyManager = null; - - /** - * @param anEditModelId - * @param aContext - * @param toMakeReadOnly - * @param toAccessUnknownResourcesAsReadOnly - * @param aModuleURI - */ - public JavaArtifactEditModel(String anEditModelId, EMFWorkbenchContext aContext, boolean toMakeReadOnly, boolean toAccessUnknownResourcesAsReadOnly, URI aModuleURI) { - super(anEditModelId, aContext, toMakeReadOnly, - toAccessUnknownResourcesAsReadOnly, aModuleURI); - // TODO Auto-generated constructor stub - } - - /** - * @param anEditModelId - * @param aContext - * @param toMakeReadOnly - * @param aModuleURI - */ - public JavaArtifactEditModel(String anEditModelId, EMFWorkbenchContext aContext, boolean toMakeReadOnly, URI aModuleURI) { - super(anEditModelId, aContext, toMakeReadOnly, aModuleURI); - // TODO Auto-generated constructor stub - } - - /** - * This will delete - * - * @cu from the workbench and fix the internal references for this working copy manager. - */ - public void delete(org.eclipse.jdt.core.ICompilationUnit cu, org.eclipse.core.runtime.IProgressMonitor monitor) { - getWorkingCopyManager().delete(cu, monitor); - } - - /** - * This method should only be called by the J2EENature. - */ - public void dispose() { - super.dispose(); - resetWorkingCopyManager(); - } - - public Set getAffectedFiles() { - java.util.Set affected = super.getAffectedFiles(); - if (getWorkingCopyManager() != null) - affected.addAll(getWorkingCopyManager().getAffectedFiles()); - - return affected; - } - - /** - * Returns the working copy remembered for the compilation unit encoded in the given editor - * input. Does not connect the edit model to the working copy. - * - * @param input - * ICompilationUnit - * @return the working copy of the compilation unit, or <code>null</code> if the input does - * not encode an editor input, or if there is no remembered working copy for this - * compilation unit - */ - public org.eclipse.jdt.core.ICompilationUnit getExistingWorkingCopy(org.eclipse.jdt.core.ICompilationUnit cu) throws org.eclipse.core.runtime.CoreException { - return getWorkingCopyManager().getExistingWorkingCopy(cu); - } - - /** - * Returns the working copy remembered for the compilation unit. - * - * @param input - * ICompilationUnit - * @return the working copy of the compilation unit, or <code>null</code> if there is no - * remembered working copy for this compilation unit - */ - public org.eclipse.jdt.core.ICompilationUnit getWorkingCopy(ICompilationUnit cu, boolean forNewCU) throws CoreException { - return getWorkingCopyManager().getWorkingCopy(cu, forNewCU); - } - - /** - * Save the new compilation units only. - */ - protected void handleSaveIfNecessaryDidNotSave(IProgressMonitor monitor) { - getWorkingCopyManager().saveOnlyNewCompilationUnits(monitor); - } - - /** - * @see org.eclipse.jst.j2ee.internal.internal.workbench.J2EEEditModel#isDirty() - */ - public boolean isDirty() { - boolean dirtyBool = super.isDirty(); - if (!dirtyBool && getWorkingCopyManager() != null) - dirtyBool = getWorkingCopyManager().hasWorkingCopies(); - return dirtyBool; - } - - /** - * This will force all of the referenced Resources to be saved. - */ - public void primSave(IProgressMonitor monitor) { - saveCompilationUnits(monitor); - if (monitor == null || !monitor.isCanceled()) - super.primSave(monitor); - } - protected void runSaveOperation(IWorkspaceRunnable runnable, IProgressMonitor monitor) throws SaveFailedException { - try { - ResourcesPlugin.getWorkspace().run(runnable, null,IWorkspace.AVOID_UPDATE,monitor); - } catch (CoreException e) { - throw new SaveFailedException(e); - } - } - - /** - * Insert the method's description here. Creation date: (4/11/2001 4:14:26 PM) - * - * @return java.util.Set - */ - public void processResource(Resource aResource) { - if (aResource != null && !getResources().contains(aResource)) { - if (aResource instanceof ReferencedResource) { - access((ReferencedResource) aResource); - //We need a better way to pass this through the save options instead. - //We also need to make this dynamic based on the project target - ((ReferencedResource) aResource).setFormat(CompatibilityXMIResource.FORMAT_MOF5); - } else if (!isReadOnly()) - aResource.setTrackingModification(true); - addResource(aResource); - } - } - - /** - * Release each of the referenced resources. - */ - protected void release(Resource aResource) { - - removeResource(aResource); - if (aResource != null) { - boolean isRefRes = aResource instanceof ReferencedResource; - if (isRefRes) - release((ReferencedResource) aResource); - if (!isDisposing()) - resetWorkingCopyManager(); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.workbench.J2EEEditModel#resourceIsLoadedChanged(org.eclipse.emf.ecore.resource.Resource, - * boolean, boolean) - */ - protected void resourceIsLoadedChanged(Resource aResource, boolean oldValue, boolean newValue) { - if (!isReverting && !disposing && !isReadOnly() && oldValue && !newValue && aResource instanceof TranslatorResource) - resetWorkingCopyManager(); - super.resourceIsLoadedChanged(aResource, oldValue, newValue); - } - - protected void reverted(ReferencedResource revertedResource) { - if (getWorkingCopyManager() != null) - getWorkingCopyManager().revert(); - revertAllResources(); - } - - /** - * This will save all of the referenced CompilationUnits to be saved. - */ - public void saveCompilationUnits(IProgressMonitor monitor) { - getWorkingCopyManager().saveCompilationUnits(monitor); - } - - public WorkingCopyManager getWorkingCopyManager() { - if (workingCopyManager == null) - workingCopyManager = WorkingCopyManagerFactory.newRegisteredInstance(); - return workingCopyManager; - } - - /** - * Reset the working copy manager because the ejb-jar.xml was removed without disposing. - */ - protected void resetWorkingCopyManager() { - if (workingCopyManager != null) { - workingCopyManager.dispose(); - workingCopyManager = null; - } - } - - -} diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModelFactory.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModelFactory.java deleted file mode 100644 index 892b2ab56..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaArtifactEditModelFactory.java +++ /dev/null @@ -1,63 +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.jst.common.jdt.internal.integration; - -import java.util.Map; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext; -import org.eclipse.wst.common.internal.emfworkbench.integration.EditModel; -import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory; - -/** - * <p> - * The following class is experimental until fully documented. - * </p> - */ -public class JavaArtifactEditModelFactory extends EditModelFactory { - - public static final String MODULE_EDIT_MODEL_ID = "org.eclipse.jst.modulecore.editModel"; //$NON-NLS-1$ - - public static final String PARAM_MODULE_URI = "MODULE_URI"; //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory#createEditModelForRead(java.lang.String, org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext, java.util.Map) - */ - public EditModel createEditModelForRead(String editModelID, EMFWorkbenchContext context, Map params) { - URI moduleURI = (URI) ((params != null) ? params.get(PARAM_MODULE_URI) : null); - if(moduleURI == null) - throw new IllegalStateException("A Module URI must be provided"); //$NON-NLS-1$ - - return new JavaArtifactEditModel(editModelID, context, true, moduleURI); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory#createEditModelForWrite(java.lang.String, org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext, java.util.Map) - */ - public EditModel createEditModelForWrite(String editModelID, EMFWorkbenchContext context, Map params) { - URI moduleURI = (URI) ((params != null) ? params.get(PARAM_MODULE_URI) : null); - if(moduleURI == null) - throw new IllegalStateException("A Module URI must be provided"); //$NON-NLS-1$ - return new JavaArtifactEditModel(editModelID, context, false,false, moduleURI); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory#getCacheID(java.lang.String, java.util.Map) - */ - public String getCacheID(String editModelID, Map params) { - URI moduleURI = (URI)params.get(PARAM_MODULE_URI); - if(moduleURI != null) - return editModelID+":"+moduleURI.toString(); //$NON-NLS-1$ - return editModelID+":NOURI"; //$NON-NLS-1$ - } - - -} diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationDataModelProvider.java deleted file mode 100644 index dca114848..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationDataModelProvider.java +++ /dev/null @@ -1,57 +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.jst.common.jdt.internal.integration; - -import java.util.Set; - -import org.eclipse.jst.common.project.facet.JavaProjectFacetCreationDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; -import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; -import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModelProvider; - -/** - * This has been slated for removal post WTP 1.5. Do not use this class/interface - * - * @deprecated - * - * @see JavaProjectFacetCreationDataModelProvider - */ -public class JavaProjectCreationDataModelProvider extends ProjectCreationDataModelProvider implements IJavaProjectCreationProperties, DoNotUseMeThisWillBeDeletedPost15 { - - - public Set getPropertyNames() { - Set propertyNames = super.getPropertyNames(); - propertyNames.add(OUTPUT_LOCATION); - propertyNames.add(SOURCE_FOLDERS); - propertyNames.add(CLASSPATH_ENTRIES); - propertyNames.add(CREATE_SOURCE_FOLDERS); - return propertyNames; - } - - public IDataModelOperation getDefaultOperation() { - return new JavaProjectCreationOperation(model); - } - - public Object getDefaultProperty(String propertyName) { - // TODO pull these from the java preferences - if (propertyName.equals(OUTPUT_LOCATION)) { - return "bin"; //$NON-NLS-1$ - } - if (propertyName.equals(SOURCE_FOLDERS)) { - return new String[0]; - } - if (propertyName.equals(CREATE_SOURCE_FOLDERS)) - return Boolean.TRUE; - return null; - } - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationOperation.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationOperation.java deleted file mode 100644 index 3a5b5663f..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectCreationOperation.java +++ /dev/null @@ -1,122 +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 - *******************************************************************************/ -/* - * Created on Nov 4, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.common.jdt.internal.integration; - -import java.util.ArrayList; - -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.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jst.common.project.facet.JavaProjectFacetCreationDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15; -import org.eclipse.wst.common.frameworks.internal.WTPProjectUtilities; -import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationProperties; -import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationOperation; - -/** - * This has been slated for removal post WTP 1.5. Do not use this class/interface - * - * @deprecated - * - * @see JavaProjectFacetCreationDataModelProvider - */ -public class JavaProjectCreationOperation extends ProjectCreationOperation implements DoNotUseMeThisWillBeDeletedPost15 { - - public JavaProjectCreationOperation(IDataModel dataModel) { - super(dataModel); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - super.execute(monitor, info); - try { - createJavaProject(monitor); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return OK_STATUS; - } - - private void createJavaProject(IProgressMonitor monitor) throws CoreException { - IProject project = (IProject) model.getProperty(IProjectCreationProperties.PROJECT); - WTPProjectUtilities.addNatureToProjectLast(project, JavaCore.NATURE_ID); - IJavaProject javaProject = JavaCore.create(project); - javaProject.setOutputLocation(getOutputPath(project), monitor); - javaProject.setRawClasspath(getClasspathEntries(project), monitor); - if (model.getBooleanProperty(IJavaProjectCreationProperties.CREATE_SOURCE_FOLDERS)) { - String[] sourceFolders = (String[]) model.getProperty(IJavaProjectCreationProperties.SOURCE_FOLDERS); - IFolder folder = null; - for (int i = 0; i < sourceFolders.length; i++) { - folder = project.getFolder(sourceFolders[i]); - folder.create(true, true, monitor); - } - } - } - - private IPath getOutputPath(IProject project) { - String outputLocation = model.getStringProperty(IJavaProjectCreationProperties.OUTPUT_LOCATION); - return project.getFullPath().append(outputLocation); - } - - private IClasspathEntry[] getClasspathEntries(IProject project) { - IClasspathEntry[] entries = (IClasspathEntry[]) model.getProperty(IJavaProjectCreationProperties.CLASSPATH_ENTRIES); - IClasspathEntry[] sourceEntries = null; - if (model.getBooleanProperty(IJavaProjectCreationProperties.CREATE_SOURCE_FOLDERS)) - sourceEntries = getSourceClasspathEntries(project); - return combineArrays(sourceEntries, entries); - } - - private IClasspathEntry[] getSourceClasspathEntries(IProject project) { - String[] sourceFolders = (String[]) model.getProperty(IJavaProjectCreationProperties.SOURCE_FOLDERS); - ArrayList list = new ArrayList(); - for (int i = 0; i < sourceFolders.length; i++) { - list.add(JavaCore.newSourceEntry(project.getFullPath().append(sourceFolders[i]))); - } - IClasspathEntry[] classpath = new IClasspathEntry[list.size()]; - for (int i = 0; i < classpath.length; i++) { - classpath[i] = (IClasspathEntry) list.get(i); - } - return classpath; - } - - private IClasspathEntry[] combineArrays(IClasspathEntry[] sourceEntries, IClasspathEntry[] entries) { - if (sourceEntries != null) { - if (entries == null) - return sourceEntries; - return doCombineArrays(sourceEntries, entries); - } else if (entries != null) - return entries; - return new IClasspathEntry[0]; - } - - private IClasspathEntry[] doCombineArrays(IClasspathEntry[] sourceEntries, IClasspathEntry[] entries) { - IClasspathEntry[] result = new IClasspathEntry[sourceEntries.length + entries.length]; - System.arraycopy(sourceEntries, 0, result, 0, sourceEntries.length); - System.arraycopy(entries, 0, result, sourceEntries.length, entries.length); - return result; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectValidationHandler.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectValidationHandler.java deleted file mode 100644 index cf2c3902a..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/JavaProjectValidationHandler.java +++ /dev/null @@ -1,56 +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.jst.common.jdt.internal.integration; - -import org.eclipse.core.resources.IResource; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.wst.validation.internal.IValidationSelectionHandler; - - -/** - * Java Project validation - */ -public class JavaProjectValidationHandler implements IValidationSelectionHandler { - - private String validationType = null; - - /** - * Default constructor - */ - public JavaProjectValidationHandler() { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.internal.IValidationSelectionHandler#getBaseValidationType(java.lang.Object) - */ - public IResource getBaseValidationType(Object selection) { - if (selection instanceof IJavaProject) - return ((IJavaProject)selection).getProject(); - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.internal.IValidationSelectionHandler#getValidationTypeString() - */ - public String getValidationTypeString() { - return validationType; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.internal.IValidationSelectionHandler#setValidationTypeString(java.lang.String) - */ - public void setValidationTypeString(String validationType) { - this.validationType = validationType; - } - -} diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WTPWorkingCopyManager.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WTPWorkingCopyManager.java deleted file mode 100644 index fa74accfb..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WTPWorkingCopyManager.java +++ /dev/null @@ -1,542 +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.jst.common.jdt.internal.integration; - - - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.wst.common.frameworks.internal.ISaveHandler; -import org.eclipse.wst.common.frameworks.internal.SaveFailedException; -import org.eclipse.wst.common.frameworks.internal.SaveHandlerHeadless; -import org.eclipse.wst.common.frameworks.internal.SaveHandlerRegister; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; - -/** - * Insert the type's description here. Creation date: (4/27/2001 4:14:30 PM) - * - * @author: Administrator - */ -public class WTPWorkingCopyManager implements WorkingCopyManager { - - //New CUs that will need to be deleted upon dispose - private List originalNewCompilationUnits; - //New CUs that were created that need saved immediately (after each gen) - private List needsSavingCompilationUnits; - //A complete list of new CUs that is only cleared on save and dispose - private List newCompilationUnits; - private HashMap deletedCompilationUnits; - protected static final Class IRESOURCE_CLASS = IResource.class; - - /** - * WTPWorkingCopyManager constructor comment. - */ - public WTPWorkingCopyManager() { - super(); - } - - protected void addDeletedCompilationUnit(ICompilationUnit cu) { - getNeedsSavingCompilationUnits().remove(cu); - if (!getOriginalNewCompilationUnits().contains(cu) && !getDeletedCompilationUnits().containsKey(cu)) - primAddDeletedCompilationUnit(cu); - getOriginalNewCompilationUnits().remove(cu); - } - - protected void addNewCompilationUnit(ICompilationUnit cu, ICompilationUnit workingCopy) { - getNewCompilationUnits().add(cu); - getNeedsSavingCompilationUnits().add(workingCopy); - if (!getDeletedCompilationUnits().containsKey(cu)) - getOriginalNewCompilationUnits().add(cu); - } - - /** - * This will save all of the new CompilationUnits to be saved. - */ - protected void commitWorkingCopy(ICompilationUnit wc, IProgressMonitor monitor) { - try { - try { - wc.commitWorkingCopy(false, monitor); - } catch (JavaModelException e) { - if (isFailedWriteFileFailure(e) && shouldSaveReadOnly(wc)) - wc.commitWorkingCopy(false, monitor); - else - throw e; - } - } catch (JavaModelException e) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e); - throw new SaveFailedException(e); - } finally { - try { - wc.discardWorkingCopy(); - } catch (JavaModelException e1) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e1); - throw new SaveFailedException(e1); - } - } - } - - /** - * This will delete - * - * @cu from the workbench and fix the internal references for this working copy manager. - */ - public void delete(ICompilationUnit cu, IProgressMonitor monitor) { - if (cu.isWorkingCopy()) - cu = cu.getPrimary(); - addDeletedCompilationUnit(cu); - try { - cu.delete(false, monitor); - } catch (JavaModelException e) { - if (e.getStatus().getCode() != org.eclipse.jdt.core.IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST) - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e); - } - } - - protected void discardOriginalNewCompilationUnits() { - if (getOriginalNewCompilationUnits().isEmpty()) - return; - List cus = getOriginalNewCompilationUnits(); - ICompilationUnit cu; - ICompilationUnit wc = null; - for (int i = 0; i < cus.size(); i++) { - cu = (ICompilationUnit) cus.get(i); - if (cu.isWorkingCopy()) { - wc = cu; - cu = wc.getPrimary(); - } - primDelete(cu); - if (wc != null) - try { - wc.discardWorkingCopy(); - } catch (JavaModelException e) { - Logger.getLogger().logError(e); - } - } - } - - public void dispose() { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor aMonitor) { - primDispose(); - } - }; - try { - if (!WTPCommonPlugin.getWorkspace().isTreeLocked()) { - WTPCommonPlugin.getWorkspace().run(runnable,null, IWorkspace.AVOID_UPDATE,null); - } else { - runnable.run(null); - } - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - //runOperation(runnable, null, true); - } - - public void revert() { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor aMonitor) { - primRevert(); - } - }; - runOperation(runnable, null, true); - } - - public Set getAffectedFiles() { - return Collections.EMPTY_SET; - } - - /** - * Insert the method's description here. Creation date: (7/11/2001 6:43:37 PM) - * - * @return java.util.HashMap - */ - protected HashMap getDeletedCompilationUnits() { - if (deletedCompilationUnits == null) - deletedCompilationUnits = new HashMap(); - return deletedCompilationUnits; - } - - /** - * Returns the working copy remembered for the compilation unit encoded in the given editor - * input. Does not connect the edit model to the working copy. - * - * @param input - * ICompilationUnit - * @return the working copy of the compilation unit, or <code>null</code> if the input does - * not encode an editor input, or if there is no remembered working copy for this - * compilation unit - */ - public org.eclipse.jdt.core.ICompilationUnit getExistingWorkingCopy(ICompilationUnit cu) throws CoreException { - ICompilationUnit newCU = getNewCompilationUnitWorkingCopy(cu); - if (newCU != null) - return newCU; - return null; - } - - /** - * Insert the method's description here. Creation date: (7/19/2001 11:00:19 AM) - * - * @return java.util.List - */ - protected java.util.List getNeedsSavingCompilationUnits() { - if (needsSavingCompilationUnits == null) - needsSavingCompilationUnits = new ArrayList(); - return needsSavingCompilationUnits; - } - - /** - * Insert the method's description here. Creation date: (4/26/2001 3:49:05 PM) - * - * @return java.util.List - */ - protected java.util.List getNewCompilationUnits() { - if (newCompilationUnits == null) - newCompilationUnits = new ArrayList(); - return newCompilationUnits; - } - - /** - * It is possible that we have already created this CompilationUnit and its working copy. If - * this is the case, return our new working copy and do not create a new one. - */ - protected ICompilationUnit getNewCompilationUnitWorkingCopy(ICompilationUnit cu) { - if (hasNewCompilationUnit(cu)) { - List list = getNeedsSavingCompilationUnits(); - ICompilationUnit copy; - for (int i = 0; i < list.size(); i++) { - copy = (ICompilationUnit) list.get(i); - if (cu.equals(copy.getPrimary())) - return copy; - } - } - return null; - } - - /** - * Insert the method's description here. Creation date: (4/26/2001 3:49:05 PM) - * - * @return java.util.List - */ - protected java.util.List getOriginalNewCompilationUnits() { - if (originalNewCompilationUnits == null) - originalNewCompilationUnits = new ArrayList(); - return originalNewCompilationUnits; - } - - /** - * Return the IPackageFragment for the given ICompilationUnit. - */ - protected IPackageFragment getPackageFragment(ICompilationUnit cu) { - if (cu == null) - return null; - IJavaElement parent = cu; - int elementType = cu.getElementType(); - while (parent != null && elementType != IJavaElement.PACKAGE_FRAGMENT) { - parent = parent.getParent(); - if (parent != null) - elementType = parent.getElementType(); - else - elementType = -1; - } - return (IPackageFragment) parent; - } - - protected ISaveHandler getSaveHandler() { - return SaveHandlerRegister.getSaveHandler(); - } - - /** - * Returns the working copy remembered for the compilation unit. - * - * @param input - * ICompilationUnit - * @return the working copy of the compilation unit, or <code>null</code> if there is no - * remembered working copy for this compilation unit - */ - public ICompilationUnit getWorkingCopy(ICompilationUnit cu, boolean forNewCU) throws org.eclipse.core.runtime.CoreException { - if (cu == null || cu.isWorkingCopy()) - return cu; - ICompilationUnit newCU = getNewCompilationUnitWorkingCopy(cu); - if (newCU != null) - return newCU; - ICompilationUnit workingCopy = cu.getWorkingCopy(null); - addNewCompilationUnit(cu, workingCopy); - return workingCopy; - } - - /** - * Has a new compilation unit already been created. - */ - protected boolean hasNewCompilationUnit(ICompilationUnit cu) { - return getNewCompilationUnits().contains(cu); - } - - protected boolean isFailedWriteFileFailure(Exception ex) { - return SaveHandlerHeadless.isFailedWriteFileFailure(ex); - } - - protected void primAddDeletedCompilationUnit(ICompilationUnit cu) { - if (cu == null) - return; - Object[] info = new Object[2]; - info[0] = getPackageFragment(cu); - try { - info[1] = cu.getSource(); - } catch (JavaModelException e) { - info[1] = null; - } - getDeletedCompilationUnits().put(cu, info); - } - - // This is an internal delete call. - protected void primDelete(ICompilationUnit cu) { - try { - if (cu.exists()) - cu.delete(true, new org.eclipse.core.runtime.NullProgressMonitor()); - } catch (JavaModelException e) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e); - //What to do here? - } - } - - protected void primDispose() { - discardOriginalNewCompilationUnits(); - reviveDeletedCompilationUnits(); - newCompilationUnits = null; - needsSavingCompilationUnits = null; - originalNewCompilationUnits = null; - deletedCompilationUnits = null; - } - - protected void primRevert() { - discardOriginalNewCompilationUnits(); - reviveDeletedCompilationUnits(); - newCompilationUnits = null; - needsSavingCompilationUnits = null; - originalNewCompilationUnits = null; - deletedCompilationUnits = null; - } - - /** - * Returns the working copy remembered for the compilation unit encoded in the given editor - * input. - * - * @param input - * ICompilationUnit - * @return the working copy of the compilation unit, or <code>null</code> if the input does - * not encode an editor input, or if there is no remembered working copy for this - * compilation unit - */ - protected ICompilationUnit primGetWorkingCopy(ICompilationUnit cu) throws CoreException { - return null; - } - - /** - * This will save all of the referenced CompilationUnits to be saved. - */ - protected void primSaveCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) { - saveNewCompilationUnits(monitor); - getDeletedCompilationUnits().clear(); - } - - /** - * This will save all of the new CompilationUnits to be saved. - */ - protected void primSaveOnlyNewCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) { - List cus = getNeedsSavingCompilationUnits(); - ICompilationUnit wc; - for (int i = 0; i < cus.size(); i++) { - wc = (ICompilationUnit) cus.get(i); - commitWorkingCopy(wc, monitor); - } - cus.clear(); - } - - protected void removeDeletedCompilationUnit(ICompilationUnit cu) { - if (getDeletedCompilationUnits().remove(cu) != null) { - if (cu.isWorkingCopy()) { - ICompilationUnit original, nextCU, testCU; - original = cu.getPrimary(); - Set cus = getDeletedCompilationUnits().keySet(); - Iterator it = cus.iterator(); - while (it.hasNext()) { - nextCU = (ICompilationUnit) it.next(); - testCU = nextCU.isWorkingCopy() ? (ICompilationUnit) nextCU.getPrimary() : nextCU; - if (testCU.equals(original)) { - cus.remove(nextCU); - return; - } - } - } - } - } - - protected void reviveDeletedCompilationUnit(ICompilationUnit cu, Object[] info, IProgressMonitor pm) { - if (info[0] != null && info[1] != null) { - String typeName = cu.getElementName(); - IPackageFragment pack = (IPackageFragment) info[0]; - String source = (String) info[1]; - try { - ICompilationUnit existingCU = pack.getCompilationUnit(typeName); - if (existingCU.exists() && getNewCompilationUnits().contains(existingCU)) - existingCU.delete(false, pm); - pack.createCompilationUnit(typeName, source, false, pm); - } catch (JavaModelException e) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e); - } - } - } - - protected void reviveDeletedCompilationUnits() { - if (getDeletedCompilationUnits().isEmpty()) - return; - IProgressMonitor pm = new org.eclipse.core.runtime.NullProgressMonitor(); - Iterator it = getDeletedCompilationUnits().entrySet().iterator(); - Map.Entry entry; - ICompilationUnit cu; - Object[] info; - while (it.hasNext()) { - entry = (Map.Entry) it.next(); - cu = (ICompilationUnit) entry.getKey(); - info = (Object[]) entry.getValue(); - reviveDeletedCompilationUnit(cu, info, pm); - } - - } - - protected void runOperation(IWorkspaceRunnable aRunnable, IProgressMonitor monitor, boolean validate) { - primRunOperation(aRunnable, monitor); - - // TODO Break the validator depedency - // if (validate) - // primRunOperation(aRunnable, monitor); - // else { - // IProject proj = getValidationProject(); - // - // ValidatorManager mgr = ValidatorManager.getManager(); - // boolean disableValidators = proj != null; - // boolean wasSuspended = false; - // if (disableValidators) { - // wasSuspended = mgr.isSuspended(proj); - // if (!wasSuspended) - // mgr.suspendValidation(proj, true); - // } - // try { - // primRunOperation(aRunnable, monitor); - // } finally { - // if (disableValidators && !wasSuspended) - // mgr.suspendValidation(proj, false); - // } - // } - } - - protected void primRunOperation(IWorkspaceRunnable aRunnable, IProgressMonitor monitor) { - - if (aRunnable != null) { - //if (workspace.isTreeLocked()) - //Logger.getLogger().logTrace(ResourceHandler.getString("Cannot_run_J2EEUIWorkingCo_ERROR_")); - // //$NON-NLS-1$ = "Cannot run J2EEUIWorkingCopyManager operation because the Workspace - // tree is locked." - //else { - if (!WTPCommonPlugin.getWorkspace().isTreeLocked()) { - try { - WTPCommonPlugin.getWorkspace().run(aRunnable, monitor); - } catch (CoreException e) { - throw new SaveFailedException(e); - } - } - } - } - - /** - * This will save all of the referenced CompilationUnits to be saved. - */ - public void saveCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) { - getSaveHandler().access(); - try { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor aMonitor) { - primSaveCompilationUnits(aMonitor); - } - }; - runOperation(runnable, monitor, true); - } catch (SaveFailedException ex) { - getSaveHandler().handleSaveFailed(ex, monitor); - } finally { - getSaveHandler().release(); - } - } - - /** - * This will save all of the referenced CompilationUnits to be saved. - */ - protected void saveNewCompilationUnits(IProgressMonitor monitor) { - primSaveOnlyNewCompilationUnits(monitor); - getOriginalNewCompilationUnits().clear(); - getNewCompilationUnits().clear(); - } - - /** - * This will save all of the new CompilationUnits to be saved. - */ - public void saveOnlyNewCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) { - getSaveHandler().access(); - try { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor aMonitor) { - primSaveOnlyNewCompilationUnits(aMonitor); - } - }; - runOperation(runnable, monitor, false); - } catch (SaveFailedException ex) { - getSaveHandler().handleSaveFailed(ex, monitor); - } finally { - getSaveHandler().release(); - } - } - - protected boolean shouldSaveReadOnly(ICompilationUnit wc) { - IResource resource = null; - - resource = (IResource) wc.getPrimary().getAdapter(IRESOURCE_CLASS); - - if (resource == null || resource.getType() != IResource.FILE || !resource.getResourceAttributes().isReadOnly()) - return false; - - return getSaveHandler().shouldContinueAndMakeFileEditable((IFile) resource); - } - - /** - * @see com.ibm.etools.j2ee.workbench.IJ2EEWorkingCopyManager#hasWorkingCopies() - */ - public boolean hasWorkingCopies() { - return (deletedCompilationUnits != null && !deletedCompilationUnits.isEmpty()) || (needsSavingCompilationUnits != null && !needsSavingCompilationUnits.isEmpty()) || (newCompilationUnits != null && !newCompilationUnits.isEmpty()); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManager.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManager.java deleted file mode 100644 index 35ccc89fb..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManager.java +++ /dev/null @@ -1,49 +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.jst.common.jdt.internal.integration; - -import org.eclipse.core.runtime.IProgressMonitor; - - -/** - * @author Administrator - * - * - */ -public interface WorkingCopyManager extends WorkingCopyProvider { - - void dispose(); - - java.util.Set getAffectedFiles(); - - /** - * This will save all of the referenced CompilationUnits to be saved. - */ - void saveCompilationUnits(IProgressMonitor monitor); - - /** - * This will save all of the new CompilationUnits to be saved. - */ - void saveOnlyNewCompilationUnits(IProgressMonitor monitor); - - /** - * Method hasWorkingCopies. - * - * @return boolean - */ - boolean hasWorkingCopies(); - - /** - * Revert all working copies. - */ - void revert(); - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManagerFactory.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManagerFactory.java deleted file mode 100644 index 3e98f8a88..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyManagerFactory.java +++ /dev/null @@ -1,57 +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.jst.common.jdt.internal.integration; - -import org.eclipse.jem.util.UIContextDetermination; - - -/** - * @author mdelder - * - * - */ -public class WorkingCopyManagerFactory { - - // protected static Class workingCopyManagerClass; - - public static WorkingCopyManager newRegisteredInstance() { - return (WorkingCopyManager) UIContextDetermination.createInstance("workingCopyManager"); //$NON-NLS-1$ - } - - // public static IWorkingCopyManager createWorkingCopyManager() { - // if (getWorkingCopyManagerClass() != null) - // try { - // return (IWorkingCopyManager) getWorkingCopyManagerClass().newInstance(); - // } catch (InstantiationException e1) { - // } catch (IllegalAccessException e2) { - // } - // return null; - // } - // - // /** - // * Insert the method's description here. - // * Creation date: (4/26/2001 7:53:15 AM) - // * @return java.lang.Class - // */ - // public static java.lang.Class getWorkingCopyManagerClass() { - // return workingCopyManagerClass; - // } - // - // /** - // * Insert the method's description here. - // * Creation date: (4/26/2001 7:53:15 AM) - // * @param newWorkingCopyManagerClass java.lang.Class - // */ - // public static void setWorkingCopyManagerClass(java.lang.Class newWorkingCopyManagerClass) { - // workingCopyManagerClass = newWorkingCopyManagerClass; - // } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyProvider.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyProvider.java deleted file mode 100644 index 2696f5c54..000000000 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/jdt/internal/integration/WorkingCopyProvider.java +++ /dev/null @@ -1,60 +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.jst.common.jdt.internal.integration; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jdt.core.ICompilationUnit; - - -/** - * The user of the Java code generation framework must supply an implementation of this interface. - * The framework will obtain compilation working copies from this interface. The supplier of the - * implementation is responsible for committing the working copies when appropriate for the user's - * edit model. - */ -public interface WorkingCopyProvider { - - /** - * This will delete compilation unit from the workbench and fix the internal references for this - * working copy manager. - * - * @param cu - * the compilation unit to delete - * @param monitor - * the progress monitor to use for the delete - */ - void delete(ICompilationUnit cu, IProgressMonitor monitor); - - /** - * Returns the working copy remembered for the compilation unit. That is, the manager already - * has a working copy for this unit, it does not create a new working copy. Does not connect the - * edit model to the working copy. - * - * @param input - * the compilation unit - * @return the working copy of the compilation unit, or <code>null</code> it there is no - * remembered working copy for this compilation unit - */ - ICompilationUnit getExistingWorkingCopy(ICompilationUnit cu) throws CoreException; - - /** - * Returns the working copy remembered for the compilation unit or creates a new working copy - * for the compilation unit and returns it. If a working copy is passed in, it is returned. - * - * @param input - * the compilation unit - * @return the working copy of the compilation unit - * @exception CoreException - * if the working copy can not be created - */ - ICompilationUnit getWorkingCopy(ICompilationUnit cu, boolean forNewCU) throws CoreException; -}
\ No newline at end of file |