01: /*
02: * Created on 19.02.2005
03: *
04: * To change the template for this generated file go to
05: * Window - Preferences - Java - Code Generation - Code and Comments
06: */
07: package de.schlund.pfixcore.example;
08:
09: import de.schlund.pfixcore.example.iwrapper.EncodingTest;
10: import de.schlund.pfixcore.generator.IHandler;
11: import de.schlund.pfixcore.generator.IWrapper;
12: import de.schlund.pfixcore.workflow.Context;
13:
14: /**
15: * @author ml
16: *
17: * To change the template for this generated type comment go to
18: * Window - Preferences - Java - Code Generation - Code and Comments
19: */
20: public class EncodingTestHandler implements IHandler {
21:
22: public void handleSubmittedData(Context context, IWrapper wrapper)
23: throws Exception {
24: EncodingTest test = (EncodingTest) wrapper;
25: String encoding = test.getEncoding();
26: if (encoding == null || encoding.trim().equals("")
27: || encoding.equals("none")) {
28: ContextEncodingTest ctx = context
29: .getContextResourceManager().getResource(
30: ContextEncodingTest.class);
31: ctx.setText(test.getText());
32: }
33: }
34:
35: public void retrieveCurrentStatus(Context context, IWrapper wrapper)
36: throws Exception {
37: EncodingTest test = (EncodingTest) wrapper;
38: ContextEncodingTest ctx = context.getContextResourceManager()
39: .getResource(ContextEncodingTest.class);
40: if (ctx.getText() != null)
41: test.setText(ctx.getText());
42: }
43:
44: public boolean needsData(Context context) throws Exception {
45: return false;
46: }
47:
48: public boolean prerequisitesMet(Context context) throws Exception {
49: return true;
50: }
51:
52: public boolean isActive(Context context) throws Exception {
53: return true;
54: }
55:
56: }
|