You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2007/05/28 22:13:51 UTC

[Myfaces Wiki] Update of "Use Facelets with Tomahawk" by WernerPunz

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by WernerPunz:
http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk

The comment on the change is:
added a handler for the mouseListener in the schedule component

------------------------------------------------------------------------------
  
  Andrew Robinson
  
+ 
+ ----
+ Here is a custom tag handler for the schedule class which is needed if you want to use
+ the mouseListener binding:
+ {{{
+    <tag>
+         <tag-name>schedule</tag-name>
+         <component>
+             <component-type>org.apache.myfaces.Schedule</component-type>
+             <handler-class>>ui.control.ScheduleTagHandler</handler-class>
+         </component>
+     </tag>
+ 
+ package ui.control;
+ public class ScheduleTagHandler extends HtmlComponentHandler {
+ 
+  
+     private static final String MOUSE_LISTENER = "mouseListener";
+     private static Logger _logger = Logger.getLogger(HtmlSchedule.class.getName());
+ 
+     public ScheduleTagHandler(ComponentConfig tagConfig) {
+         super(tagConfig);
+         _logger.info("HtmlSchedule: " + tagConfig);
+     }
+ 
+     protected MetaRuleset createMetaRuleset(Class type)
+     {
+        
+         MetaRuleset m = super.createMetaRuleset(type);
+          
+     
+         m.addRule(getMouseListenerMetaRule());
+ 
+         return m;
+     }
+ 
+     private MetaRule getMouseListenerMetaRule() {
+           Class[] paramList = new Class[]{ScheduleMouseEvent.class};
+           _logger.info("MouseListenerMetaRule");
+           return new MethodRule(MOUSE_LISTENER, String.class, paramList);
+     }
+     
+  }
+ 
+ }}}
+ This rule only adds the mouseListener methid binding, other
+ bindings might be needed for various cases and should be added here on a case by case base.
+ 
+ 
  ----
  
  I also created custom tag handler for tomahawk panelTabedPane component to add support of tabChangeListener attribute.