01: package com.icesoft.faces.component.facelets;
02:
03: import com.sun.facelets.tag.jsf.ComponentHandler;
04: import com.sun.facelets.tag.jsf.ComponentConfig;
05: import com.sun.facelets.tag.MetaRuleset;
06: import com.sun.facelets.tag.MethodRule;
07: import com.icesoft.faces.component.dragdrop.DragEvent;
08: import com.icesoft.faces.component.dragdrop.DropEvent;
09: import com.icesoft.faces.component.ext.RowSelectorEvent;
10: import com.icesoft.faces.component.panelpositioned.PanelPositionedEvent;
11: import com.icesoft.faces.component.paneltabset.TabChangeEvent;
12: import com.icesoft.faces.component.outputchart.OutputChart;
13:
14: import java.util.EventObject;
15:
16: /**
17: * @author Mark Collette
18: * @since 1.6
19: */
20: public class IceComponentHandler extends ComponentHandler {
21: public IceComponentHandler(ComponentConfig componentConfig) {
22: super (componentConfig);
23: }
24:
25: protected MetaRuleset createMetaRuleset(Class type) {
26: MetaRuleset m = super .createMetaRuleset(type);
27: if (tag.getNamespace() != null
28: && tag.getNamespace().equals(
29: "http://www.icesoft.com/icefaces/component")) {
30: if (tag.getLocalName().equals("inputFile")) {
31: m.addRule(new MethodRule("progressListener", null,
32: new Class[] { EventObject.class }));
33: } else if (tag.getLocalName().equals("outputChart")) {
34: m
35: .addRule(new MethodRule("renderOnSubmit",
36: Boolean.TYPE,
37: new Class[] { OutputChart.class }));
38: } else if (tag.getLocalName().equals("panelGroup")) {
39: m.addRule(new MethodRule("dragListener", null,
40: new Class[] { DragEvent.class }));
41: m.addRule(new MethodRule("dropListener", null,
42: new Class[] { DropEvent.class }));
43: } else if (tag.getLocalName().equals("panelPositioned")) {
44: m.addRule(new MethodRule("listener", null,
45: new Class[] { PanelPositionedEvent.class }));
46: } else if (tag.getLocalName().equals("panelTabSet")) {
47: m.addRule(new MethodRule("tabChangeListener", null,
48: new Class[] { TabChangeEvent.class }));
49: } else if (tag.getLocalName().equals("rowSelector")) {
50: m.addRule(new MethodRule("selectionListener", null,
51: new Class[] { RowSelectorEvent.class }));
52: m.addRule(new MethodRule("selectionAction", null,
53: new Class[0]));
54: }
55: }
56: return m;
57: }
58: }
|