01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
19:
20: import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
21: import org.apache.cocoon.components.elementprocessor.types.NumericResult;
22:
23: import java.io.IOException;
24:
25: /**
26: * No-op implementation of ElementProcessor to handle the "Selections"
27: * tag
28: *
29: * This element is a container element with two attributes: CursorCol
30: * and CursorRow, which presumable show where the cursor should be.
31: *
32: * This element is not used in HSSFSerializer 1.0
33: *
34: * @author Marc Johnson (marc_johnson27591@hotmail.com)
35: * @version CVS $Id: EPSelections.java 433543 2006-08-22 06:22:54Z crossley $
36: */
37: public class EPSelections extends BaseElementProcessor {
38: private static final String _cursor_col_attribute = "CursorCol";
39: private static final String _cursor_row_attribute = "CursorRow";
40: private NumericResult _cursor_col;
41: private NumericResult _cursor_row;
42:
43: /**
44: * constructor
45: */
46: public EPSelections() {
47: super (null);
48: _cursor_col = null;
49: _cursor_row = null;
50: }
51:
52: /**
53: * @return cursor column
54: * @exception IOException
55: */
56: public int getCursorCol() throws IOException {
57: if (_cursor_col == null) {
58: _cursor_col = NumericConverter
59: .extractNonNegativeInteger(getValue(_cursor_col_attribute));
60: }
61: return _cursor_col.intValue();
62: }
63:
64: /**
65: * @return cursor row
66: * @exception IOException
67: */
68: public int getCursorRow() throws IOException {
69: if (_cursor_row == null) {
70: _cursor_row = NumericConverter
71: .extractNonNegativeInteger(getValue(_cursor_row_attribute));
72: }
73: return _cursor_row.intValue();
74: }
75: } // end public class EPSelections
|