1 package com.icesoft.faces.component.facelets; 2 3 import com.sun.facelets.tag.jsf.ComponentHandler; 4 import com.sun.facelets.tag.jsf.ComponentConfig; 5 import com.sun.facelets.tag.MetaRuleset; 6 import com.sun.facelets.tag.MethodRule; 7 import com.icesoft.faces.component.dragdrop.DragEvent; 8 import com.icesoft.faces.component.dragdrop.DropEvent; 9 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 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("http://www.icesoft.com/icefaces/component") ) 29 { 30 if( tag.getLocalName().equals("inputFile") ) { 31 m.addRule( new MethodRule("progressListener", null, new Class [] {EventObject .class}) ); 32 } 33 else if( tag.getLocalName().equals("outputChart") ) { 34 m.addRule( new MethodRule("renderOnSubmit", Boolean.TYPE, new Class [] {OutputChart.class}) ); 35 } 36 else if( tag.getLocalName().equals("panelGroup") ) { 37 m.addRule( new MethodRule("dragListener", null, new Class [] {DragEvent.class}) ); 38 m.addRule( new MethodRule("dropListener", null, new Class [] {DropEvent.class}) ); 39 } 40 else if( tag.getLocalName().equals("panelPositioned") ) { 41 m.addRule( new MethodRule("listener", null, new Class [] {PanelPositionedEvent.class}) ); 42 } 43 else if( tag.getLocalName().equals("panelTabSet") ) { 44 m.addRule( new MethodRule("tabChangeListener", null, new Class [] {TabChangeEvent.class}) ); 45 } 46 else if( tag.getLocalName().equals("rowSelector") ) { 47 m.addRule( new MethodRule("selectionListener", null, new Class [] {RowSelectorEvent.class}) ); 48 m.addRule( new MethodRule("selectionAction", null, new Class [0]) ); 49 } 50 } 51 return m; 52 } 53 } 54 | Popular Tags |