org.openide.filesystems 8.5.1

org.openide.filesystems
Interface FileSystem.HtmlStatus

All Superinterfaces:
FileSystem.Status
Enclosing class:
FileSystem

public static interface FileSystem.HtmlStatus
extends FileSystem.Status

Extension interface for Status provides HTML-formatted annotations. Principally this is used to deemphasize status text by presenting it in a lighter color, by placing it inside <font color=!controlShadow> tags. Note that it is preferable to use logical colors (such as controlShadow) which are resolved by calling UIManager.getColor(key) - this way they will always fit with the look and feel. To use a logical color, prefix the color name with a ! character.

Please use only the limited markup subset of HTML supported by the lightweight HTML renderer.

Since:
4.30
See Also:
HtmlRenderer

Method Summary
 String annotateNameHtml(String name, Set<? extends FileObject> files)
          Annotate a name such that the returned value contains HTML markup.
 
Methods inherited from interface org.openide.filesystems.FileSystem.Status
annotateIcon, annotateName
 

Method Detail

annotateNameHtml

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 FileSystem.HtmlStatus.

Note that since the name argument must be free of HTML, it is tricky to use this decorator on a Node arising from foreign code, to chain decorators, or otherwise when you wish to add decorations to an HTML label whose creation you do not control. As a workaround, pass in an arbitrary but HTML-free string as an argument (something unlikely to occur elsewhere) and replace that string in the result with the original HTML label - under the assumption that the decorator does not inspect its argument but merely adds some prefix and/or suffix.

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.
Since:
4.30
See Also:
DataNode.getHtmlDisplayName(), Node.getHtmlDisplayName()

org.openide.filesystems 8.5.1

Built on June 6 2013.  |  Portions Copyright 1997-2013 Oracle. All rights reserved.