public interface StatusDecorator
FileSystem.Status
.
Other markers are possible, e.g. icon, but they are not provided in this interface.
For icon or other GUI artifacts, please see openide.filesystems.nb
module,
the ImageDecorator
interface and FileUIUtils
utility class.Modifier and Type | Method and Description |
---|---|
String |
annotateName(String name,
Set<? extends FileObject> files)
Annotate the name of a file cluster.
|
String |
annotateNameHtml(String name,
Set<? extends FileObject> files)
Annotate a name such that the returned value contains HTML markup.
|
String annotateName(String name, Set<? extends FileObject> files)
name
- the name suggested by defaultfiles
- an immutable set of FileObject
s belonging to this
filesystemClassCastException
- if the files in the set are not of valid
typesString annotateNameHtml(String name, Set<? extends FileObject> files)
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.
name
- the name suggested by default. It cannot contain HTML
markup tags but must escape HTML metacharacters. For example
"<default package>" is illegal but "<default package>"
is fine.files
- an immutable set of FileObject
s belonging to this filesystemDataNode.getHtmlDisplayName()
,
Node.getHtmlDisplayName()