1 23 package com.sun.enterprise.tools.jsfext.event.handlers; 24 25 import com.sun.enterprise.tools.jsfext.layout.descriptor.LayoutElement; 26 27 import java.util.EventObject ; 28 29 import javax.faces.context.FacesContext; 30 31 32 36 public class HandlerContextImpl implements HandlerContext { 37 38 41 public HandlerContextImpl(FacesContext context, LayoutElement layoutDesc, EventObject event, String eventType) { 42 _facesContext = context; 43 _layoutDesc = layoutDesc; 44 _event = event; 45 _eventType = eventType; 46 } 47 48 54 public HandlerContextImpl(HandlerContext context) { 55 _facesContext = context.getFacesContext(); 56 _layoutDesc = context.getLayoutElement(); 57 _event = context.getEventObject(); 58 _eventType = context.getEventType(); 59 _handler = context.getHandler(); 60 } 61 62 67 public FacesContext getFacesContext() { 68 return _facesContext; 69 } 70 71 74 public LayoutElement getLayoutElement() { 75 return _layoutDesc; 76 } 77 78 84 public EventObject getEventObject() { 85 return _event; 86 } 87 88 94 public String getEventType() { 95 return _eventType; 96 } 97 98 104 public Handler getHandler() { 105 return _handler; 106 } 107 108 111 public void setHandler(Handler handler) { 112 _handler = handler; 113 } 114 115 122 public HandlerDefinition getHandlerDefinition() { 123 return _handler.getHandlerDefinition(); 124 } 125 126 141 public Object getInputValue(String name) { 142 return getHandler().getInputValue(this, name); 143 } 144 145 155 public Object getOutputValue(String name) { 156 return getHandler().getOutputValue(this, name); 157 } 158 159 165 public void setOutputValue(String name, Object value) { 166 getHandler().setOutputValue(this, name, value); 167 } 168 169 private String _eventType = null; 170 private FacesContext _facesContext = null; 171 private LayoutElement _layoutDesc = null; 172 private EventObject _event = null; 173 private Handler _handler = null; 174 } 175 | Popular Tags |