com.hfg.xml.msoffice2003.spreadsheetml.ExcelColumn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com_hfg Show documentation
Show all versions of com_hfg Show documentation
com.hfg xml, html, svg, and bioinformatics utility library
package com.hfg.xml.msoffice2003.spreadsheetml;
import com.hfg.xml.XMLTag;
//------------------------------------------------------------------------------
/**
Excel table column. All Column elements for a spreadsheet must follow the Table
element and precede the first Row element.
@author J. Alex Taylor, hairyfatguy.com
*/
//------------------------------------------------------------------------------
// com.hfg Library
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
// [email protected]
//------------------------------------------------------------------------------
public class ExcelColumn extends XMLTag
{
//---------------------------------------------------------------------------
public ExcelColumn()
{
super(SpreadsheetML.COLUMN);
}
//---------------------------------------------------------------------------
/**
Specifies whether the column should be automatically sized in Excel to display
the entire length of numeric and date values (columns are not automatically re-sized for other data types).
*/
public ExcelColumn setAutoFitWidth(boolean inValue)
{
setAttribute(SpreadsheetML.AUTO_FIT_WIDTH_ATT, inValue);
return this;
}
//---------------------------------------------------------------------------
/**
Specifies whether the column should be hidden or not.
*/
public ExcelColumn setHidden(boolean inValue)
{
setAttribute(SpreadsheetML.HIDDEN_ATT, inValue);
return this;
}
//---------------------------------------------------------------------------
/**
If index values are not specified, the columns are assumed to be consecutive.
*/
public ExcelColumn setIndex(int inValue)
{
setAttribute(SpreadsheetML.INDEX_ATT, inValue);
return this;
}
//---------------------------------------------------------------------------
/**
The Span attribute of a Column element the specified number of columns to the right
of the Column element with the Span attribute to be formatted exactly like that Column element.
*/
public ExcelColumn setSpan(int inValue)
{
setAttribute(SpreadsheetML.SPAN_ATT, inValue);
return this;
}
//---------------------------------------------------------------------------
public ExcelColumn setStyleId(String inValue)
{
setAttribute(SpreadsheetML.STYLE_ID_ATT, inValue);
return this;
}
//---------------------------------------------------------------------------
public ExcelColumn setWidth(int inValue)
{
setAttribute(SpreadsheetML.WIDTH_ATT, inValue + "");
return this;
}
}