Interface SourceGroup
public interface SourceGroup
Representation of one area of sources.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Pseudo-property used to indicate changes in containership of some subfiles. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getName()
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
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
-
getDisplayName
-
getIcon
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
Add a listener to changes in aspects of the source group. The property names used may be normal JavaBean names (rootFolder
,name
,displayName
,icon
) orPROP_CONTAINERSHIP
.- Parameters:
listener
- a listener to add
-
removePropertyChangeListener
Remove a listener to changes in aspects of the source group.- Parameters:
listener
- a listener to remove
-