Package org.eclipse.jdt.ui.text.folding
Class DefaultJavaFoldingStructureProvider.FoldingStructureComputationContext
java.lang.Object
org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.FoldingStructureComputationContext
- Enclosing class:
- DefaultJavaFoldingStructureProvider
protected final class DefaultJavaFoldingStructureProvider.FoldingStructureComputationContext
extends Object
A context that contains the information needed to compute the folding structure of an
ICompilationUnit
or an IClassFile
. Computed folding regions are collected
via
addProjectionRange.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addProjectionRange
(DefaultJavaFoldingStructureProvider.JavaProjectionAnnotation annotation, org.eclipse.jface.text.Position position) Adds a projection (folding) region to this context.boolean
Returnstrue
if newly created folding regions may be collapsed,false
if not.boolean
Returnstrue
if header comments should be collapsed.boolean
Returnstrue
if import containers should be collapsed.boolean
Returnstrue
if inner types should be collapsed.boolean
Returnstrue
if javadoc comments should be collapsed.boolean
Returnstrue
if methods should be collapsed.
-
Method Details
-
allowCollapsing
public boolean allowCollapsing()Returnstrue
if newly created folding regions may be collapsed,false
if not. This is usuallyfalse
when updating the folding structure while typing; it may betrue
when computing or restoring the initial folding structure.- Returns:
true
if newly created folding regions may be collapsed,false
if not
-
addProjectionRange
public void addProjectionRange(DefaultJavaFoldingStructureProvider.JavaProjectionAnnotation annotation, org.eclipse.jface.text.Position position) Adds a projection (folding) region to this context. The created annotation / position pair will be added to theProjectionAnnotationModel
of theProjectionViewer
of the editor.- Parameters:
annotation
- the annotation to addposition
- the corresponding position
-
collapseHeaderComments
public boolean collapseHeaderComments()Returnstrue
if header comments should be collapsed.- Returns:
true
if header comments should be collapsed
-
collapseImportContainer
public boolean collapseImportContainer()Returnstrue
if import containers should be collapsed.- Returns:
true
if import containers should be collapsed
-
collapseInnerTypes
public boolean collapseInnerTypes()Returnstrue
if inner types should be collapsed.- Returns:
true
if inner types should be collapsed
-
collapseJavadoc
public boolean collapseJavadoc()Returnstrue
if javadoc comments should be collapsed.- Returns:
true
if javadoc comments should be collapsed
-
collapseMembers
public boolean collapseMembers()Returnstrue
if methods should be collapsed.- Returns:
true
if methods should be collapsed
-