public final class FoldTemplate extends Object
A template may be attached to a FoldType
instance. Folds of that kind will
automatically use the attached Template, if not overriden explicitly.
The string "..."
(FoldTemplate.CONTENT_PLACEHOLDER
) is treated as a placeholder. If a
ContentReader is available for the FoldType
, the placeholder will be replaced by
the product of the Reader. Otherwise the placeholder will remain in the displayText
and will be presented.
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_PLACEHOLDER
This string is interpreted as a placeholder for the infrastructure to inject
|
static FoldTemplate |
DEFAULT
The default template for folded text: no markers before+after, ellipsis
shown.
|
static FoldTemplate |
DEFAULT_BLOCK
A standard template, which represents a block of something.
|
Constructor and Description |
---|
FoldTemplate(int guardedStart,
int guardedEnd,
String displayText)
Creates a FoldTemplate with a fixed description.
|
Modifier and Type | Method and Description |
---|---|
String |
getDescription() |
int |
getGuardedEnd() |
int |
getGuardedStart() |
public static final FoldTemplate DEFAULT
public static final FoldTemplate DEFAULT_BLOCK
public static final String CONTENT_PLACEHOLDER
public FoldTemplate(int guardedStart, int guardedEnd, String displayText)
guardedStart
- length of the start marker, or -1 if no start marker is presentguardedEnd
- length of the end marker, or -1 if no end marker is presentdisplayText
- text which should be displayed in place of the folded contentpublic String getDescription()
public int getGuardedEnd()
public int getGuardedStart()