1 20 package org.enhydra.barracuda.examples.ex4; 21 22 import java.io.*; 23 import java.util.*; 24 import java.net.*; 25 import javax.servlet.*; 26 import javax.servlet.http.*; 27 28 import org.enhydra.barracuda.core.event.*; 29 import org.enhydra.barracuda.examples.ex4.events.*; 30 31 32 35 public class SampleControlHandler extends DefaultListenerFactory { 36 37 private String name = null; 38 public String name1 = null; 39 public static String name2 = null; 40 public boolean sboolean = false; 41 public byte sbyte = 0; 43 public char schar = ' '; 44 public double sdouble = -1; 45 public float sfloat = 1.0F; 46 public int sint = -1; 47 public long slong = -1; 48 public short sshort = -1; 49 50 public BaseEventListener getInstance() { 52 return new TestHandler(); 53 } 54 public String getListenerID() { 55 return getID(TestHandler.class); 56 } 57 58 public void setName(String iname) { 60 name = iname; 61 } 62 public void setSBoolean(boolean val) { 63 sboolean = val; 64 } 65 public void setSByte(byte b) { 66 sbyte = b; 67 } 68 public void setSChar(char c) { 69 schar = c; 70 } 71 public void setSDouble(double d) { 72 sdouble = d; 73 } 74 public void setSFloat(float f) { 75 sfloat = f; 76 } 77 public void setSInt(int i) { 78 sint = i; 79 } 80 public void setSLong(long l) { 81 slong = l; 82 } 83 public void setSShort(short s) { 84 sshort = s; 85 } 86 87 94 class TestHandler extends DefaultBaseEventListener { 95 public void handleControlEvent(ControlEventContext context) throws EventException, ServletException, IOException { 96 context.putState(SampleViewHandler.HANDLED_BY, name); 99 context.getQueue().addEvent(new RenderEvent(context.getEvent())); 100 } 101 } 102 } 103 104 | Popular Tags |