public interface ContentReader
An instance of ContentReader is used repeatedly, i.e. if the same FoldTemplate is assigned to multiple folds. It is advised that the implementation of ContentReader is stateless.
Modifier and Type | Interface and Description |
---|---|
static interface |
ContentReader.Factory
Factory, which produces ContentReader instance(s) appropriate for the fold type.
|
Modifier and Type | Method and Description |
---|---|
CharSequence |
read(Document d,
Fold f,
FoldTemplate ft)
Acquires text for fold content.
|
CharSequence read(Document d, Fold f, FoldTemplate ft) throws BadLocationException
If the ContentReader cannot extract the contents (i.e. it does not want to handle the fold),
null
may be returned. If more ContentReaders are registered, some other instance might
handle the fold properly. If not, the placeholder will be retained and presented in the fold
text.
d
- the document to read fromf
- fold, whose contents should be readft
- the original fold template, if availablenull
if unwilling to retrieve the content.BadLocationException