01: /**********************************************************************************
02: * $URL:https://source.sakaiproject.org/svn/osp/trunk/jsf/example/src/java/example/xml/RegionTagHandler.java $
03: * $Id:RegionTagHandler.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package example.xml;
21:
22: import java.io.IOException;
23:
24: import javax.faces.component.UIInput;
25: import javax.faces.context.FacesContext;
26:
27: import org.theospi.jsf.impl.DefaultXmlTagHandler;
28: import org.theospi.jsf.intf.ComponentWrapper;
29: import org.theospi.jsf.intf.XmlTagFactory;
30: import org.xml.sax.Attributes;
31:
32: /**
33: * Created by IntelliJ IDEA.
34: * User: John Ellis
35: * Date: Dec 29, 2005
36: * Time: 3:10:07 PM
37: * To change this template use File | Settings | File Templates.
38: */
39: public class RegionTagHandler extends DefaultXmlTagHandler {
40:
41: public RegionTagHandler(XmlTagFactory factory) {
42: super (factory);
43: }
44:
45: public ComponentWrapper startElement(FacesContext context,
46: ComponentWrapper parent, String uri, String localName,
47: String qName, Attributes attributes) throws IOException {
48: UIInput container = new UIInput();
49: createOutput(context, "starting region: "
50: + attributes.getValue("id"), container);
51: parent.getComponent().getChildren().add(container);
52: return new ComponentWrapper(parent, container, this );
53: }
54:
55: public void characters(FacesContext context,
56: ComponentWrapper current, char[] ch, int start, int length)
57: throws IOException {
58: }
59:
60: public void endElement(FacesContext context,
61: ComponentWrapper current, String uri, String localName,
62: String qName) throws IOException {
63: this .createOutput(context, "ending region", current
64: .getComponent());
65: }
66: }
|