Class V8ProjectHandle

  • All Implemented Interfaces:
    IV8Element, IV8ProjectHandle, org.eclipse.core.runtime.IAdaptable, org.eclipse.handly.model.IElement, org.eclipse.handly.model.IElementExtension, org.eclipse.handly.model.impl.IElementImpl, org.eclipse.handly.model.impl.IElementImplExtension, org.eclipse.handly.model.impl.support.IElementImplSupport, org.eclipse.handly.model.impl.support.IModelManager.Provider
    Direct Known Subclasses:
    ExternalV8ProjectHandle

    public class V8ProjectHandle
    extends org.eclipse.handly.model.impl.support.Element
    implements IV8ProjectHandle
    Represents a V8 project handle.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.handly.model.impl.IElementImplExtension

        org.eclipse.handly.model.impl.IElementImplExtension.CloseHint
    • Field Summary

      • Fields inherited from interface org.eclipse.handly.model.impl.IElementImplExtension

        CLOSE_HINT, FORCE_OPEN
      • Fields inherited from interface org.eclipse.handly.model.impl.support.IElementImplSupport

        NEW_ELEMENTS, NO_BODY
    • Method Summary

      All Methods Instance Methods Concrete Methods Default Methods 
      Modifier and Type Method Description
      void buildStructure_​(org.eclipse.handly.context.IContext context, org.eclipse.core.runtime.IProgressMonitor monitor)  
      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.
      default org.eclipse.handly.model.impl.support.IModelManager getModelManager_()  
      org.eclipse.core.resources.IResource[] getNonV8Resources()
      Returns the non-V8 resources contained in this project.
      org.eclipse.core.resources.IProject getProject()
      Returns the IProject on which this IV8Project was created.
      org.eclipse.core.resources.IResource getResource_()  
      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.
      void validateExistence_​(org.eclipse.handly.context.IContext context)  
      • Methods inherited from class org.eclipse.handly.model.impl.support.Element

        equals, getName_, getParent_, hashCode, toString
      • Methods inherited from class org.eclipse.core.runtime.PlatformObject

        getAdapter
      • 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
      • Methods inherited from interface org.eclipse.handly.model.impl.IElementImpl

        equalsAndSameParentChain_, fetchChildren_, fetchChildrenOfType_, getChildrenOfType_, getHandleMemento_, getLocationUri_, getRoot_, toDisplayString_
      • Methods inherited from interface org.eclipse.handly.model.impl.IElementImplExtension

        close_, getBody_, getBody_, getChildren_
      • Methods inherited from interface org.eclipse.handly.model.impl.support.IElementImplSupport

        canEqual_, close_, defaultEquals_, defaultHashCode_, exists_, findBody_, getChildrenFromBody_, getElementManager_, getModel_, isOpenable_, newDoesNotExistException_, open_, openParent_, peekAtBody_, remove_, removing_, toString_, toStringAncestors_, toStringBody_, toStringChildren_, toStringName_
    • Method Detail

      • create

        public void create​(org.eclipse.core.runtime.IProgressMonitor monitor)
                    throws org.eclipse.core.runtime.CoreException
        Description copied from interface: IV8ProjectHandle
        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.

        Specified by:
        create in interface IV8ProjectHandle
        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:
        IV8ProjectHandle.create(URI, IProgressMonitor)
      • create

        public void create​(URI location,
                           org.eclipse.core.runtime.IProgressMonitor monitor)
                    throws org.eclipse.core.runtime.CoreException
        Description copied from interface: IV8ProjectHandle
        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.

        Specified by:
        create in interface IV8ProjectHandle
        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

        public IV8File getV8File​(String name)
        Description copied from interface: IV8ProjectHandle
        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.
        Specified by:
        getV8File in interface IV8ProjectHandle
        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

        public IV8File getV8File​(org.eclipse.core.resources.IFile file)
        Description copied from interface: IV8ProjectHandle
        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.
        Specified by:
        getV8File in interface IV8ProjectHandle
        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

        public IV8File[] getV8Files()
                             throws org.eclipse.core.runtime.CoreException
        Description copied from interface: IV8ProjectHandle
        Returns the V8 files contained in this project.
        Specified by:
        getV8Files in interface IV8ProjectHandle
        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

        public org.eclipse.core.resources.IResource[] getNonV8Resources()
                                                                 throws org.eclipse.core.runtime.CoreException
        Description copied from interface: IV8ProjectHandle
        Returns the non-V8 resources contained in this project.
        Specified by:
        getNonV8Resources in interface IV8ProjectHandle
        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

        public org.eclipse.core.resources.IProject getProject()
        Description copied from interface: IV8ProjectHandle
        Returns the IProject on which this IV8Project was created. This is handle-only method.
        Specified by:
        getProject in interface IV8ProjectHandle
        Returns:
        the IProject on which this IV8Project was created (never null)
      • getResource_

        public org.eclipse.core.resources.IResource getResource_()
        Specified by:
        getResource_ in interface org.eclipse.handly.model.impl.IElementImpl
      • validateExistence_

        public void validateExistence_​(org.eclipse.handly.context.IContext context)
                                throws org.eclipse.core.runtime.CoreException
        Specified by:
        validateExistence_ in interface org.eclipse.handly.model.impl.support.IElementImplSupport
        Throws:
        org.eclipse.core.runtime.CoreException
      • buildStructure_

        public void buildStructure_​(org.eclipse.handly.context.IContext context,
                                    org.eclipse.core.runtime.IProgressMonitor monitor)
                             throws org.eclipse.core.runtime.CoreException
        Specified by:
        buildStructure_ in interface org.eclipse.handly.model.impl.support.IElementImplSupport
        Throws:
        org.eclipse.core.runtime.CoreException
      • getModelManager_

        public default org.eclipse.handly.model.impl.support.IModelManager getModelManager_()
        Specified by:
        getModelManager_ in interface org.eclipse.handly.model.impl.support.IModelManager.Provider