01: //** Copyright Statement ***************************************************
02: //The Salmon Open Framework for Internet Applications (SOFIA)
03: // Copyright (C) 1999 - 2002, Salmon LLC
04: //
05: // This program is free software; you can redistribute it and/or
06: // modify it under the terms of the GNU General Public License version 2
07: // as published by the Free Software Foundation;
08: //
09: // This program is distributed in the hope that it will be useful,
10: // but WITHOUT ANY WARRANTY; without even the implied warranty of
11: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: // GNU General Public License for more details.
13: //
14: // You should have received a copy of the GNU General Public License
15: // along with this program; if not, write to the Free Software
16: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: //
18: // For more information please visit http://www.salmonllc.com
19: //** End Copyright Statement ***************************************************
20: package com.salmonllc.forms;
21:
22: /////////////////////////
23: //$Archive: /JADE/SourceCode/com/salmonllc/forms/DetailFormListener.java $
24: //$Author: Dan $
25: //$Revision: 13 $
26: //$Modtime: 10/30/02 2:38p $
27: /////////////////////////
28: /**
29: * Encapsulates user-defined methods to call before and after key events in the
30: * Search/List/Detail forms.
31: */
32: public interface DetailFormListener {
33: public static final int ERROR_DUPLICATE_ROW = 0;
34: public static final int ERROR_EMPTY_FIELD = 1;
35: public static final int ERROR_INVALID_ENTRY = 2;
36:
37: /**
38: * Called when an error is encountered.
39: * @return int If true, continue processing the event. Same convention as in
40: * ValueChangedEvent.valueChanged(), SubmitEvent.submitPerformed(), etc.
41: */
42: boolean onDetailError(int code, String message,
43: com.salmonllc.html.HtmlComponent component);
44:
45: /**
46: * Called after Delete button has been processed.
47: * @return boolean Currently undefined.
48: */
49: boolean postDetailDelete() throws Exception;
50:
51: /**
52: * Called after pageRequested is processed.
53: * @return boolean Currently undefined.
54: */
55: boolean postDetailRequest() throws Exception;
56:
57: /**
58: * Called after Save button is processed on Detail page.
59: * @return boolean Currently undefined.
60: */
61: boolean postDetailSave() throws Exception;
62:
63: /**
64: * Called before Delete button is processed.
65: * @return boolean True if processing is to continue.
66: */
67: boolean preDetailDelete() throws Exception;
68:
69: /**
70: * Called before pageRequested() is processed.
71: * @return boolean True if continue processing, else stop processing.
72: */
73: boolean preDetailRequest() throws Exception;
74:
75: /**
76: * Called before Save button is processed on Detail page.
77: * @return boolean True if continue to save, else do not continue.
78: */
79: boolean preDetailSave() throws Exception;
80: }
|