本文整理汇总了Java中org.jxls.area.Area类的典型用法代码示例。如果您正苦于以下问题:Java Area类的具体用法?Java Area怎么用?Java Area使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Area类属于org.jxls.area包,在下文中一共展示了Area类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processTemplate
import org.jxls.area.Area; //导入依赖的package包/类
private void processTemplate(final Transformer transformer, final Context context) throws IOException, InvalidFormatException
{
//
// Find Areas which we will need to process
final AreaBuilder areaBuilder = new XlsCommentAreaBuilder();
areaBuilder.setTransformer(transformer);
final List<Area> xlsAreaList = areaBuilder.build();
//
// Process those areas
for (final Area xlsArea : xlsAreaList)
{
// Process area
xlsArea.applyAt(new CellRef(xlsArea.getStartCellRef().getCellName()), context);
// Process formulas
xlsArea.setFormulaProcessor(new FastFormulaProcessor());
xlsArea.processFormulas();
}
//
// Write the result
transformer.write();
}
示例2: addArea
import org.jxls.area.Area; //导入依赖的package包/类
@Override
public Command addArea(final Area area)
{
super.addArea(area);
if (_area == null)
{
_area = area;
}
else
{
throw new IllegalArgumentException("Adding more than one area is not allowed");
}
return this;
}
示例3: applyAt
import org.jxls.area.Area; //导入依赖的package包/类
@Override
public Size applyAt(final CellRef cellRef, final Context context)
{
//
// Process area
final Area area = getArea();
final Size size = area.applyAt(cellRef, context);
//
// If given condition is evaluated as true, hide given columns
if (isConditionTrue(context))
{
logger.debug("Hiding column of {} because condition '{}' was evaluated as true", cellRef, condition);
hideColumn(cellRef);
}
else
{
logger.debug("Skip hiding column of {} because condition '{}' was evaluated as false", cellRef, condition);
}
//
return size;
}
示例4: processTemplateWithSheets
import org.jxls.area.Area; //导入依赖的package包/类
public static void processTemplateWithSheets(InputStream templateStream, OutputStream targetStream,
org.jxls.common.Context jxlsContext) throws IOException {
Transformer transformer = TransformerFactory.createTransformer(templateStream, targetStream);
List<Area> xlsAreas = new XlsCommentAreaBuilder(transformer).build();
for (Area xlsArea : xlsAreas) {
xlsArea.applyAt(new CellRef(xlsArea.getStartCellRef().getCellName()), jxlsContext);
xlsArea.setFormulaProcessor(new StandardFormulaProcessor());
xlsArea.processFormulas();
}
transformer.deleteSheet(xlsAreas.get(0).getStartCellRef().getSheetName());
transformer.write();
}
示例5: applyAt
import org.jxls.area.Area; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Size applyAt(CellRef cellRef, Context context) {
// collect sub command areas
List<Area> childAreas = this.getAreaList().stream()
.flatMap(area1 -> area1.getCommandDataList().stream())
.flatMap(commandData -> commandData.getCommand().getAreaList().stream())
.collect(Collectors.toList());
List<AreaRef> childAreaRefs = childAreas.stream()
.map(Area::getAreaRef).collect(Collectors.toList());
// register AreaListener for parent command area
Area parentArea = this.getAreaList().get(0);
MergeCellListener listener = new MergeCellListener(getTransformer(), parentArea.getAreaRef(), childAreaRefs,
((Collection) context.getVar(this.getItems())).size()); // 总数据量
logger.info("register listener {} to {} from {}", listener, parentArea.getAreaRef(), cellRef);
parentArea.addAreaListener(listener);
// register AreaListener for all sub command area
childAreas.forEach(area -> {
logger.info("register listener {} to {} by parent", listener, area.getAreaRef());
area.addAreaListener(listener);
});
// standard dealing
return super.applyAt(cellRef, context);
}
示例6: EachMergeCommand
import org.jxls.area.Area; //导入依赖的package包/类
public EachMergeCommand(String items, Area area) {
super(items, area);
}
示例7: getArea
import org.jxls.area.Area; //导入依赖的package包/类
private Area getArea()
{
Check.assumeNotNull(_area, "area not null");
return _area;
}