Interface SourceGroup


public interface SourceGroup
Representation of one area of sources.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Pseudo-property used to indicate changes in containership of some subfiles.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a listener to changes in aspects of the source group.
    boolean
    contains(org.openide.filesystems.FileObject file)
    Check whether the given file is contained in this group.
    Get a display name suitable for presentation to a user.
    getIcon(boolean opened)
    Get an icon for presentation to a user.
    Get a code name suitable for internal identification of this source group.
    org.openide.filesystems.FileObject
    Get the folder forming the root of this group of sources.
    void
    Remove a listener to changes in aspects of the source group.
  • Field Details

    • PROP_CONTAINERSHIP

      static final String PROP_CONTAINERSHIP
      Pseudo-property used to indicate changes in containership of some subfiles. (The old and new value should be left null.)
      See Also:
  • Method Details

    • getRootFolder

      org.openide.filesystems.FileObject getRootFolder()
      Get the folder forming the root of this group of sources.
      Returns:
      the root folder (must be a folder, not a file)
    • getName

      String getName()
      Get a code name suitable for internal identification of this source group. Should be unique among the source groups of a given type contained in a single Sources object.
      Returns:
      a code name
    • getDisplayName

      String getDisplayName()
      Get a display name suitable for presentation to a user. Should preferably be unique among the source groups of a given type contained in a single Sources object.
      Returns:
      a display name
    • getIcon

      Icon getIcon(boolean opened)
      Get an icon for presentation to a user.
      Parameters:
      opened - if true, may select an alternative "open" variant
      Returns:
      an icon, or null if no specific icon is needed
    • contains

      boolean contains(org.openide.filesystems.FileObject file)
      Check whether the given file is contained in this group.

      A constraint is that the root folder must be contained and if any file or folder (other than the root folder) is contained then its parent must be as well. Therefore, while the return value is precise for files, and a false return value means what it sounds like for folders, a true return value for folders may mean that just parts of the folder are contained in the group.

      Parameters:
      file - a file or folder; must be a descendant of the root folder
      Returns:
      true if the group contains that file; false if it is to be excluded, or is not inside the root
    • addPropertyChangeListener

      void addPropertyChangeListener(PropertyChangeListener listener)
      Add a listener to changes in aspects of the source group. The property names used may be normal JavaBean names (rootFolder, name, displayName, icon) or PROP_CONTAINERSHIP.
      Parameters:
      listener - a listener to add
    • removePropertyChangeListener

      void removePropertyChangeListener(PropertyChangeListener listener)
      Remove a listener to changes in aspects of the source group.
      Parameters:
      listener - a listener to remove