1 17 package org.alfresco.web.ui.repo.tag.shelf; 18 19 import javax.faces.FacesException; 20 import javax.faces.component.UIComponent; 21 import javax.faces.el.MethodBinding; 22 23 import org.alfresco.web.ui.common.tag.BaseComponentTag; 24 import org.alfresco.web.ui.repo.component.shelf.UIShortcutsShelfItem; 25 26 29 public class ShortcutsShelfItemTag extends BaseComponentTag 30 { 31 34 public String getComponentType() 35 { 36 return "org.alfresco.faces.ShortcutsShelfItem"; 37 } 38 39 42 public String getRendererType() 43 { 44 return null; 46 } 47 48 51 protected void setProperties(UIComponent component) 52 { 53 super.setProperties(component); 54 setStringBindingProperty(component, "value", this.value); 55 if (isValueReference(this.clickActionListener)) 56 { 57 MethodBinding vb = getFacesContext().getApplication().createMethodBinding(this.clickActionListener, ACTION_CLASS_ARGS); 58 ((UIShortcutsShelfItem)component).setClickActionListener(vb); 59 } 60 else 61 { 62 throw new FacesException("Click Action listener method binding incorrectly specified: " + this.clickActionListener); 63 } 64 if (isValueReference(this.removeActionListener)) 65 { 66 MethodBinding vb = getFacesContext().getApplication().createMethodBinding(this.removeActionListener, ACTION_CLASS_ARGS); 67 ((UIShortcutsShelfItem)component).setRemoveActionListener(vb); 68 } 69 else 70 { 71 throw new FacesException("Remove Action listener method binding incorrectly specified: " + this.clickActionListener); 72 } 73 } 74 75 78 public void release() 79 { 80 super.release(); 81 82 this.value = null; 83 this.clickActionListener = null; 84 this.removeActionListener = null; 85 } 86 87 92 public void setValue(String value) 93 { 94 this.value = value; 95 } 96 97 102 public void setClickActionListener(String clickActionListener) 103 { 104 this.clickActionListener = clickActionListener; 105 } 106 107 112 public void setRemoveActionListener(String removeActionListener) 113 { 114 this.removeActionListener = removeActionListener; 115 } 116 117 118 119 private String clickActionListener; 120 121 122 private String removeActionListener; 123 124 125 private String value; 126 } 127 | Popular Tags |