@@ -299,8 +299,9 @@ public long getWidth() {
299
299
* @param width the width that need to set (in Millimeter).
300
300
* <p>An UnsupportedOperationException will be thrown if the table is in the spreadsheet
301
301
* document.
302
+ * @return this {@code OdfTable} instance
302
303
*/
303
- public void setWidth (long width ) {
304
+ public OdfTable setWidth (long width ) {
304
305
if (!mIsSpreadsheet ) {
305
306
String sWidthMM = String .valueOf (width ) + Unit .MILLIMETER .abbr ();
306
307
String sWidthIN = PositiveLength .mapToUnit (sWidthMM , Unit .INCH );
@@ -316,6 +317,8 @@ public void setWidth(long width) {
316
317
} else {
317
318
throw new UnsupportedOperationException ();
318
319
}
320
+
321
+ return this ;
319
322
}
320
323
321
324
static void setLeftTopBorderStyleProperties (OdfStyle style ) {
@@ -1905,10 +1908,11 @@ public String getTableName() {
1905
1908
* Set the table name.
1906
1909
*
1907
1910
* @param tableName the table name
1911
+ * @return this {@code OdfTable} instance
1908
1912
* @throws IllegalArgumentException if the tableName is duplicate with one of tables in the
1909
1913
* current document
1910
1914
*/
1911
- public void setTableName (String tableName ) {
1915
+ public OdfTable setTableName (String tableName ) {
1912
1916
// check if the table name is already exist
1913
1917
boolean isSpreadsheet = mDocument instanceof OdfSpreadsheetDocument ;
1914
1918
List <OdfTable > tableList = mDocument .getTableList (!isSpreadsheet );
@@ -1921,6 +1925,8 @@ public void setTableName(String tableName) {
1921
1925
}
1922
1926
}
1923
1927
mTableElement .setTableNameAttribute (tableName );
1928
+
1929
+ return this ;
1924
1930
}
1925
1931
1926
1932
/**
@@ -1940,9 +1946,11 @@ public boolean isProtected() {
1940
1946
* Set if the table is protected.
1941
1947
*
1942
1948
* @param isProtected the protected attribute of the table to be set
1949
+ * @return this {@code OdfTable} instance
1943
1950
*/
1944
- public void setProtected (boolean isProtected ) {
1951
+ public OdfTable setProtected (boolean isProtected ) {
1945
1952
mTableElement .setTableProtectedAttribute (isProtected );
1953
+ return this ;
1946
1954
}
1947
1955
1948
1956
/**
@@ -1997,6 +2005,7 @@ protected boolean isCellStyleInheritance() {
1997
2005
* inheritance setting have no effect on them.
1998
2006
*
1999
2007
* @param isEnabled if<code>isEnabled</code> is true, cell style will be inherited by new cell.
2008
+ * @return this {@code OdfTable} instance
2000
2009
* @see #isCellStyleInheritance()
2001
2010
* @see #appendColumn()
2002
2011
* @see #appendColumns(int)
@@ -2012,8 +2021,9 @@ protected boolean isCellStyleInheritance() {
2012
2021
* @see #getColumnByIndex(int)
2013
2022
* @see #getRowByIndex(int)
2014
2023
*/
2015
- public void setCellStyleInheritance (boolean isEnabled ) {
2024
+ public OdfTable setCellStyleInheritance (boolean isEnabled ) {
2016
2025
mIsCellStyleInheritance = isEnabled ;
2026
+ return this ;
2017
2027
}
2018
2028
////////////////////////////////////////////////////////////////////////////////////////////
2019
2029
0 commit comments