KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > elementprocessor > impl > poi > hssf > elements > EPSelections


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
18
19 import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
20 import org.apache.cocoon.components.elementprocessor.types.NumericResult;
21
22 import java.io.IOException JavaDoc;
23
24 /**
25  * No-op implementation of ElementProcessor to handle the "Selections"
26  * tag
27  *
28  * This element is a container element with two attributes: CursorCol
29  * and CursorRow, which presumable show where the cursor should be.
30  *
31  * This element is not used in HSSFSerializer 1.0
32  *
33  * @author Marc Johnson (marc_johnson27591@hotmail.com)
34  * @version CVS $Id: EPSelections.java 30932 2004-07-29 17:35:38Z vgritsenko $
35  */

36 public class EPSelections extends BaseElementProcessor {
37     private static final String JavaDoc _cursor_col_attribute = "CursorCol";
38     private static final String JavaDoc _cursor_row_attribute = "CursorRow";
39     private NumericResult _cursor_col;
40     private NumericResult _cursor_row;
41
42     /**
43      * constructor
44      */

45     public EPSelections() {
46         super(null);
47         _cursor_col = null;
48         _cursor_row = null;
49     }
50
51     /**
52      * @return cursor column
53      * @exception IOException
54      */

55     public int getCursorCol() throws IOException JavaDoc {
56         if (_cursor_col == null) {
57             _cursor_col = NumericConverter.extractNonNegativeInteger(
58                     getValue(_cursor_col_attribute));
59         }
60         return _cursor_col.intValue();
61     }
62
63     /**
64      * @return cursor row
65      * @exception IOException
66      */

67     public int getCursorRow() throws IOException JavaDoc {
68         if (_cursor_row == null) {
69             _cursor_row = NumericConverter.extractNonNegativeInteger(
70                     getValue(_cursor_row_attribute));
71         }
72         return _cursor_row.intValue();
73     }
74 } // end public class EPSelections
75
Popular Tags