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

SourceGroup (NetBeans Project API) - NetBeans API Javadoc 5.0.0

 

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

public static final String PROP_CONTAINERSHIP
Pseudo-property used to indicate changes in containership of some subfiles.

See Also:
Constant Field Values
Method Detail

getRootFolder

public 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

public 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

public 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

public 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

public 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 (other than the root folder) is contained then its parent must be as well.

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

public 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

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a listener to changes in aspects of the source group.

Parameters:
listener - a listener to remove

 

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