1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.tapfx.components.confirm;
17
18 import org.apache.hivemind.ApplicationRuntimeException;
19 import org.apache.tapestry.BaseComponent;
20
21 /***
22 * @author <a href="mailto:shomburg@hsofttec.com">S.Homburg</a>
23 * @author andyhot
24 * @version $Id: ConfirmLink.java,v 1.3 2005/11/07 03:24:06 andyhot Exp $
25 */
26 public abstract class ConfirmLink extends BaseComponent
27 {
28 public abstract String getKey();
29 public abstract String getMessage();
30
31 public String getOnClickCommand()
32 {
33 String message = getKey();
34 if (message == null)
35 message = getMessage();
36 else
37 message = getPage().getMessages().getMessage(message);
38
39 if (message == null)
40 throw new ApplicationRuntimeException("Neither 'key' nor 'message' parameters were specified!");
41
42 return "return confirm('" + message + "');";
43 }
44
45
46 }