本文整理匯總了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;
}