01: /*
02: * (C) Copyright 2004 Nabh Information Systems, Inc.
03: *
04: * All copyright notices regarding Nabh's products MUST remain
05: * intact in the scripts and in the outputted HTML.
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package com.nabhinc.portlet.mvcportlet.core;
23:
24: import javax.portlet.PortletException;
25: import javax.portlet.PortletRequest;
26:
27: /**
28: * Objects of this type are used to supply all possible values
29: * for a field and default value(s) for a field.
30: *
31: * @author Padmanabh Dabke
32: * (c) 2003 Nabh Information Systems, Inc. All Rights Reserved.
33: */
34: public interface FormFieldPopulator extends Initable {
35:
36: /**
37: * Returns populator name.
38: * @return
39: */
40: String getName();
41:
42: /**
43: * Sets populator name
44: * @param name Populator name
45: */
46: void setName(String name);
47:
48: /**
49: * Get the universe of values for a field. The object returned
50: * is either of type String[] or ValueAndLabel[].
51: * @param req
52: * @return An array of strings or ValueAndLabel objects depending
53: * on the field.
54: * @throws PortletException
55: */
56: Object getValue(PortletRequest req) throws PortletException;
57:
58: /**
59: * Returns set of default values for a field.
60: * @param req
61: * @return
62: * @throws PortletException
63: */
64: String[] getDefaultValues(PortletRequest req)
65: throws PortletException;
66: }
|