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 java.io.IOException;
21:
22: /**
23: * No-op implementation of ElementProcessor to handle the "Header" tag
24: *
25: * This element has three attributes: Left, Middle, and Top, and no
26: * contents.
27: *
28: * @author Marc Johnson (marc_johnson27591@hotmail.com)
29: * @version CVS $Id: EPHeader.java 433543 2006-08-22 06:22:54Z crossley $
30: */
31: public class EPHeader extends BaseElementProcessor {
32: private String _left;
33: private String _middle;
34: private String _right;
35: private static final String _left_attribute = "Left";
36: private static final String _middle_attribute = "Middle";
37: private static final String _right_attribute = "Right";
38:
39: /**
40: * constructor
41: */
42: public EPHeader() {
43: super (null);
44: _left = null;
45: _middle = null;
46: _right = null;
47: }
48:
49: /**
50: * @return the left string
51: */
52: public String getLeft() {
53: if (_left == null) {
54: _left = getValue(_left_attribute);
55: if (_left == null) {
56: _left = "";
57: }
58: }
59: return _left;
60: }
61:
62: /**
63: * @return the middle string
64: */
65: public String getMiddle() {
66: if (_middle == null) {
67: _middle = getValue(_middle_attribute);
68: if (_middle == null) {
69: _middle = "";
70: }
71: }
72: return _middle;
73: }
74:
75: /**
76: * @return the right string
77: */
78: public String getRight() {
79: if (_right == null) {
80: _right = getValue(_right_attribute);
81: if (_right == null) {
82: _right = "";
83: }
84: }
85: return _right;
86: }
87:
88: /**
89: * Setup the text to be printed at the top of every page
90: * @exception IOException
91: */
92: public void endProcessing() throws IOException {
93: this .getSheet().setHeader(getLeft(), getMiddle(), getRight());
94: }
95: } // end public class EPHeader
|