org.netbeans.modules.masterfs/2 2.38

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 using ServiceProvider.


Constructor Summary
AnnotationProvider()
           
 
Method Summary
abstract  Action[] actions(Set<? extends FileObject> 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<? extends FileObject> files)
          Annotate the icon of a file cluster.
abstract  String annotateName(String name, Set<? extends FileObject> files)
          Annotate the name of a file cluster.
abstract  String annotateNameHtml(String name, Set<? extends FileObject> 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()
          Returns an InterceptionListener.
 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<? extends FileObject> 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<? extends FileObject> 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<? extends FileObject> 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 deemphasize 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.

Parameters:
name - the name suggested by default. It cannot contain HTML markup tags but must escape HTML metacharacters. For example "<default package>" is illegal but "&lt;default package&gt;" is fine.
files - an immutable set of FileObjects belonging to this filesystem
Returns:
the annotated name. It may be the same as the passed-in name. It may be null if getStatus returned status that doesn't implement HtmlStatus but plain Status.
See Also:
HtmlRenderer, DataNode.getHtmlDisplayName(), Node

actions

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

Parameters:
files - an immutable set of FileObjects belonging to this filesystem
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()
Returns an InterceptionListener.

Returns:
InterceptionListener

org.netbeans.modules.masterfs/2 2.38

Built on May 24 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.