1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.facelets;
21
22 import com.sun.facelets.tag.AbstractTagLibrary;
23 import org.apache.myfaces.tobago.component.Tags;
24 import org.apache.myfaces.tobago.validator.FileItemValidator;
25 import org.apache.myfaces.tobago.validator.SubmittedValueLengthValidator;
26
27 public class AbstractTobagoTagLibrary extends AbstractTagLibrary {
28
29 public AbstractTobagoTagLibrary(String namespace) {
30 super(namespace);
31 addTagHandler("attribute", AttributeHandler.class);
32 addTagHandler("dataAttribute", DataAttributeHandler.class);
33 addTagHandler("tabChangeListener", TabChangeListenerHandler.class);
34 addTagHandler("popupReference", PopupReferenceHandler.class);
35 addTagHandler("resetInputActionListener", ResetInputActionListenerHandler.class);
36 addTagHandler("loadBundle", LoadBundleHandler.class);
37 addTagHandler("converter", ConverterHandler.class);
38 addTagHandler(Tags.GRID_LAYOUT_CONSTRAINT, GridLayoutConstraintHandler.class);
39 addValidator("validateFileItem", FileItemValidator.VALIDATOR_ID, TobagoValidateHandler.class);
40 addValidator("validateSubmittedValueLength", SubmittedValueLengthValidator.VALIDATOR_ID);
41 addTobagoComponent("script", "org.apache.myfaces.tobago.Script", "Script", ScriptHandler.class);
42 addTobagoComponent("style", "org.apache.myfaces.tobago.Style", "Style", StyleHandler.class);
43 }
44
45 protected final void addTobagoComponent(String name, String componentType, String rendererType, Class handlerType) {
46 if (!containsTagHandler(getNamespace(), name)) {
47 addComponent(name, componentType, rendererType, handlerType);
48 }
49 }
50 }