Interface SourceGroupModifierImplementation


public interface SourceGroupModifierImplementation
The SPI side of SourceGroupModifier. Expected to be present in project lookup of project types supporting automated creation of SourceGroup root folders.
Since:
org.netbeans.modules.projectapi 1.24
  • Method Details

    • createSourceGroup

      SourceGroup createSourceGroup(String type, String hint)
      Creates a SourceGroup of the given type and hint. Typically a type is a constant for java/groovy/ruby source roots and hint is a constant for main sources or test sources. Please consult specific APIs fro the supported types/hints. Eg. JavaProjectConstants for java related project sources. If the SourceGroup's type/hint is not supported, the implementation shall silently return null and not throw any exceptions. If the SourceGroup of given type/hint already exists it shall be returned as well.
      Parameters:
      type - constant for type of sources
      hint -
      Returns:
      the created or existing SourceGroup or null
    • canCreateSourceGroup

      boolean canCreateSourceGroup(String type, String hint)
      checks if SourceGroup of the given type and hint can be created. Typically a type is a constant for java/groovy/ruby source roots and hint is a constant for main sources or test sources. Please consult specific APIs fro the supported types/hints. Eg. JavaProjectConstants for java related project sources. If the SourceGroup of given type/hint already exists it shall return true as well.
      Parameters:
      type - constant for type of sources
      hint -
      Returns:
      true if the SourceGroup exists or can be created.