Package com._1c.g5.v8.dt.bsl.ui.folding
Class BslFoldingRegionProvider
- java.lang.Object
-
- org.eclipse.xtext.ui.editor.folding.DefaultFoldingRegionProvider
-
- com._1c.g5.v8.dt.lcore.ui.folding.CustomFoldingRegionProvider
-
- com._1c.g5.v8.dt.bsl.ui.folding.BslFoldingRegionProvider
-
- All Implemented Interfaces:
org.eclipse.xtext.ui.editor.folding.IFoldingRegionProvider
public class BslFoldingRegionProvider extends CustomFoldingRegionProvider
Custom folding for BSL- See Also:
DefaultFoldingRegionProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected FoldingPreferences
preferences
-
Constructor Summary
Constructors Constructor Description BslFoldingRegionProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
computeCommentFolding(org.eclipse.xtext.ui.editor.model.IXtextDocument xtextDocument, org.eclipse.xtext.ui.editor.folding.IFoldingRegionAcceptor<org.eclipse.xtext.util.ITextRegion> foldingRegionAcceptor)
no multiline comment in BSLprotected void
computeObjectFolding(org.eclipse.emf.ecore.EObject eObject, org.eclipse.xtext.ui.editor.folding.IFoldingRegionAcceptor<org.eclipse.xtext.util.ITextRegion> foldingRegionAcceptor)
protected org.eclipse.xtext.ui.editor.folding.IFoldingRegionAcceptor<org.eclipse.xtext.util.ITextRegion>
createAcceptor(org.eclipse.xtext.ui.editor.model.IXtextDocument xtextDocument, Collection<org.eclipse.xtext.ui.editor.folding.FoldedPosition> foldedPositions)
Collection<org.eclipse.xtext.ui.editor.folding.FoldedPosition>
getFoldingRegions(org.eclipse.xtext.ui.editor.model.IXtextDocument xtextDocument)
protected boolean
isConditionStatement(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is condition statementprotected boolean
isControlFlowFoldingEnabled(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is control flow object and folding for it is enabledprotected boolean
isControlFlowStatement(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is control flow objectprotected boolean
isHandled(org.eclipse.emf.ecore.EObject eObject)
protected boolean
isInitiallyCollapsed(org.eclipse.emf.ecore.EObject eObject)
Returns whether the given folded object should be initially collapsed.protected boolean
isLoopStatement(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is loopprotected boolean
isPreprocessorBlock(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is preprocessorprotected boolean
isPreprocessorFoldingEnabled(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is preprocessor and folding for preprocessor is enabledprotected boolean
isTryExceptFoldingEnabled(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is try\except statement and folding for it is enabledprotected boolean
shouldProcessContent(org.eclipse.emf.ecore.EObject object)
protected boolean
shouldProcessMethodContent()
Checks if folding enabled for ant statements in method
-
-
-
Field Detail
-
preferences
@Inject protected FoldingPreferences preferences
-
-
Method Detail
-
getFoldingRegions
public Collection<org.eclipse.xtext.ui.editor.folding.FoldedPosition> getFoldingRegions(org.eclipse.xtext.ui.editor.model.IXtextDocument xtextDocument)
- Specified by:
getFoldingRegions
in interfaceorg.eclipse.xtext.ui.editor.folding.IFoldingRegionProvider
- Overrides:
getFoldingRegions
in classorg.eclipse.xtext.ui.editor.folding.DefaultFoldingRegionProvider
-
createAcceptor
protected org.eclipse.xtext.ui.editor.folding.IFoldingRegionAcceptor<org.eclipse.xtext.util.ITextRegion> createAcceptor(org.eclipse.xtext.ui.editor.model.IXtextDocument xtextDocument, Collection<org.eclipse.xtext.ui.editor.folding.FoldedPosition> foldedPositions)
- Overrides:
createAcceptor
in classCustomFoldingRegionProvider
-
computeCommentFolding
protected void computeCommentFolding(org.eclipse.xtext.ui.editor.model.IXtextDocument xtextDocument, org.eclipse.xtext.ui.editor.folding.IFoldingRegionAcceptor<org.eclipse.xtext.util.ITextRegion> foldingRegionAcceptor)
no multiline comment in BSL- Overrides:
computeCommentFolding
in classorg.eclipse.xtext.ui.editor.folding.DefaultFoldingRegionProvider
-
isInitiallyCollapsed
protected boolean isInitiallyCollapsed(org.eclipse.emf.ecore.EObject eObject)
Description copied from class:CustomFoldingRegionProvider
Returns whether the given folded object should be initially collapsed.- Overrides:
isInitiallyCollapsed
in classCustomFoldingRegionProvider
- Parameters:
eObject
- notnull
- Returns:
true
if the given object is to be initially collapsed, andfalse
otherwise
-
isHandled
protected boolean isHandled(org.eclipse.emf.ecore.EObject eObject)
- Overrides:
isHandled
in classorg.eclipse.xtext.ui.editor.folding.DefaultFoldingRegionProvider
-
shouldProcessContent
protected boolean shouldProcessContent(org.eclipse.emf.ecore.EObject object)
- Overrides:
shouldProcessContent
in classorg.eclipse.xtext.ui.editor.folding.DefaultFoldingRegionProvider
-
shouldProcessMethodContent
protected boolean shouldProcessMethodContent()
Checks if folding enabled for ant statements in method- Returns:
- true if folding enabled for ant statements in method
-
isTryExceptFoldingEnabled
protected boolean isTryExceptFoldingEnabled(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is try\except statement and folding for it is enabled- Parameters:
eObject
- the context object (notnull
)- Returns:
- true if given object is try\except statement and folding for it is enabled
-
isControlFlowFoldingEnabled
protected boolean isControlFlowFoldingEnabled(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is control flow object and folding for it is enabled- Parameters:
eObject
- the context object (notnull
)- Returns:
- true if given object is control flow object and folding for it is enabled
-
isControlFlowStatement
protected boolean isControlFlowStatement(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is control flow object- Parameters:
eObject
- the context object (notnull
)- Returns:
- true if given object is control flow object
-
isLoopStatement
protected boolean isLoopStatement(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is loop- Parameters:
eObject
- the context object (notnull
)- Returns:
- true if given object is loop
-
isConditionStatement
protected boolean isConditionStatement(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is condition statement- Parameters:
eObject
- the context object (notnull
)- Returns:
- true if given object is condition statement
-
isPreprocessorFoldingEnabled
protected boolean isPreprocessorFoldingEnabled(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is preprocessor and folding for preprocessor is enabled- Parameters:
eObject
- the context object (notnull
)- Returns:
- true if given object is preprocessor and folding for preprocessor is enabled
-
isPreprocessorBlock
protected boolean isPreprocessorBlock(org.eclipse.emf.ecore.EObject eObject)
Checks if given object is preprocessor- Parameters:
eObject
- the context object (notnull
)- Returns:
- true if given object is preprocessor
-
computeObjectFolding
protected void computeObjectFolding(org.eclipse.emf.ecore.EObject eObject, org.eclipse.xtext.ui.editor.folding.IFoldingRegionAcceptor<org.eclipse.xtext.util.ITextRegion> foldingRegionAcceptor)
- Overrides:
computeObjectFolding
in classCustomFoldingRegionProvider
-
-