| 1 |
|
package net.sf.tacos.components; |
| 2 |
|
|
| 3 |
|
import java.util.HashMap; |
| 4 |
|
import java.util.Map; |
| 5 |
|
|
| 6 |
|
import org.apache.tapestry.BaseComponent; |
| 7 |
|
import org.apache.tapestry.IMarkupWriter; |
| 8 |
|
import org.apache.tapestry.IRequestCycle; |
| 9 |
|
import org.apache.tapestry.IScript; |
| 10 |
|
import org.apache.tapestry.TapestryUtils; |
| 11 |
|
import org.apache.tapestry.form.IFormComponent; |
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
0 |
public abstract class FieldHint extends BaseComponent { |
| 20 |
|
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { |
| 24 |
0 |
writer.begin("span"); |
| 25 |
0 |
renderIdAttribute(writer, cycle); |
| 26 |
0 |
writer.appendAttribute("class", "hint"); |
| 27 |
0 |
renderBody(writer, cycle); |
| 28 |
0 |
super.renderComponent(writer, cycle); |
| 29 |
0 |
writer.end(); |
| 30 |
|
|
| 31 |
0 |
if (!cycle.isRewinding()) { |
| 32 |
0 |
Map parms = new HashMap(); |
| 33 |
0 |
parms.put("component", this); |
| 34 |
0 |
parms.put("startEvent", getStartEvent()); |
| 35 |
0 |
parms.put("endEvent", getEndEvent()); |
| 36 |
|
|
| 37 |
0 |
getScript().execute(this, cycle, TapestryUtils.getPageRenderSupport(cycle, this), parms); |
| 38 |
|
} |
| 39 |
0 |
} |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
public abstract IScript getScript(); |
| 43 |
|
|
| 44 |
|
|
| 45 |
|
public abstract IFormComponent getField(); |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
public abstract String getStartEvent(); |
| 49 |
|
|
| 50 |
|
|
| 51 |
|
public abstract String getEndEvent(); |
| 52 |
|
} |