Class RichStringToLineModel
- java.lang.Object
-
- org.eclipse.xtend.core.richstring.AbstractRichStringPartAcceptor
-
- org.eclipse.xtend.core.richstring.AbstractRichStringPartAcceptor.ForLoopOnce
-
- org.eclipse.xtend.core.formatting2.RichStringToLineModel
-
- All Implemented Interfaces:
IRichStringPartAcceptor
public class RichStringToLineModel extends AbstractRichStringPartAcceptor.ForLoopOnce
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.xtend.core.richstring.AbstractRichStringPartAcceptor
AbstractRichStringPartAcceptor.ForLoopOnce
-
-
Constructor Summary
Constructors Constructor Description RichStringToLineModel(org.eclipse.xtext.formatting2.regionaccess.ITextRegionAccess nodeModelAccess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptElse()
Announces that anvoid
acceptElseIfCondition(org.eclipse.xtext.xbase.XExpression condition)
Announces that anvoid
acceptEndFor(org.eclipse.xtext.xbase.XExpression after, java.lang.CharSequence indentation)
Announces that anvoid
acceptEndIf()
Announces that anvoid
acceptExpression(org.eclipse.xtext.xbase.XExpression expression, java.lang.CharSequence indentation)
Announces that anvoid
acceptForLoop(org.eclipse.xtext.common.types.JvmFormalParameter parameter, org.eclipse.xtext.xbase.XExpression expression)
Announces that avoid
acceptIfCondition(org.eclipse.xtext.xbase.XExpression condition)
Announces that anvoid
acceptLineBreak(int charCount, boolean semantic, boolean startNewLine)
void
acceptSemanticLineBreak(int charCount, RichStringLiteral origin, boolean controlStructureSeen)
Indicates a semantic line break in a rich string literal.void
acceptSemanticText(java.lang.CharSequence text, RichStringLiteral origin)
void
acceptTemplateLineBreak(int charCount, RichStringLiteral origin)
Indicates a template line break in a rich string literal.void
acceptTemplateText(java.lang.CharSequence text, RichStringLiteral origin)
void
announceNextLiteral(RichStringLiteral object)
Announces that a next literal will be processed.void
finish()
LineModel
getModel()
protected int
literalPostfixLenght(org.eclipse.xtext.formatting2.regionaccess.ITextSegment node)
protected int
literalPrefixLenght(org.eclipse.xtext.formatting2.regionaccess.ITextSegment node)
boolean
outdentThisLine()
void
startContent()
-
Methods inherited from class org.eclipse.xtend.core.richstring.AbstractRichStringPartAcceptor.ForLoopOnce
forLoopHasNext
-
-
-
-
Method Detail
-
outdentThisLine
public boolean outdentThisLine()
-
finish
public void finish()
-
literalPrefixLenght
protected int literalPrefixLenght(org.eclipse.xtext.formatting2.regionaccess.ITextSegment node)
-
literalPostfixLenght
protected int literalPostfixLenght(org.eclipse.xtext.formatting2.regionaccess.ITextSegment node)
-
announceNextLiteral
public void announceNextLiteral(RichStringLiteral object)
Description copied from interface:IRichStringPartAcceptor
Announces that a next literal will be processed.- Specified by:
announceNextLiteral
in interfaceIRichStringPartAcceptor
- Overrides:
announceNextLiteral
in classAbstractRichStringPartAcceptor
- Parameters:
object
- the literal.
-
acceptSemanticLineBreak
public void acceptSemanticLineBreak(int charCount, RichStringLiteral origin, boolean controlStructureSeen)
Description copied from interface:IRichStringPartAcceptor
Indicates a semantic line break in a rich string literal.- Specified by:
acceptSemanticLineBreak
in interfaceIRichStringPartAcceptor
- Overrides:
acceptSemanticLineBreak
in classAbstractRichStringPartAcceptor
- Parameters:
charCount
- the number of characters in the line break.origin
- the instance holding the complete text value that contains the line break.controlStructureSeen
- whether or not the line break occurs in a line that contains a control structure.
-
acceptTemplateLineBreak
public void acceptTemplateLineBreak(int charCount, RichStringLiteral origin)
Description copied from interface:IRichStringPartAcceptor
Indicates a template line break in a rich string literal.- Specified by:
acceptTemplateLineBreak
in interfaceIRichStringPartAcceptor
- Overrides:
acceptTemplateLineBreak
in classAbstractRichStringPartAcceptor
- Parameters:
charCount
- the number of characters in the line break.origin
- the instance holding the complete text value that contains the line break.
-
acceptLineBreak
public void acceptLineBreak(int charCount, boolean semantic, boolean startNewLine)
-
startContent
public void startContent()
-
acceptSemanticText
public void acceptSemanticText(java.lang.CharSequence text, RichStringLiteral origin)
- Specified by:
acceptSemanticText
in interfaceIRichStringPartAcceptor
- Overrides:
acceptSemanticText
in classAbstractRichStringPartAcceptor
- Parameters:
text
- the semantic text. May not benull
.origin
- the value holder for the full text or null, if unknown.
-
acceptTemplateText
public void acceptTemplateText(java.lang.CharSequence text, RichStringLiteral origin)
- Specified by:
acceptTemplateText
in interfaceIRichStringPartAcceptor
- Overrides:
acceptTemplateText
in classAbstractRichStringPartAcceptor
- Parameters:
text
- the template text. May not benull
.origin
- the value holder for the full text or null, if unknown.
-
acceptExpression
public void acceptExpression(org.eclipse.xtext.xbase.XExpression expression, java.lang.CharSequence indentation)
Description copied from interface:IRichStringPartAcceptor
Announces that an«expression»
has been consumed. If the expression's evaluation result contains more than one line, any line besides the first one may be prefixed with the given indentation.- Specified by:
acceptExpression
in interfaceIRichStringPartAcceptor
- Overrides:
acceptExpression
in classAbstractRichStringPartAcceptor
- Parameters:
expression
- the consumed expression. May not benull
.indentation
- the additional indentation for any line besides the first one.
-
acceptIfCondition
public void acceptIfCondition(org.eclipse.xtext.xbase.XExpression condition)
Description copied from interface:IRichStringPartAcceptor
Announces that an«IF condition»
has been consumed.- Specified by:
acceptIfCondition
in interfaceIRichStringPartAcceptor
- Overrides:
acceptIfCondition
in classAbstractRichStringPartAcceptor
- Parameters:
condition
- the condition of anRichStringIf
.
-
acceptElseIfCondition
public void acceptElseIfCondition(org.eclipse.xtext.xbase.XExpression condition)
Description copied from interface:IRichStringPartAcceptor
Announces that an«ELSEIF condition»
has been consumed.- Specified by:
acceptElseIfCondition
in interfaceIRichStringPartAcceptor
- Overrides:
acceptElseIfCondition
in classAbstractRichStringPartAcceptor
- Parameters:
condition
- the condition of anRichStringElseIf
.
-
acceptElse
public void acceptElse()
Description copied from interface:IRichStringPartAcceptor
Announces that an«ELSE»
has been consumed.- Specified by:
acceptElse
in interfaceIRichStringPartAcceptor
- Overrides:
acceptElse
in classAbstractRichStringPartAcceptor
-
acceptEndIf
public void acceptEndIf()
Description copied from interface:IRichStringPartAcceptor
Announces that an«ENDIF»
has been consumed.- Specified by:
acceptEndIf
in interfaceIRichStringPartAcceptor
- Overrides:
acceptEndIf
in classAbstractRichStringPartAcceptor
-
acceptForLoop
public void acceptForLoop(org.eclipse.xtext.common.types.JvmFormalParameter parameter, org.eclipse.xtext.xbase.XExpression expression)
Description copied from interface:IRichStringPartAcceptor
Announces that a«FOR parameter: expression»
has been consumed.- Specified by:
acceptForLoop
in interfaceIRichStringPartAcceptor
- Overrides:
acceptForLoop
in classAbstractRichStringPartAcceptor.ForLoopOnce
- Parameters:
parameter
- the declared parameter in the for-loop.expression
- the expression that produces anIterable
.
-
acceptEndFor
public void acceptEndFor(org.eclipse.xtext.xbase.XExpression after, java.lang.CharSequence indentation)
Description copied from interface:IRichStringPartAcceptor
Announces that an«ENDFOR»
has been consumed.- Specified by:
acceptEndFor
in interfaceIRichStringPartAcceptor
- Overrides:
acceptEndFor
in classAbstractRichStringPartAcceptor.ForLoopOnce
- Parameters:
after
- the expression that should be evaluated after the last item of the loop, if any.indentation
- the additional indentation for any line besides the first one.
-
getModel
@Pure public LineModel getModel()
-
-