01: package simpleorm.ui;
02:
03: import simpleorm.properties.*;
04: import simpleorm.core.*;
05:
06: /*
07: * Copyright (c) 2002 Southern Cross Software Limited (SCSQ). All rights
08: * reserved. See COPYRIGHT.txt included in this distribution.
09: */
10:
11: /** Contains all the constants and property definitions used by
12: SimpleORM/ui. Implementing this interface will automatically import
13: these constants which is convenient. All constants are prefixed to
14: avoid conflicts.<p>
15: */
16:
17: public interface SUIConstants extends SConstants {
18:
19: /** The prompt to be used by a User Interface. Defaults to a pretty
20: version of the column name. */
21: static final SProperty SUI_PROMPT = new SPropertySUIPrompt();
22:
23: public static class SPropertySUIPrompt extends SProperty {
24: SPropertySUIPrompt() {
25: super ("SUIPrompt");
26: }
27:
28: protected Object defaultValue(SPropertyMap map) {
29: String cname = map.getString(SCOLUMN_NAME);
30: String cn2 = cname.replace('_', ' ').toLowerCase(); // ## mixed case
31: return cn2;
32: }
33: }
34: }
|