Package org.eclipse.draw2d.text
Interface FlowContext
- All Known Implementing Classes:
- BlockFlowLayout,- FlowContainerLayout,- InlineFlowLayout,- PageFlowLayout
public interface FlowContext
The context that a 
FlowFigureLayout uses to perform its layout.
 WARNING: This interface is not intended to be implemented by clients. It exists to define the API between the layout and its context.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddLine(CompositeBox box) Adds an entire line into the context.voidaddToCurrentLine(FlowBox box) Adds the given box into the current line.voidendLine()The current line should be committed if it is occupied, and then set tonull.booleanThis method is used to convey layout state to different FlowFigures.intThis method can be used to query the amount of space left on the current line.voidgetWidthLookahead(FlowFigure child, int[] width) This method looks ahead for line-breaks.booleanvoidsetContinueOnSameLine(boolean value) This method is used to convey layout state to different FlowFigures.
- 
Method Details- 
addToCurrentLineAdds the given box into the current line.- Parameters:
- box- the FlowBox to add
 
- 
addLineAdds an entire line into the context. If there is a previous line, it is ended.- Parameters:
- box- the line being added
- Since:
- 3.1
 
- 
endLinevoid endLine()The current line should be committed if it is occupied, and then set tonull. Otherwise, do nothing.
- 
getRemainingLineWidthint getRemainingLineWidth()This method can be used to query the amount of space left on the current line. It can help determine where to wrap during layout.- Returns:
- the amount of space left on the current line
- Since:
- 3.1
 
- 
getContinueOnSameLineboolean getContinueOnSameLine()This method is used to convey layout state to different FlowFigures. This state is cleared when a fragment is added to the current line and once the layout is complete.- Returns:
- trueif the next fragment should be placed on the current line
- Since:
- 3.1
- See Also:
 
- 
getWidthLookaheadThis method looks ahead for line-breaks. When laying out, this method can be used to determine the next line-break across multiple figures.- Parameters:
- child- the search will occur starting from the figure after the given child
- width- the width before the next line-break (if one's found; all the width, otherwise) will be added on to the first int in the given array
- Since:
- 3.1
 
- 
isCurrentLineOccupiedboolean isCurrentLineOccupied()- Returns:
- trueif the current line contains any fragments
 
- 
setContinueOnSameLinevoid setContinueOnSameLine(boolean value) This method is used to convey layout state to different FlowFigures. This state is cleared when a fragment is added and once the layout is complete.- Parameters:
- value-- trueindicates that the first fragment of the next TextFlow should be laid out on the current line, and not a new one
- Since:
- 3.1
- See Also:
 
 
-