public interface FoldType
FoldParser can also define their own folded region types, provided
they give them values of at least FOLD_TYPE_USER_DEFINED_MIN. This
allows you to identify and auto-fold specific regions of source code when
opening files; for example, a Java editor could identify all import
statements in a file as a foldable region, and give it a user-defined value
for fold type. Then, the UI could provide a means for the user to specify
that they always want the import region folded when opening a new file.
The majority of the time, however, code editors won't need to be that fancy,
and can simply use the standard CODE and COMMENT
fold types.
Fold| Modifier and Type | Field and Description |
|---|---|
static int |
CODE
Denotes a
Fold as being a region of code. |
static int |
COMMENT
Denotes a
Fold as being a multi-line comment. |
static int |
FOLD_TYPE_USER_DEFINED_MIN
Users building advanced editors such as IDE's, that want to allow their
users to auto-expand/collapse foldable regions of a specific type other
than comments, should define their custom fold types using values
FOLD_TYPE_USER_DEFINED_MIN + n. |
static int |
IMPORTS
Denotes a
Fold as being a section of import statements
(Java), include statements (C), etc. |
static final int CODE
Fold as being a region of code.static final int COMMENT
Fold as being a multi-line comment.static final int IMPORTS
Fold as being a section of import statements
(Java), include statements (C), etc.static final int FOLD_TYPE_USER_DEFINED_MIN
FOLD_TYPE_USER_DEFINED_MIN + n. That way, if
new default fold types are added to this interface in the future, your
code won't suddenly break when upgrading to a new version of RSTA.