public abstract class Wrap
extends java.lang.Object
Block.getWrap()
Constructor and Description |
---|
Wrap() |
Modifier and Type | Method and Description |
---|---|
static Wrap |
createChildWrap(Wrap parentWrap,
WrapType wrapType,
boolean wrapFirstElement)
Creates a low priority wrap setting of the specified type.
|
static Wrap |
createWrap(int type,
boolean wrapFirstElement)
Creates a block wrap setting of the legacy representation of specified wrap type (see
WrapType.getLegacyRepresentation() ). |
static Wrap |
createWrap(WrapType type,
boolean wrapFirstElement)
Creates a block wrap setting of the specified type.
|
abstract void |
ignoreParentWraps()
Converts a low-priority wrap setting to a regular wrap setting.
|
public abstract void ignoreParentWraps()
createChildWrap(Wrap, WrapType, boolean)
public static Wrap createWrap(int type, boolean wrapFirstElement)
WrapType.getLegacyRepresentation()
).type
- the type of the wrap setting.wrapFirstElement
- determines if first block between the multiple blocks that use the same wrap object should be wrappedcreateWrap(WrapType, boolean)
public static Wrap createWrap(WrapType type, boolean wrapFirstElement)
'wrap first element'
flag. It affects a situation
when there are multiple blocks that share the same wrap object. It determines if the first block
should be wrapped when subsequent blocks exceeds right margin.
Example:
| foo(123, 4|56 | | <- right marginConsider that blocks
'123'
and '456'
share the same wrap object. The wrap is made on the block
'123'
if 'wrap first element'
flag is true
; on the block '456'
otherwise
Note: giving 'false'
argument doesn't mean that a single block that uses that wrap can't be wrapped.
Example:
| foo(12|3); | | <- right marginLet block
'123'
use a wrap that was created with false
as a 'wrap first element'
argument.
The block is wrapped by the formatter then because there is no other block that uses the same wrap object and right margin is
exceeded.type
- the type of the wrap setting.wrapFirstElement
- determines if first block between the multiple blocks that use the same wrap object should be wrappedpublic static Wrap createChildWrap(Wrap parentWrap, WrapType wrapType, boolean wrapFirstElement)
parentWrap
- the parent for this wrap setting.wrapType
- the type of the wrap setting.wrapFirstElement
- if true, the first element in a sequence of elements of the same type
is also wrapped.ignoreParentWraps()