Class Segment
java.lang.Object
org.eclipse.jface.text.Position
org.eclipse.jface.text.projection.Segment
Internal class. Do not use. Only public for testing purposes.
A segment is the image of a master document fragment in a projection document.
- Since:
- 3.0
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe corresponding fragment for this segment.booleanA flag indicating that the segment updater should shift this segment when a change happens at its boundaries.booleanA flag indicating that the segment updater should stretch this segment when a change happens at its boundaries. -
Constructor Summary
ConstructorsConstructorDescriptionSegment(int offset, int length) Creates a new segment covering the given range. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the shifting and the stretching flag.booleanReturnstrueif the shifting flag is set,falseotherwise.booleanReturnstrueif the stretching flag is set,falseotherwise.voidSets the shifting flag.voidSets the stretching flag.
-
Field Details
-
fragment
The corresponding fragment for this segment. -
isMarkedForStretch
public boolean isMarkedForStretchA flag indicating that the segment updater should stretch this segment when a change happens at its boundaries. -
isMarkedForShift
public boolean isMarkedForShiftA flag indicating that the segment updater should shift this segment when a change happens at its boundaries.
-
-
Constructor Details
-
Segment
public Segment(int offset, int length) Creates a new segment covering the given range.- Parameters:
offset- the offset of the segmentlength- the length of the segment
-
-
Method Details
-
markForStretch
public void markForStretch()Sets the stretching flag. -
isMarkedForStretch
public boolean isMarkedForStretch()Returnstrueif the stretching flag is set,falseotherwise.- Returns:
trueif the stretching flag is set,falseotherwise
-
markForShift
public void markForShift()Sets the shifting flag. -
isMarkedForShift
public boolean isMarkedForShift()Returnstrueif the shifting flag is set,falseotherwise.- Returns:
trueif the shifting flag is set,falseotherwise
-
clearMark
public void clearMark()Clears the shifting and the stretching flag.
-