站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

SourceGroup (Project API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.projectapi/1 1.13

org.netbeans.api.project
Interface SourceGroup


public interface SourceGroup

Representation of one area of sources.

See Also:
Sources

Field Summary
static String PROP_CONTAINERSHIP
          Pseudo-property used to indicate changes in containership of some subfiles.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a listener to changes in aspects of the source group.
 boolean contains(FileObject file)
          Check whether the given file is contained in this group.
 String getDisplayName()
          Get a display name suitable for presentation to a user.
 Icon getIcon(boolean opened)
          Get an icon for presentation to a user.
 String getName()
          Get a code name suitable for internal identification of this source group.
 FileObject getRootFolder()
          Get the folder forming the root of this group of sources.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a listener to changes in aspects of the source group.
 

Field Detail

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:
Constant Field Values
Method Detail

getRootFolder

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(FileObject file)
                 throws IllegalArgumentException
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
Throws:
IllegalArgumentException - if a file is passed which 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

org.netbeans.modules.projectapi/1 1.13

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.