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 TypeMethodDescriptionvoidaddProjectionRange(DefaultJavaFoldingStructureProvider.JavaProjectionAnnotation annotation, org.eclipse.jface.text.Position position) Adds a projection (folding) region to this context.booleanReturnstrueif newly created folding regions may be collapsed,falseif not.booleanReturnstrueif custom regions should be collapsed.booleanReturnstrueif header comments should be collapsed.booleanReturnstrueif import containers should be collapsed.booleanReturnstrueif inner types should be collapsed.booleanReturnstrueif javadoc comments should be collapsed.booleanReturnstrueif methods should be collapsed.
-
Method Details
-
allowCollapsing
public boolean allowCollapsing()Returnstrueif newly created folding regions may be collapsed,falseif not. This is usuallyfalsewhen updating the folding structure while typing; it may betruewhen computing or restoring the initial folding structure.- Returns:
trueif newly created folding regions may be collapsed,falseif 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 theProjectionAnnotationModelof theProjectionViewerof the editor.- Parameters:
annotation- the annotation to addposition- the corresponding position
-
collapseHeaderComments
public boolean collapseHeaderComments()Returnstrueif header comments should be collapsed.- Returns:
trueif header comments should be collapsed
-
collapseImportContainer
public boolean collapseImportContainer()Returnstrueif import containers should be collapsed.- Returns:
trueif import containers should be collapsed
-
collapseInnerTypes
public boolean collapseInnerTypes()Returnstrueif inner types should be collapsed.- Returns:
trueif inner types should be collapsed
-
collapseJavadoc
public boolean collapseJavadoc()Returnstrueif javadoc comments should be collapsed.- Returns:
trueif javadoc comments should be collapsed
-
collapseMembers
public boolean collapseMembers()Returnstrueif methods should be collapsed.- Returns:
trueif methods should be collapsed
-
collapseCustomRegions
public boolean collapseCustomRegions()Returnstrueif custom regions should be collapsed.- Returns:
trueif custom regions should be collapsed- Since:
- 3.35
-