public class CHESSProjectSupport
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.eclipse.ui.console.MessageConsoleStream |
CHESS_CONSOLE
The CHESS console.
|
static java.lang.String |
CHESS_CONSOLE_NAME
The CHESS console name used to output information.
|
static java.io.PrintStream |
CHESS_CONSOLE_STREAM
The CHESS console stream.
|
Constructor and Description |
---|
CHESSProjectSupport() |
Modifier and Type | Method and Description |
---|---|
static void |
bundleToProjectCopy(java.lang.String pluginID,
org.eclipse.core.runtime.Plugin plugin,
java.lang.String pluginPath,
org.eclipse.core.resources.IProject currentProject,
java.lang.String projectPath,
boolean includeBundleFolder)
Copies the content of a plug-in to a project.
|
static org.eclipse.core.resources.IFile |
copyFile(org.eclipse.core.resources.IFile inputFile,
java.lang.String newLocation,
java.lang.String outputName)
Copy an IFile to a folder and rename it.
|
static void |
createFolder(org.eclipse.core.resources.IFolder folder)
Create folders.
|
static org.eclipse.core.resources.IProject |
createProject(java.lang.String projectName,
java.net.URI location)
Create an Eclipse Project given a name and a location.
|
static void |
deleteFolder(org.eclipse.core.resources.IFolder folder)
Deletes a folder.
|
static void |
fileReplace(org.eclipse.core.resources.IFile in,
org.eclipse.core.resources.IFile out)
Replace the content of the 'out' IFile with the content of the 'in' IFile.
|
static void |
printlnToCHESSConsole(java.lang.String message)
Print a message to the CHESS Console.
|
static org.eclipse.core.resources.IFile |
resourceToFile(org.eclipse.emf.ecore.resource.Resource inResource)
This method converts a Resource to a IFile.
|
public static java.lang.String CHESS_CONSOLE_NAME
public static final org.eclipse.ui.console.MessageConsoleStream CHESS_CONSOLE
public static final java.io.PrintStream CHESS_CONSOLE_STREAM
public static void printlnToCHESSConsole(java.lang.String message)
message
- the messagepublic static org.eclipse.core.resources.IProject createProject(java.lang.String projectName, java.net.URI location)
projectName
- The name of the projectlocation
- The location where to create the projectpublic static void createFolder(org.eclipse.core.resources.IFolder folder) throws org.eclipse.core.runtime.CoreException
myNewFolders = myProject.getFolder("folders/to/create/");
createFolder(myNewFolders);
folder
- the IFolder instance to createorg.eclipse.core.runtime.CoreException
- Exceptions during the folder creation are not handled by this
method.public static org.eclipse.core.resources.IFile resourceToFile(org.eclipse.emf.ecore.resource.Resource inResource)
inResource
- the resource to converto to IFilepublic static org.eclipse.core.resources.IFile copyFile(org.eclipse.core.resources.IFile inputFile, java.lang.String newLocation, java.lang.String outputName) throws java.lang.Exception
inputFile
- the IFile to copynewLocation
- a String to specify the location to copy the fileoutputName
- the name of the copyjava.lang.Exception
- when the file cannot be copied or the old copy cannot be overwritten.public static void fileReplace(org.eclipse.core.resources.IFile in, org.eclipse.core.resources.IFile out) throws org.eclipse.core.runtime.CoreException, java.io.IOException
in
- the new IFile contentout
- the old IFile content to be replacedorg.eclipse.core.runtime.CoreException
- when the contents of the IFiles cannot be manipulatedjava.io.IOException
- when the stream used to transfer the content cannot be closedpublic static void bundleToProjectCopy(java.lang.String pluginID, org.eclipse.core.runtime.Plugin plugin, java.lang.String pluginPath, org.eclipse.core.resources.IProject currentProject, java.lang.String projectPath, boolean includeBundleFolder) throws java.io.IOException
pluginID
- the ID of the plugin where the files to be copied reside, not usedplugin
- the plugin where the files to be copied residepluginPath
- the path to the folder where the file to be copied residecurrentProject
- the project to copy the filesprojectPath
- the path of the project where the file will be copiedincludeBundleFolder
- whether to copy the root folder where the files reside or notjava.io.IOException
- when the operation cannot be performedpublic static void deleteFolder(org.eclipse.core.resources.IFolder folder) throws org.eclipse.core.runtime.CoreException
folder
- the IFolder to deleteorg.eclipse.core.runtime.CoreException
- when the folder cannot be deleted