protected void trace(Object object, Throwable t, Object... params) { log.trace(object, t, params); }
protected void trace(Object object, Object... params) { log.trace(object, params); }
public void applyColumnSettings(UIColumn uiColumn) { log.trace("applyColumnSettings() is not supported by CSV exporter", new Object[0]); }
public void applyWorksheetSettings(UIWorksheet uiWorksheet) { log.trace("applyWorksheetSettings() is not supported by CSV exporter", new Object[0]); }
public void executeCommand(Command command) { log.trace("executeCommand() is not supported by CSV exporter", new Object[0]); }
public void setStylesheets(List<UILink> stylesheets) { log.trace("styleSheets are not supported by CSV exporter", new Object[0]); }
private void addStyle(StringBuilder styleBuilder) { String styleString = styleBuilder.toString(); int keyValueBreakpointIndex = styleString.indexOf(KEY_VALUE_SEPARATOR); if (keyValueBreakpointIndex < 0) { log.warn("Key-value separator character #0 not found in style #1, dropping", KEY_VALUE_SEPARATOR + styleBuilder.toString()); return; } String styleName = styleString.substring(0, keyValueBreakpointIndex).toLowerCase().trim(); if (!propertyBuilderMap.containsKey(styleName)) { log.warn("No property builder (unknown style) for property #0", styleName); return; } PropertyBuilder propertyBuilder = propertyBuilderMap.get(styleName); String styleValue = styleString.substring(keyValueBreakpointIndex + 1); log.trace("Parsed style #0 to #1 => #2", styleString, styleName, styleValue); String[] styleValues = trimArray(styleValue.trim().split(STYLE_SHORTHAND_SEPARATOR)); styleMap.putAll(propertyBuilder.parseProperty(styleName, styleValues)); }
private void inject(Object target) { if (log.isTraceEnabled()) { log.trace("Injecting members of component '#0'", getComponent().getName()); } getGuiceInjector().injectMembers(target); }
public void addItem(WorksheetItem item) { switch (item.getItemType()) { case cell: addCell((UICell) item); break; case hyperlink: addHyperLink((UIHyperlink) item); break; case image: log.trace("You cannot export an image to CSV", new Object[0]); break; } }
/** * Moves the row pointer to the next row. Used internally when adding data * */ private void nextRow() { if (log.isTraceEnabled()) { log.trace("Moving from row #0 to #1", currentRowIndex, currentRowIndex + 1); } currentRowIndex++; if (currentRowIndex >= MAX_ROWS) { throw new ExcelWorkbookException(Interpolator.instance() .interpolate("Excel only supports {0} rows", MAX_ROWS)); } }
/** * Moves the internal column pointer to the next column, called by the tag * to indicate that a new column has been started. If the pointer exceeds * the maximum allowed, throws an exception. Resets the styles and row * indexes etc. * */ public void nextColumn() { if (log.isTraceEnabled()) { log.trace("Moving from column #0 to #1", currentColumnIndex, currentColumnIndex + 1); } currentColumnIndex++; if (currentColumnIndex > MAX_COLUMNS) { throw new ExcelWorkbookException(Interpolator.instance() .interpolate("Excel doesn't support more than {0} columns", MAX_COLUMNS)); } if (currentRowIndex > maxRowIndex) { maxRowIndex = currentRowIndex; } currentRowIndex = startRowIndex; }
/** * Creates a JExcelAPI representation of a page orientation * * @param orientation The type of orientation to create * @return The page orientation representation */ public static PageOrientation createPageOrientation(String orientation) { if (log.isTraceEnabled()) { log.trace("Creating page orientation for #0", orientation); } try { return orientation == null ? PageOrientation.LANDSCAPE : (PageOrientation) getConstant(PAGE_ORIENTATION_CLASS_NAME, orientation.toUpperCase()); } catch (NoSuchFieldException e) { String message = Interpolator.instance().interpolate("Page orientation {0} not supported, try {1}", orientation, getValidConstantsSuggestion(PAGE_ORIENTATION_CLASS_NAME)); throw new ExcelWorkbookException(message, e); } }
/** * Creates a JExcelAPI representation of an alignment * * @param alignment The requested alignment * @return The alignment representation * @see <a * href="http://jexcelapi.sourceforge.net/resources/javadocs/2_6/docs/jxl/format/Alignment.html">Alignment</a> */ public static Alignment createAlignment(String alignment) { if (log.isTraceEnabled()) { log.trace("Creating alignment for #0", alignment); } try { return alignment == null ? Alignment.LEFT : (Alignment) getConstant(ALIGNMENT_CLASS_NAME, alignment.toUpperCase()); } catch (NoSuchFieldException e) { String message = Interpolator.instance().interpolate("Alignment {0} not supported, try {1}", alignment, getValidConstantsSuggestion(ALIGNMENT_CLASS_NAME)); throw new ExcelWorkbookException(message, e); } }
/** * Creates a JExcelAPI representation of a pattern * * @param pattern The requested pattern * @return The pattern representation * @see <a * href="http://jexcelapi.sourceforge.net/resources/javadocs/2_6/docs/jxl/format/Pattern.html">Pattern</a> */ public static Pattern createPattern(String pattern) { if (log.isTraceEnabled()) { log.trace("Creating pattern for #0", pattern); } try { return pattern == null ? Pattern.SOLID : (Pattern) getConstant(PATTERN_CLASS_NAME, pattern.toUpperCase()); } catch (NoSuchFieldException e) { String message = Interpolator.instance().interpolate("Pattern {0} not supported, try {1}", pattern, getValidConstantsSuggestion(PATTERN_CLASS_NAME)); throw new ExcelWorkbookException(message, e); } }
/** * Adds a row page break to the worksheet * * @param command * the page break command to interpret */ private void addRowPageBreak(UIRowPageBreak command) { if (log.isTraceEnabled()) { log.trace("Adding row page break #0", command); } if (worksheet == null) { throw new ExcelWorkbookException( "Can't add row page breaks before creating a worksheet"); } int useRow = command.getRow() != null ? command.getRow() : currentRowIndex; worksheet.addRowPageBreak(useRow); }
/** * Creates a JExcelAPI representation of an underline style * * @param mask The requested underline style * @return The underline style representation * @see <a * href="http://jexcelapi.sourceforge.net/resources/javadocs/2_6/docs/jxl/format/UnderlineStyle.html">UnderlineStyle</a> */ private static UnderlineStyle createUnderlineStyle(String underlineStyle) { if (log.isTraceEnabled()) { log.trace("Creating underline style for #0", underlineStyle); } try { return underlineStyle == null ? UnderlineStyle.NO_UNDERLINE : (UnderlineStyle) getConstant(UNDERLINE_STYLE_CLASS_NAME, underlineStyle.toUpperCase()); } catch (NoSuchFieldException e) { String message = Interpolator.instance().interpolate("Underline style {0} not supported, try {1}", underlineStyle, getValidConstantsSuggestion(UNDERLINE_STYLE_CLASS_NAME)); throw new ExcelWorkbookException(message, e); } }
/** * Creates a JExcelAPI representation of a vertical alignment * * @param verticalAlignment The requested alignment * @return The alignment representation * @see <a * href="http://jexcelapi.sourceforge.net/resources/javadocs/2_6/docs/jxl/format/VerticalAlignment.html">VerticalAlignment</a> */ public static VerticalAlignment createVerticalAlignment(String verticalAlignment) { if (log.isTraceEnabled()) { log.trace("Creating verical alignment for #0", verticalAlignment); } try { return verticalAlignment == null ? VerticalAlignment.BOTTOM : (VerticalAlignment) getConstant(VERTICAL_ALIGNMENT_CLASS_NAME, verticalAlignment.toUpperCase()); } catch (NoSuchFieldException e) { String message = Interpolator.instance().interpolate("Verical alignment {0} not supported, try {1}", verticalAlignment, getValidConstantsSuggestion(VERTICAL_ALIGNMENT_CLASS_NAME)); throw new ExcelWorkbookException(message, e); } }
/** * Creates a JExcelAPI representation of a paper size * * @param paperSize The type of paper size to create * @return The paper size representation */ public static PaperSize createPaperSize(String paperSize) { if (log.isTraceEnabled()) { log.trace("Creating paper size for #0", paperSize); } try { return paperSize == null ? PaperSize.A4 : (PaperSize) getConstant(PAPER_SIZE_CLASS_NAME, paperSize.toUpperCase()); } catch (NoSuchFieldException e) { String message = Interpolator.instance().interpolate("Page size {0} not supported, try {1}", paperSize, getValidConstantsSuggestion(PAPER_SIZE_CLASS_NAME)); throw new ExcelWorkbookException(message, e); } }
/** * Gets the cell type for a cell. Tries to look it up in a cache based on the * component id of the cell. If it's not found, it's created and cached. * * @param uiCell The cell to look up * @return The data type of a cell */ private CellType getCellDataType(UICell uiCell) { if (log.isTraceEnabled()) { log.trace("Getting cell data type from cache for #0", uiCell.getId()); } CellType cellDataType = cellInfoCache.getCachedCellType(uiCell.getId()); if (cellDataType == null) { CellStyle cellStyle = new CellStyle(parser.getCascadedStyleMap(uiCell)); cellDataType = cellStyle.forceType != null ? CellType.valueOf(cellStyle.forceType) : uiCell.getDataType(); cellInfoCache.setCachedCellType(uiCell.getId(), cellDataType); } return cellDataType; }
/** * Creates a JExcelAPI header or footer representation. Processes the left, * center and right facets using a helper method * * @param uiHeaderFooter The UI header or footer to interpret * @param headerFooter The JExcelAPI header or footer representation to add * to * @return The JExcelAPI header or footer representation */ public static HeaderFooter createHeaderFooter(UIComponent uiHeaderFooter, HeaderFooter headerFooter) { if (log.isTraceEnabled()) { log.trace("Processing header/footer #0", uiHeaderFooter); } processHeaderFooterFacet(headerFooter.getLeft(), uiHeaderFooter.getFacet("left")); processHeaderFooterFacet(headerFooter.getCentre(), uiHeaderFooter.getFacet("center")); processHeaderFooterFacet(headerFooter.getRight(), uiHeaderFooter.getFacet("right")); return headerFooter; }