Commit bc0d9f58 authored by Simon Barner's avatar Simon Barner
Browse files

Move ApplicationUtils adapations to new af3-rcp repository

* Some cleanup has been performed while af3.rcp.application was still
  part of the "af3" repository
* Now, that the plugin is in a separate repository, the changes
  performed in this issue have to be moved accordingly

Issue-Ref: 3640
Issue-Url: https://af3-developer.fortiss.org/issues/3640

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent acff4939
ApplicationUtils.java 199658a271076d94f1eb9710ea07744e48a5b62f GREEN
ApplicationUtils.java 86b0ed3bcd36ce9ceb865127fbe045c231187506 YELLOW
......@@ -15,10 +15,12 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.rcp.application.utils;
import static org.fortiss.af3.project.utils.FileUtils.getAF3EclipseProject;
import java.io.IOException;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
......@@ -88,14 +90,13 @@ public class ApplicationUtils {
*/
public static IFile validateProjectName(String projectName, String suffix) {
// Get the general project that contains the AF3-Projects.
final IResource resource = ResourcesPlugin.getWorkspace().getRoot()
.findMember(NewProjectUtils.getDefaultGeneralProjectName());
final IProject af3EclipsePrj = getAF3EclipseProject();
// If project name was given with file extension, remove this first.
projectName = projectName.replace(suffix, "");
// Create project file object.
IFile projectFile = ((IContainer)resource).getFile(new Path(projectName + suffix));
IFile projectFile = af3EclipsePrj.getFile(new Path(projectName + suffix));
// If a file with this name already exists.
if(projectFile.exists()) {
......@@ -105,7 +106,7 @@ public class ApplicationUtils {
return null;
}
projectFile = ((IContainer)resource).getFile(new Path(newProjectPath));
projectFile = af3EclipsePrj.getFile(new Path(newProjectPath));
}
return projectFile;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment