com.intellij.formatting
Class Wrap

java.lang.Object
  extended by com.intellij.formatting.Wrap

public abstract class Wrap
extends java.lang.Object

The wrap setting for a formatting model block. Indicates the conditions under which a line break is inserted before the block when formatting, if the block extends beyond the right margin.

See Also:
Block.getWrap()

Field Summary
static WrapType ALWAYS
           
static WrapType CHOP_DOWN_IF_LONG
           
static WrapType NONE
           
static WrapType NORMAL
           
 
Constructor Summary
Wrap()
           
 
Method Summary
static Wrap createChildWrap(Wrap parentWrap, WrapType wrapType, boolean wrapFirstElement)
          Creates a low priority wrap setting of the specified type.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALWAYS

public static WrapType ALWAYS

NORMAL

public static WrapType NORMAL

NONE

public static WrapType NONE

CHOP_DOWN_IF_LONG

public static WrapType CHOP_DOWN_IF_LONG
Constructor Detail

Wrap

public Wrap()
Method Detail

ignoreParentWraps

public abstract void ignoreParentWraps()
Converts a low-priority wrap setting to a regular wrap setting.

See Also:
createChildWrap(Wrap, WrapType, boolean)

createWrap

public static Wrap createWrap(WrapType type,
                              boolean wrapFirstElement)
Creates a block wrap setting of the specified type.

Parameters:
type - the type of the wrap setting.
wrapFirstElement - if true, the first element in a sequence of elements of the same type is also wrapped.
Returns:
the wrap setting instance.

createChildWrap

public static Wrap createChildWrap(Wrap parentWrap,
                                   WrapType wrapType,
                                   boolean wrapFirstElement)
Creates a low priority wrap setting of the specified type. If the formatter detects that the line should be wrapped at a location of the child wrap, the line is wrapped at the position of its parent wrap instead.

Parameters:
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.
Returns:
the wrap setting instance.
See Also:
ignoreParentWraps()