Class LibraryProjectManager
java.lang.Object
com.e1c.g5.v8.dt.internal.library.LibraryProjectManager
- All Implemented Interfaces:
ILibraryProjectManager
The default implementation of
ILibraryProjectManager
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
connectProjectToLibraries
(IDtProject dtProject, Collection<LibraryDescriptor> libraryDescriptors) Connects the project to the libraries.void
connectProjectToLibrary
(IDtProject dtProject, LibraryDescriptor libraryDescriptor, boolean updateExisting) Connects the project to the library.org.eclipse.core.resources.IProject
createProject
(String projectName, LibraryDescriptor libraryDescriptor, Version version, org.eclipse.core.runtime.IProgressMonitor monitor) Creates a configuration project based on the given library.org.eclipse.core.resources.IProject
createProject
(String projectName, Path projectPath, LibraryDescriptor libraryDescriptor, Version version, Configuration configuration, org.eclipse.core.runtime.IProgressMonitor monitor) Creates a configuration project based on the given library.org.eclipse.core.resources.IProject
createProject
(String projectName, Path libraryPath, Version version, org.eclipse.core.runtime.IProgressMonitor monitor) Creates a configuration project based on the given library.org.eclipse.core.resources.IProject
createProject
(String projectName, Path projectPath, Path libraryPath, Version version, Configuration configuration, org.eclipse.core.runtime.IProgressMonitor monitor) Creates a configuration project based on the given library.void
disconnectProjectFromLibrary
(IDtProject dtProject, LibraryDescriptor libraryDescriptor) Disconnects the project form specified library (disable distribution support).void
exportLibrary
(IDtProject dtProject, Path destinationPath, org.eclipse.core.runtime.IProgressMonitor monitor) Exports the given project as a library to a file.readLibraryMetainformation
(Path libraryPath) Reads the library metainformation from the library file.
-
Constructor Details
-
LibraryProjectManager
public LibraryProjectManager()
-
-
Method Details
-
exportLibrary
public void exportLibrary(IDtProject dtProject, Path destinationPath, org.eclipse.core.runtime.IProgressMonitor monitor) throws IOException Description copied from interface:ILibraryProjectManager
Exports the given project as a library to a file. Now only the configuration project is supported, the configuration version and vendor must be specified.- Specified by:
exportLibrary
in interfaceILibraryProjectManager
- Parameters:
dtProject
- the project to export as a library, cannot benull
destinationPath
- the destination path to export, cannot benull
monitor
- the monitor to indicate the progress, may benull
- Throws:
IOException
- if an I/O error has occurred
-
readLibraryMetainformation
public LibraryDescriptor readLibraryMetainformation(Path libraryPath) throws IOException, InvalidLibraryDescriptorException Description copied from interface:ILibraryProjectManager
Reads the library metainformation from the library file.- Specified by:
readLibraryMetainformation
in interfaceILibraryProjectManager
- Parameters:
libraryPath
- the library file path, cannot benull
- Returns:
- the library descriptor, never
null
- Throws:
IOException
- if an I/O error has occurredInvalidLibraryDescriptorException
- if failed to found library description attributes
-
createProject
public org.eclipse.core.resources.IProject createProject(String projectName, Path libraryPath, Version version, org.eclipse.core.runtime.IProgressMonitor monitor) throws IOException, InvalidLibraryDescriptorException, org.eclipse.core.runtime.CoreException Description copied from interface:ILibraryProjectManager
Creates a configuration project based on the given library.- Specified by:
createProject
in interfaceILibraryProjectManager
- Parameters:
projectName
- the project name, cannot benull
libraryPath
- the library file path, cannot benull
version
- the project runtime version, cannot benull
monitor
- the monitor to indicate the progress, may benull
- Returns:
- the created configuration project, never
null
- Throws:
IOException
- if an I/O error has occurredInvalidLibraryDescriptorException
- if failed to found library description attributesorg.eclipse.core.runtime.CoreException
- if failed to create a project
-
createProject
public org.eclipse.core.resources.IProject createProject(String projectName, Path projectPath, Path libraryPath, Version version, Configuration configuration, org.eclipse.core.runtime.IProgressMonitor monitor) throws IOException, InvalidLibraryDescriptorException, org.eclipse.core.runtime.CoreException Description copied from interface:ILibraryProjectManager
Creates a configuration project based on the given library.- Specified by:
createProject
in interfaceILibraryProjectManager
- Parameters:
projectName
- the project name, cannot benull
projectPath
- the project path, may benull
libraryPath
- the library file path, cannot benull
version
- the project runtime version, cannot benull
configuration
- the template configuration to use during the creation, may benull
monitor
- the monitor to indicate the progress, may benull
- Returns:
- the created configuration project, never
null
- Throws:
IOException
- if an I/O error has occurredInvalidLibraryDescriptorException
- if failed to found library description attributesorg.eclipse.core.runtime.CoreException
- if failed to create a project
-
createProject
public org.eclipse.core.resources.IProject createProject(String projectName, LibraryDescriptor libraryDescriptor, Version version, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Description copied from interface:ILibraryProjectManager
Creates a configuration project based on the given library.- Specified by:
createProject
in interfaceILibraryProjectManager
- Parameters:
projectName
- the project name, cannot benull
libraryDescriptor
- the library descriptor to create the project based on, cannot benull
version
- the project runtime version, cannot benull
monitor
- the monitor to indicate the progress, may benull
- Returns:
- the created configuration project, never
null
- Throws:
org.eclipse.core.runtime.CoreException
- if failed to create a project
-
createProject
public org.eclipse.core.resources.IProject createProject(String projectName, Path projectPath, LibraryDescriptor libraryDescriptor, Version version, Configuration configuration, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Description copied from interface:ILibraryProjectManager
Creates a configuration project based on the given library.- Specified by:
createProject
in interfaceILibraryProjectManager
- Parameters:
projectName
- the project name, cannot benull
projectPath
- the project path, may benull
libraryDescriptor
- the library descriptor to create the project based on, cannot benull
version
- the project runtime version, cannot benull
configuration
- the template configuration to use during the creation, may benull
monitor
- the monitor to indicate the progress, may benull
- Returns:
- the created configuration project, never
null
- Throws:
org.eclipse.core.runtime.CoreException
- if failed to create a project
-
connectProjectToLibrary
public void connectProjectToLibrary(IDtProject dtProject, LibraryDescriptor libraryDescriptor, boolean updateExisting) throws IOException, org.eclipse.core.runtime.CoreException, ProjectManifestException Description copied from interface:ILibraryProjectManager
Connects the project to the library.- Specified by:
connectProjectToLibrary
in interfaceILibraryProjectManager
- Parameters:
dtProject
- the DT workspace project to connect the library for, cannot benull
libraryDescriptor
- the library descriptor to connect to, cannot benull
updateExisting
- Update existing library (either up or down to the provided version) or plug a provided library as a new one- Throws:
IOException
- if an I/O error has occurredorg.eclipse.core.runtime.CoreException
- if failed to connect project to libraryProjectManifestException
- In case when the manifest cannot be parsed due to incorrect syntax
-
connectProjectToLibraries
public void connectProjectToLibraries(IDtProject dtProject, Collection<LibraryDescriptor> libraryDescriptors) throws IOException, org.eclipse.core.runtime.CoreException, ProjectManifestException Description copied from interface:ILibraryProjectManager
Connects the project to the libraries.- Specified by:
connectProjectToLibraries
in interfaceILibraryProjectManager
- Parameters:
dtProject
- the DT workspace project to connect the library for, cannot benull
libraryDescriptors
- the library descriptors collection to connect to, cannot benull
- Throws:
IOException
- if an I/O error has occurredorg.eclipse.core.runtime.CoreException
- if failed to connect project to librariesProjectManifestException
- In case when the manifest cannot be parsed due to incorrect syntax
-
disconnectProjectFromLibrary
public void disconnectProjectFromLibrary(IDtProject dtProject, LibraryDescriptor libraryDescriptor) throws IOException, org.eclipse.core.runtime.CoreException, ProjectManifestException Description copied from interface:ILibraryProjectManager
Disconnects the project form specified library (disable distribution support). When the configuration is disabled from a library support all the library distribution settings are discarded and library-specific resources are copied into the configuration- Specified by:
disconnectProjectFromLibrary
in interfaceILibraryProjectManager
- Parameters:
dtProject
- the DT workspace project to disconnect the library from, cannot benull
libraryDescriptor
- the library descriptor to disconnect from, cannot benull
- Throws:
IOException
- if an I/O error has occurredorg.eclipse.core.runtime.CoreException
- if this method fails when accessing project manifest file. Reasons include:- This resource does not exist.
- The corresponding location in the local file system is occupied by a directory.
- The workspace is not in sync with the corresponding location
in the local file system and
force
isfalse
. - Resource changes are disallowed during certain types of resource change
event notification. See
IResourceChangeEvent
for more details. - The file modification validator disallowed the change.
ProjectManifestException
- In case when the manifest cannot be parsed due to incorrect syntax
-