Class DynamicPaths

java.lang.Object
org.praxislive.ide.code.api.DynamicPaths

public final class DynamicPaths extends Object
Service for registering dynamic paths in the IDE, usually for in-memory source files. This enables queries for classpath, source level, etc. across these files. Each registration method returns a private
invalid reference
#Key
that can be used to unregister the sources. Sources should be unregistered when no longer required or a strong reference will be held to them.
  • Method Details

    • registerShared

      public DynamicPaths.SharedKey registerShared(PraxisProject project, org.openide.filesystems.FileObject root, org.openide.filesystems.FileObject sharedFolder)
      Register a folder for shared code files. The returned key provides access to SharedCodeInfo that can be used for registering dependent files, or for adding to a Lookup to use for browsing and editing shared sources.

      The root folder is the classpath root of the file system, eg. the default package location. The shared folder must be the root or a subfolder of the root for a particular package (eg. SHARED).

      Non-source classpaths for the files, as well as other queries, will delegate to the provided project.

      Parameters:
      project - the project
      root - root folder of the classpath
      sharedFolder - folder for all shared files
      Returns:
      key for access to info and unregistering
    • register

      public DynamicPaths.Key register(PraxisProject project, org.openide.filesystems.FileObject root)
      Register a source root without dependency on shared code. See
      invalid reference
      #register(org.praxislive.ide.project.api.PraxisProject, org.praxislive.ide.code.api.SharedCodeInfo, org.openide.filesystems.FileObject)
      .
      Parameters:
      project - the project
      root - root folder
      Returns:
      key for unregistering
    • register

      public DynamicPaths.Key register(PraxisProject project, org.openide.filesystems.FileObject root, SharedCodeInfo shared)
      Register a source root with optional dependency on shared code. The source root should be the classpath root, for example the file system root of a memory file system corresponding to the default package.

      Non-source classpaths for the root and its files, as well as other queries, will delegate to the provided project.

      Parameters:
      project - the project
      root - root folder
      shared - optional shared code, may be null
      Returns:
    • getDefault

      public static DynamicPaths getDefault()