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

AnnotationProvider (Master Filesystem) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.masterfs/1 1.11

org.netbeans.modules.masterfs.providers
Class AnnotationProvider

java.lang.Object
  extended by org.netbeans.modules.masterfs.providers.AnnotationProvider

public abstract class AnnotationProvider
extends Object

Can provide status and actions for FileObjects. Register it in META-INF/services/org.netbeans.modules.masterfs.providers.AnnotationProvider file.


Constructor Summary
AnnotationProvider()
           
 
Method Summary
abstract  Action[] actions(Set files)
          Provides actions that should be added to given set of files.
 void addFileStatusListener(FileStatusListener listener)
          Registers FileStatusListener to receive events.
abstract  Image annotateIcon(Image icon, int iconType, Set files)
          Annotate the icon of a file cluster.
abstract  String annotateName(String name, Set files)
          Annotate the name of a file cluster.
abstract  String annotateNameHtml(String name, Set files)
          Annotate a name such that the returned value contains HTML markup.
protected  void fireFileStatusChanged(FileStatusEvent event)
          Notifies all registered listeners about change of status of some files.
abstract  InterceptionListener getInterceptionListener()
           
 void removeFileStatusListener(FileStatusListener listener)
          Removes FileStatusListener from the list of listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationProvider

public AnnotationProvider()
Method Detail

annotateName

public abstract String annotateName(String name,
                                    Set files)
Annotate the name of a file cluster.

Parameters:
name - the name suggested by default
files - an immutable set of FileObjects belonging to this filesystem
Returns:
the annotated name or null if this provider does not know how to annotate these files

annotateIcon

public abstract Image annotateIcon(Image icon,
                                   int iconType,
                                   Set files)
Annotate the icon of a file cluster.

Please do not modify the original; create a derivative icon image, using a weak-reference cache if necessary.

Parameters:
icon - the icon suggested by default
iconType - an icon type from BeanInfo
files - an immutable set of FileObjects belonging to this filesystem
Returns:
the annotated icon or null if some other provider shall anotate the icon

annotateNameHtml

public abstract String annotateNameHtml(String name,
                                        Set files)
Annotate a name such that the returned value contains HTML markup. The return value less the html content should typically be the same as the return value from annotateName(). This is used, for example, by VCS filesystems to deëphasize the status information included in the file name by using a light grey font color.

For consistency with Node.getHtmlDisplayName(), filesystems that proxy other filesystems (and so must implement this interface to supply HTML annotations) should return null if the filesystem they proxy does not provide an implementation of HTMLStatus.

See Also:
HtmlRenderer, DataNode.getHtmlDisplayName(), Node

actions

public abstract Action[] actions(Set files)
Provides actions that should be added to given set of files.

Returns:
null or array of actions for these files.

addFileStatusListener

public final void addFileStatusListener(FileStatusListener listener)
                                 throws TooManyListenersException
Registers FileStatusListener to receive events. The implementation registers the listener only when getStatus () is overriden to return a special value.

Parameters:
listener - The listener to register.
Throws:
TooManyListenersException

removeFileStatusListener

public final void removeFileStatusListener(FileStatusListener listener)
Removes FileStatusListener from the list of listeners.

Parameters:
listener - The listener to remove.

fireFileStatusChanged

protected final void fireFileStatusChanged(FileStatusEvent event)
Notifies all registered listeners about change of status of some files.

Parameters:
event - The event to be fired

getInterceptionListener

public abstract InterceptionListener getInterceptionListener()

org.netbeans.modules.masterfs/1 1.11

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