* Called by flush(), adds the BlockBox associated with this BlockFlowLayout
* to the current line and then ends the line.
*/
protected void endBlock() {
layoutLines();
ICSSStyle style = getCSSStyle();
if (style != null) {
int minWidth = 0;
int minHeight = 0;
// try to see whether there is any designer specified min size
ITagEditInfo info = (ITagEditInfo) style
.getAdapter(ITagEditInfo.class);
if (info != null) {
minWidth = info.getMinWidth();
minHeight = info.getMinHeight();
}
// CSS also has the min-width/min-height property. We should also
// get that,
// and using the max of the "min-width" css property and the
// designer specified min size.
int height = getLengthValue(style, ICSSPropertyID.ATTR_MIN_HEIGHT);
if (height > minHeight) {
minHeight = height;
}
int width = getLengthValue(style, ICSSPropertyID.ATTR_MIN_WIDTH);
if (width > minWidth) {
minWidth = width;
}
if (minHeight > _blockBox.getHeight()) {
_blockBox.setHeight(minHeight);
}
if (minWidth > _blockBox.getWidth()) {
_blockBox.setWidth(minWidth);
}
}
// reset scroll information.
this._needHScroll = this._needVScroll = false;
// ok, now we need to adjust the _blockBox's size according to the
// "overflow" setting.
// depends on different "overflow" style of this block, different sizing
// policy may apply.
// ICSSStyle style = this.getCSSStyle();
if (style != null) {
Object overflow = style
.getStyleProperty(ICSSPropertyID.ATTR_OVERFLOW);
if (ICSSPropertyID.VAL_HIDDEN.equals(overflow)) {
if (_userSpecifiedWidth > 0) {
_blockBox.setWidth(_userSpecifiedWidth);
}