TextBoxOptions

Inheritance: java.lang.Object

public class TextBoxOptions

Represents the text options of the shape

Example

         //Instantiating a Workbook object
         Workbook workbook = new Workbook();
         int index = workbook.getWorksheets().get(0).getTextBoxes().add(0, 0, 350, 350);
         Shape shape = workbook.getWorksheets().get(0).getTextBoxes().get(index);
         shape.setText("This is test.");
 
         //do your business
 
         //Save the excel file.
         workbook.save("exmaple.xlsx");

Methods

MethodDescription
equals(Object arg0)
getAllowTextToOverflow()Whether allow text to overflow shape.
getBottomMarginPt()Returns the bottom margin in unit of Points
getClass()
getLeftMarginPt()Gets the left margin in unit of Points.
getResizeToFitText()Indicates whether to resize the shape to fit the text
getRightMarginPt()Gets the right margin in unit of Points.
getShapeTextDirection()Gets the text display direction within a given text body.
getShapeTextVerticalAlignment()It corresponds to “Format Shape - Text Options - Text Box - Vertical Alignment” in Excel.
getTopMarginPt()Gets the top margin in unit of Points.
getWrapTextInShape()Specifies text wrapping within a shape.
hashCode()
notify()
notifyAll()
setAllowTextToOverflow(boolean value)Whether allow text to overflow shape.
setBottomMarginPt(double value)Returns the bottom margin in unit of Points
setLeftMarginPt(double value)Sets the left margin in unit of Points.
setResizeToFitText(boolean value)Indicates whether to resize the shape to fit the text
setRightMarginPt(double value)Sets the right margin in unit of Points.
setShapeTextDirection(int value)Sets the text display direction within a given text body.
setShapeTextVerticalAlignment(int value)It corresponds to “Format Shape - Text Options - Text Box - Vertical Alignment” in Excel.
setTopMarginPt(double value)Sets the top margin in unit of Points.
setWrapTextInShape(boolean value)Specifies text wrapping within a shape.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAllowTextToOverflow()

public boolean getAllowTextToOverflow()

Whether allow text to overflow shape.

Example

         shape.getTextBoxOptions().setAllowTextToOverflow(true);

Returns: boolean

getBottomMarginPt()

public double getBottomMarginPt()

Returns the bottom margin in unit of Points

Example

         shape.getTextBoxOptions().setBottomMarginPt(0.2d);

Returns: double

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getLeftMarginPt()

public double getLeftMarginPt()

Gets the left margin in unit of Points.

Example

         shape.getTextBoxOptions().setLeftMarginPt(0.2d);

Returns: double

getResizeToFitText()

public boolean getResizeToFitText()

Indicates whether to resize the shape to fit the text

Example

         shape.getTextBoxOptions().setResizeToFitText(true);

Returns: boolean

getRightMarginPt()

public double getRightMarginPt()

Gets the right margin in unit of Points.

Example

         shape.getTextBoxOptions().setRightMarginPt(0.2d);

Returns: double

getShapeTextDirection()

public int getShapeTextDirection()

Gets the text display direction within a given text body. It corresponds to “Format Shape - Text Options - Text Box - Text direction” in Excel

See TextVerticalType.

Example

         shape.getTextBoxOptions().setShapeTextDirection(TextVerticalType.VERTICAL);

Returns: int

getShapeTextVerticalAlignment()

public int getShapeTextVerticalAlignment()

It corresponds to “Format Shape - Text Options - Text Box - Vertical Alignment” in Excel.

See ShapeTextVerticalAlignmentType.

Example

         shape.getTextBoxOptions().setShapeTextVerticalAlignment(ShapeTextVerticalAlignmentType.LEFT);

Returns: int

getTopMarginPt()

public double getTopMarginPt()

Gets the top margin in unit of Points.

Example

         shape.getTextBoxOptions().setTopMarginPt(0.2d);

Returns: double

getWrapTextInShape()

public boolean getWrapTextInShape()

Specifies text wrapping within a shape. False - No wrapping will occur on text body. True - Wrapping will occur on text body.

Example

         shape.getTextBoxOptions().setWrapTextInShape(true);

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAllowTextToOverflow(boolean value)

public void setAllowTextToOverflow(boolean value)

Whether allow text to overflow shape.

Parameters:

ParameterTypeDescription
valueboolean

setBottomMarginPt(double value)

public void setBottomMarginPt(double value)

Returns the bottom margin in unit of Points

Parameters:

ParameterTypeDescription
valuedouble

setLeftMarginPt(double value)

public void setLeftMarginPt(double value)

Sets the left margin in unit of Points.

Parameters:

ParameterTypeDescription
valuedouble

setResizeToFitText(boolean value)

public void setResizeToFitText(boolean value)

Indicates whether to resize the shape to fit the text

Parameters:

ParameterTypeDescription
valueboolean

setRightMarginPt(double value)

public void setRightMarginPt(double value)

Sets the right margin in unit of Points.

Parameters:

ParameterTypeDescription
valuedouble

setShapeTextDirection(int value)

public void setShapeTextDirection(int value)

Sets the text display direction within a given text body. It corresponds to “Format Shape - Text Options - Text Box - Text direction” in Excel

See TextVerticalType.

Parameters:

ParameterTypeDescription
valueint

setShapeTextVerticalAlignment(int value)

public void setShapeTextVerticalAlignment(int value)

It corresponds to “Format Shape - Text Options - Text Box - Vertical Alignment” in Excel.

See ShapeTextVerticalAlignmentType.

Parameters:

ParameterTypeDescription
valueint

setTopMarginPt(double value)

public void setTopMarginPt(double value)

Sets the top margin in unit of Points.

Parameters:

ParameterTypeDescription
valuedouble

setWrapTextInShape(boolean value)

public void setWrapTextInShape(boolean value)

Specifies text wrapping within a shape. False - No wrapping will occur on text body. True - Wrapping will occur on text body.

Parameters:

ParameterTypeDescription
valueboolean

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int