本文整理汇总了Java中jxl.write.WritableCellFeatures类的典型用法代码示例。如果您正苦于以下问题:Java WritableCellFeatures类的具体用法?Java WritableCellFeatures怎么用?Java WritableCellFeatures使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WritableCellFeatures类属于jxl.write包,在下文中一共展示了WritableCellFeatures类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CellValue
import jxl.write.WritableCellFeatures; //导入依赖的package包/类
/**
* Constructor used when creating a writable cell from a read-only cell
* (when copying a workbook)
*
* @param c the cell to clone
* @param t the type of this cell
*/
protected CellValue(Type t, Cell c)
{
this(t, c.getColumn(), c.getRow());
copied = true;
format = (XFRecord) c.getCellFormat();
if (c.getCellFeatures() != null)
{
features = new WritableCellFeatures(c.getCellFeatures());
features.setWritableCell(this);
}
}
示例2: setCellFeatures
import jxl.write.WritableCellFeatures; //导入依赖的package包/类
/**
* Sets the cell features
*
* @param cf the cell features
*/
public void setCellFeatures(WritableCellFeatures cf)
{
if (features != null)
{
logger.warn("current cell features for " +
CellReferenceHelper.getCellReference(this) +
" not null - overwriting");
// Check to see if the features include a shared data validation
if (features.hasDataValidation() &&
features.getDVParser() != null &&
features.getDVParser().extendedCellsValidation())
{
DVParser dvp = features.getDVParser();
logger.warn("Cannot add cell features to " +
CellReferenceHelper.getCellReference(this) +
" because it is part of the shared cell validation " +
"group " +
CellReferenceHelper.getCellReference(dvp.getFirstColumn(),
dvp.getFirstRow()) +
"-" +
CellReferenceHelper.getCellReference(dvp.getLastColumn(),
dvp.getLastRow()));
return;
}
}
features = cf;
cf.setWritableCell(this);
// If the cell is already on the worksheet, then add the cell features
// to the workbook
if (referenced)
{
addCellFeatures();
}
}
示例3: setCellFeatures
import jxl.write.WritableCellFeatures; //导入依赖的package包/类
/**
* Accessor for the cell features
*/
public void setCellFeatures(WritableCellFeatures wcf)
{
}
示例4: removeSharedDataValidation
import jxl.write.WritableCellFeatures; //导入依赖的package包/类
/**
* Remove the shared data validation from multiple cells. The cell passed
* in is the top left cell. The data validation is removed from this
* cell and all cells which share the same validation.
*
* @param cell the top left cell containing the shared data validation
*/
public void removeSharedDataValidation(WritableCell cell)
throws WriteException
{
WritableCellFeatures wcf = cell.getWritableCellFeatures();
if (wcf == null ||
!wcf.hasDataValidation())
{
return;
}
DVParser dvp = wcf.getDVParser();
// If the cell is not part of an extended validation, then simply call
// the atomic remove validation from the cell features
if (!dvp.extendedCellsValidation())
{
wcf.removeDataValidation();
return;
}
// Check that the cell validation being removed is in the top left of the
// validated area
if (dvp.extendedCellsValidation())
{
if (cell.getColumn() != dvp.getFirstColumn() ||
cell.getRow() != dvp.getFirstRow())
{
logger.warn("Cannot remove data validation from " +
CellReferenceHelper.getCellReference(dvp.getFirstColumn(),
dvp.getFirstRow()) +
"-" +
CellReferenceHelper.getCellReference(dvp.getLastColumn(),
dvp.getLastRow()) +
" because the selected cell " +
CellReferenceHelper.getCellReference(cell) +
" is not the top left cell in the range");
return;
}
}
for (int y = dvp.getFirstRow(); y <= dvp.getLastRow(); y++)
{
for (int x = dvp.getFirstColumn(); x <= dvp.getLastColumn(); x++)
{
CellValue c2 = (CellValue) rows[y].getCell(x);
// It's possible that some cells in the shared data range might
// be null eg. in the event of an insertRow or insertColumn
if (c2 != null)
{
c2.getWritableCellFeatures().removeSharedDataValidation();
c2.removeCellFeatures();
}
}
}
// Remove this shared validation from any data validations that were
// copied in
if (dataValidation != null)
{
dataValidation.removeSharedDataValidation(dvp.getFirstColumn(),
dvp.getFirstRow(),
dvp.getLastColumn(),
dvp.getLastRow());
}
}
示例5: addCell
import jxl.write.WritableCellFeatures; //导入依赖的package包/类
/**
* Adds a cell to this row, growing the array of cells as required
*
* @param cv the cell to add
*/
public void addCell(CellValue cv)
{
int col = cv.getColumn();
if (col >= maxColumns)
{
logger.warn("Could not add cell at " +
CellReferenceHelper.getCellReference(cv.getRow(),
cv.getColumn()) +
" because it exceeds the maximum column limit");
return;
}
// Grow the array if needs be
if (col >= cells.length)
{
CellValue[] oldCells = cells;
cells = new CellValue[Math.max(oldCells.length + growSize, col+1)];
System.arraycopy(oldCells, 0, cells, 0, oldCells.length);
oldCells = null;
}
// Remove any cell features from the cell being replaced
if (cells[col] != null)
{
WritableCellFeatures wcf = cells[col].getWritableCellFeatures();
if (wcf != null)
{
wcf.removeComment();
// if the cell is part of a shared data validation,then don't remove
// the validation
if (wcf.getDVParser() != null &&
!wcf.getDVParser().extendedCellsValidation())
{
wcf.removeDataValidation();
}
}
}
cells[col] = cv;
numColumns = Math.max(col+1, numColumns);
}
示例6: getWritableCellFeatures
import jxl.write.WritableCellFeatures; //导入依赖的package包/类
/**
* Accessor for the cell features
*
* @return the cell features or NULL if this cell doesn't have any
*/
public WritableCellFeatures getWritableCellFeatures()
{
return null;
}
示例7: getWritableCellFeatures
import jxl.write.WritableCellFeatures; //导入依赖的package包/类
/**
* Accessor for the cell features
*
* @return the cell features or NULL if this cell doesn't have any
*/
public WritableCellFeatures getWritableCellFeatures()
{
return features;
}