1 16 17 package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements; 18 19 import org.apache.cocoon.components.elementprocessor.types.Attribute; 20 import org.apache.cocoon.CascadingIOException; 21 import org.apache.cocoon.components.elementprocessor.ElementProcessor; 22 import org.apache.cocoon.components.elementprocessor.types.BooleanConverter; 23 import org.apache.cocoon.components.elementprocessor.types.BooleanResult; 24 25 import java.io.IOException ; 26 27 47 public class EPSheet extends BaseElementProcessor { 48 private Sheet _sheet; 49 private BooleanResult _display_formulas; 50 private BooleanResult _hide_zero; 51 private BooleanResult _hide_grid; 52 private BooleanResult _hide_col_header; 53 private BooleanResult _hide_row_header; 54 private BooleanResult _display_outlines; 55 private BooleanResult _outline_symbols_below; 56 private BooleanResult _outline_symbols_right; 57 private static final String _display_formulas_attribute = "DisplayFormulas"; 58 private static final String _hide_zero_attribute = "HideZero"; 59 private static final String _hide_grid_attribute = "HideGrid"; 60 private static final String _hide_col_header_attribute = "HideColHeader"; 61 private static final String _hide_row_header_attribute = "HideRowHeader"; 62 private static final String _display_outlines_attribute = "DisplayOutlines"; 63 private static final String _outline_symbols_below_attribute = 64 "OutlineSymbolsBelow"; 65 private static final String _outline_symbols_right_attribute = 66 "OutlineSymbolsRight"; 67 68 71 72 public EPSheet() { 73 super(null); 74 _display_formulas = null; 75 _hide_zero = null; 76 _hide_grid = null; 77 _hide_col_header = null; 78 _hide_row_header = null; 79 _display_outlines = null; 80 _outline_symbols_below = null; 81 _outline_symbols_right = null; 82 } 83 84 91 public void initialize(final Attribute[] attributes, 92 final ElementProcessor parent) throws IOException { 93 super.initialize(attributes, parent); 94 try { 95 _sheet = new Sheet(getWorkbook()); 96 } catch (IOException e) { 97 throw e; 98 } catch (Exception e) { 99 throw new CascadingIOException(e.getMessage(), e); 100 } 101 } 102 103 108 public void endProcessing() throws IOException { 109 _sheet.assignBlanksToRegions(); 110 } 111 112 116 protected Sheet getSheet() { 117 return _sheet; 118 } 119 120 124 public boolean getDisplayFormulas() throws IOException { 125 if (_display_formulas == null) { 126 _display_formulas = BooleanConverter.extractBoolean( 127 getValue(_display_formulas_attribute)); 128 } 129 return _display_formulas.booleanValue(); 130 } 131 132 136 public boolean getHideZero() throws IOException { 137 if (_hide_zero == null) { 138 _hide_zero = 139 BooleanConverter.extractBoolean(getValue(_hide_zero_attribute)); 140 } 141 return _hide_zero.booleanValue(); 142 } 143 144 148 public boolean getHideGrid() throws IOException { 149 if (_hide_grid == null) { 150 _hide_grid = 151 BooleanConverter.extractBoolean(getValue(_hide_grid_attribute)); 152 } 153 return _hide_grid.booleanValue(); 154 } 155 156 160 public boolean getHideColHeader() throws IOException { 161 if (_hide_col_header == null) { 162 _hide_col_header = BooleanConverter.extractBoolean( 163 getValue(_hide_col_header_attribute)); 164 } 165 return _hide_col_header.booleanValue(); 166 } 167 168 172 public boolean getHideRowHeader() throws IOException { 173 if (_hide_row_header == null) { 174 _hide_row_header = BooleanConverter.extractBoolean( 175 getValue(_hide_row_header_attribute)); 176 } 177 return _hide_row_header.booleanValue(); 178 } 179 180 184 public boolean getDisplayOutlines() throws IOException { 185 if (_display_outlines == null) { 186 _display_outlines = BooleanConverter.extractBoolean( 187 getValue(_display_outlines_attribute)); 188 } 189 return _display_outlines.booleanValue(); 190 } 191 192 196 public boolean getOutlineSymbolsBelow() throws IOException { 197 if (_outline_symbols_below == null) { 198 _outline_symbols_below = BooleanConverter.extractBoolean( 199 getValue(_outline_symbols_below_attribute)); 200 } 201 return _outline_symbols_below.booleanValue(); 202 } 203 204 208 public boolean getOutlineSymbolsRight() throws IOException { 209 if (_outline_symbols_right == null) { 210 _outline_symbols_right = BooleanConverter.extractBoolean( 211 getValue(_outline_symbols_right_attribute)); 212 } 213 return _outline_symbols_right.booleanValue(); 214 } 215 } | Popular Tags |