Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 167600 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/wsdm/tooling/util/internal/Validation.java (-2 / +21 lines)
Lines 20-25 Link Here
20
import org.eclipse.core.resources.IResource;
20
import org.eclipse.core.resources.IResource;
21
import org.eclipse.core.resources.IWorkspaceRoot;
21
import org.eclipse.core.resources.IWorkspaceRoot;
22
import org.eclipse.core.resources.ResourcesPlugin;
22
import org.eclipse.core.resources.ResourcesPlugin;
23
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.Path;
24
import org.eclipse.core.runtime.Path;
24
import org.eclipse.tptp.wsdm.tooling.nls.messages.capability.internal.Messages;
25
import org.eclipse.tptp.wsdm.tooling.nls.messages.capability.internal.Messages;
25
26
Lines 129-134 Link Here
129
130
130
	/**
131
	/**
131
	 * Is file already exists inside container.
132
	 * Is file already exists inside container.
133
	 * Comparison is done case insensitively.
132
	 */
134
	 */
133
	public static boolean alreadyExists(String containerName, String fileName)
135
	public static boolean alreadyExists(String containerName, String fileName)
134
	{
136
	{
Lines 142-149 Link Here
142
		}
144
		}
143
145
144
		IContainer container = (IContainer) resource;
146
		IContainer container = (IContainer) resource;
145
		IFile file = container.getFile(new Path(fileName));
147
		IResource[] resources;
146
		return file.exists();
148
		try
149
		{
150
			resources = container.members();
151
		}
152
		catch (CoreException e)
153
		{
154
			return false;
155
		}
156
		for(int i=0;i<resources.length;i++)
157
		{
158
			if(resources[i] instanceof IFile)
159
			{
160
				IFile ifile = (IFile) resources[i];
161
				if(ifile.getName().equalsIgnoreCase(fileName) && ifile.exists())
162
					return true;
163
			}
164
		}
165
		return false;
147
	}
166
	}
148
167
149
} // end class Validation
168
} // end class Validation
(-)src/org/eclipse/tptp/wsdm/tooling/editor/dde/internal/DescriptorModelWizard.java (-3 / +9 lines)
Lines 62-68 Link Here
62
import org.eclipse.swt.widgets.Composite;
62
import org.eclipse.swt.widgets.Composite;
63
import org.eclipse.swt.widgets.Label;
63
import org.eclipse.swt.widgets.Label;
64
import org.eclipse.tptp.wsdm.tooling.editor.internal.Activator;
64
import org.eclipse.tptp.wsdm.tooling.editor.internal.Activator;
65
import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages;
65
import org.eclipse.tptp.wsdm.tooling.util.internal.MyDescriptorResourceFactoryImpl;
66
import org.eclipse.tptp.wsdm.tooling.util.internal.MyDescriptorResourceFactoryImpl;
67
import org.eclipse.tptp.wsdm.tooling.util.internal.Validation;
66
import org.eclipse.ui.INewWizard;
68
import org.eclipse.ui.INewWizard;
67
import org.eclipse.ui.IWorkbench;
69
import org.eclipse.ui.IWorkbench;
68
import org.eclipse.ui.IWorkbenchPage;
70
import org.eclipse.ui.IWorkbenchPage;
Lines 367-376 Link Here
367
							new Object[] { requiredExt }));
369
							new Object[] { requiredExt }));
368
					return false;
370
					return false;
369
				}
371
				}
370
				else
372
				
373
				// Make sure file didn't exists in selected project
374
				if(Validation.alreadyExists(getContainerFullPath().toString(), getFileName()))
371
				{
375
				{
372
					return true;
376
					setErrorMessage(Messages.MEP_WIZARDPAGE_ERROR_11);
373
				}
377
					return false;
378
				}				
379
				return true;				
374
			}
380
			}
375
			else
381
			else
376
			{
382
			{

Return to bug 167600