Interface IV8ProjectHandle

  • All Superinterfaces:
    org.eclipse.handly.model.IElement, org.eclipse.handly.model.IElementExtension, IV8Element
    All Known Implementing Classes:
    ExternalV8ProjectHandle, V8ProjectHandle

    public interface IV8ProjectHandle
    extends IV8Element
    Represents a V8 project handle.
    See Also:
    V8ModelCore.create(IProject)
    Restriction:
    This interface is not intended to be extended by clients.
    Restriction:
    This interface is not intended to be implemented by clients.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String NATURE_ID
      V8 Configuration project nature id.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void create​(URI location, org.eclipse.core.runtime.IProgressMonitor monitor)
      Creates a new V8 project in the workspace.
      void create​(org.eclipse.core.runtime.IProgressMonitor monitor)
      Creates a new V8 project in the workspace with files in the default location in the local file system.
      org.eclipse.core.resources.IResource[] getNonV8Resources()
      Returns the non-V8 resources contained in this project.
      default IV8Model getParent()  
      org.eclipse.core.resources.IProject getProject()
      Returns the IProject on which this IV8Project was created.
      IV8File getV8File​(String name)
      Returns the V8 file with the given full name in this project, or null if unable to associate the given name with a V8 file.
      IV8File getV8File​(org.eclipse.core.resources.IFile file)
      Returns the V8 file with full name from origin IFile in this project, or null if unable to associate the given IFile with a V8 file.
      IV8File[] getV8Files()
      Returns the V8 files contained in this project.
      • Methods inherited from interface org.eclipse.handly.model.IElement

        equals, hashCode
      • Methods inherited from interface org.eclipse.handly.model.IElementExtension

        exists, getAncestor, getChildren, getChildren, getLocationUri, getName, getResource
    • Method Detail

      • getParent

        default IV8Model getParent()
        Specified by:
        getParent in interface org.eclipse.handly.model.IElementExtension
        Specified by:
        getParent in interface IV8Element
      • create

        void create​(org.eclipse.core.runtime.IProgressMonitor monitor)
             throws org.eclipse.core.runtime.CoreException
        Creates a new V8 project in the workspace with files in the default location in the local file system.

        This is a convenience method, fully equivalent to:

          create(null, monitor);  

        This method changes resources; these changes will be reported in a subsequent change event, including an indication that this project has been added to the workspace.

        This method is long-running; progress and cancellation are provided by the given progress monitor.

        Parameters:
        monitor - a progress monitor, or null if progress reporting is not desired
        Throws:
        org.eclipse.core.runtime.CoreException - if the project could not be created. Reasons include:
        • The project already exists in the workspace.
        • The name of the project is not valid (according to IWorkspace.validateName).
        • The project description file could not be created in the project content area.
        • Resource changes are disallowed during certain types of resource change event notification. See IResourceChangeEvent for more details.
        See Also:
        create(URI, IProgressMonitor)
      • create

        void create​(URI location,
                    org.eclipse.core.runtime.IProgressMonitor monitor)
             throws org.eclipse.core.runtime.CoreException
        Creates a new V8 project in the workspace. Upon successful completion, the corresponding project resource will exist and be open.

        The created project resource will have the following configuration:

        • the given project location
        • no references to other projects
        • V8 project nature
        • Xtext project nature and builder
        • UTF-8 as the default charset

        This method changes resources; these changes will be reported in a subsequent change event, including an indication that this project has been added to the workspace.

        This method is long-running; progress and cancellation are provided by the given progress monitor.

        Parameters:
        location - the location for the project. If null is specified, the default location is used.
        monitor - a progress monitor, or null if progress reporting is not desired
        Throws:
        org.eclipse.core.runtime.CoreException - if the project could not be created. Reasons include:
        • The project already exists in the workspace.
        • The name of the project is not valid (according to IWorkspace.validateName).
        • The project description file could not be created in the project content area.
        • Resource changes are disallowed during certain types of resource change event notification. See IResourceChangeEvent for more details.
        See Also:
        IWorkspace.validateProjectLocationURI(IProject, URI)
      • getV8File

        IV8File getV8File​(String name)
        Returns the V8 file with the given full name in this project, or null if unable to associate the given name with a V8 file. The name has to be a valid file name. This is a handle-only method. The V8 file may or may not exist.
        Parameters:
        name - the name of the V8 file (not null)
        Returns:
        the V8 file with the given name in this project, or null if unable to associate the given name with a V8 file
      • getV8File

        IV8File getV8File​(org.eclipse.core.resources.IFile file)
        Returns the V8 file with full name from origin IFile in this project, or null if unable to associate the given IFile with a V8 file. This is a handle-only method. The V8 file may or may not exist.
        Parameters:
        file - actual IFile for creating V8 file (not null)
        Returns:
        the V8 file with the given name in this project, or null if unable to associate the given name with a V8 file
      • getV8Files

        IV8File[] getV8Files()
                      throws org.eclipse.core.runtime.CoreException
        Returns the V8 files contained in this project.
        Returns:
        the V8 files contained in this project (never null)
        Throws:
        org.eclipse.core.runtime.CoreException - if this element does not exist or if an exception occurs while accessing its corresponding resource
      • getNonV8Resources

        org.eclipse.core.resources.IResource[] getNonV8Resources()
                                                          throws org.eclipse.core.runtime.CoreException
        Returns the non-V8 resources contained in this project.
        Returns:
        the non-V8 resources contained in this project (never null)
        Throws:
        org.eclipse.core.runtime.CoreException - if this element does not exist or if an exception occurs while accessing its corresponding resource
      • getProject

        org.eclipse.core.resources.IProject getProject()
        Returns the IProject on which this IV8Project was created. This is handle-only method.
        Returns:
        the IProject on which this IV8Project was created (never null)