Class LibraryProjectManager

java.lang.Object
com.e1c.g5.v8.dt.internal.library.LibraryProjectManager
All Implemented Interfaces:
ILibraryProjectManager

public class LibraryProjectManager extends Object implements ILibraryProjectManager
The default implementation of ILibraryProjectManager.
  • 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 interface ILibraryProjectManager
      Parameters:
      dtProject - the project to export as a library, cannot be null
      destinationPath - the destination path to export, cannot be null
      monitor - the monitor to indicate the progress, may be null
      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 interface ILibraryProjectManager
      Parameters:
      libraryPath - the library file path, cannot be null
      Returns:
      the library descriptor, never null
      Throws:
      IOException - if an I/O error has occurred
      InvalidLibraryDescriptorException - 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 interface ILibraryProjectManager
      Parameters:
      projectName - the project name, cannot be null
      libraryPath - the library file path, cannot be null
      version - the project runtime version, cannot be null
      monitor - the monitor to indicate the progress, may be null
      Returns:
      the created configuration project, never null
      Throws:
      IOException - if an I/O error has occurred
      InvalidLibraryDescriptorException - if failed to found library description attributes
      org.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 interface ILibraryProjectManager
      Parameters:
      projectName - the project name, cannot be null
      projectPath - the project path, may be null
      libraryPath - the library file path, cannot be null
      version - the project runtime version, cannot be null
      configuration - the template configuration to use during the creation, may be null
      monitor - the monitor to indicate the progress, may be null
      Returns:
      the created configuration project, never null
      Throws:
      IOException - if an I/O error has occurred
      InvalidLibraryDescriptorException - if failed to found library description attributes
      org.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 interface ILibraryProjectManager
      Parameters:
      projectName - the project name, cannot be null
      libraryDescriptor - the library descriptor to create the project based on, cannot be null
      version - the project runtime version, cannot be null
      monitor - the monitor to indicate the progress, may be null
      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 interface ILibraryProjectManager
      Parameters:
      projectName - the project name, cannot be null
      projectPath - the project path, may be null
      libraryDescriptor - the library descriptor to create the project based on, cannot be null
      version - the project runtime version, cannot be null
      configuration - the template configuration to use during the creation, may be null
      monitor - the monitor to indicate the progress, may be null
      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 interface ILibraryProjectManager
      Parameters:
      dtProject - the DT workspace project to connect the library for, cannot be null
      libraryDescriptor - the library descriptor to connect to, cannot be null
      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 occurred
      org.eclipse.core.runtime.CoreException - if failed to connect project to library
      ProjectManifestException - 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 interface ILibraryProjectManager
      Parameters:
      dtProject - the DT workspace project to connect the library for, cannot be null
      libraryDescriptors - the library descriptors collection to connect to, cannot be null
      Throws:
      IOException - if an I/O error has occurred
      org.eclipse.core.runtime.CoreException - if failed to connect project to libraries
      ProjectManifestException - 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 interface ILibraryProjectManager
      Parameters:
      dtProject - the DT workspace project to disconnect the library from, cannot be null
      libraryDescriptor - the library descriptor to disconnect from, cannot be null
      Throws:
      IOException - if an I/O error has occurred
      org.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 is false.
      • 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