1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.healthmarketscience.jackcess;
18
19 import java.io.IOException;
20 import java.util.stream.Stream;
21 import java.util.stream.StreamSupport;
22
23
24
25
26
27
28
29 public interface PropertyMap extends Iterable<PropertyMap.Property>
30 {
31 public static final String ACCESS_VERSION_PROP = "AccessVersion";
32 public static final String TITLE_PROP = "Title";
33 public static final String AUTHOR_PROP = "Author";
34 public static final String COMPANY_PROP = "Company";
35
36 public static final String DEFAULT_VALUE_PROP = "DefaultValue";
37 public static final String REQUIRED_PROP = "Required";
38 public static final String ALLOW_ZERO_LEN_PROP = "AllowZeroLength";
39 public static final String DECIMAL_PLACES_PROP = "DecimalPlaces";
40 public static final String FORMAT_PROP = "Format";
41 public static final String INPUT_MASK_PROP = "InputMask";
42 public static final String CAPTION_PROP = "Caption";
43 public static final String VALIDATION_RULE_PROP = "ValidationRule";
44 public static final String VALIDATION_TEXT_PROP = "ValidationText";
45 public static final String GUID_PROP = "GUID";
46 public static final String DESCRIPTION_PROP = "Description";
47 public static final String RESULT_TYPE_PROP = "ResultType";
48 public static final String EXPRESSION_PROP = "Expression";
49 public static final String ALLOW_MULTI_VALUE_PROP = "AllowMultipleValues";
50 public static final String ROW_SOURCE_TYPE_PROP = "RowSourceType";
51 public static final String ROW_SOURCE_PROP = "RowSource";
52 public static final String DISPLAY_CONTROL_PROP = "DisplayControl";
53 public static final String TEXT_FORMAT_PROP = "TextFormat";
54 public static final String IME_MODE_PROP = "IMEMode";
55 public static final String IME_SENTENCE_MODE_PROP = "IMESentenceMode";
56
57
58 public String getName();
59
60 public int getSize();
61
62 public boolean isEmpty();
63
64
65
66
67 public Property get(String name);
68
69
70
71
72 public Object getValue(String name);
73
74
75
76
77
78 public Object getValue(String name, Object defaultValue);
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93 public Property put(String name, Object value);
94
95
96
97
98
99
100
101
102
103 public Property put(String name, DataType type, Object value);
104
105
106
107
108
109
110
111
112
113 public Property put(String name, DataType type, Object value, boolean isDdl);
114
115
116
117
118
119
120
121 public void putAll(Iterable<? extends Property> props);
122
123
124
125
126
127
128 public Property remove(String name);
129
130
131
132
133 public void save() throws IOException;
134
135
136
137
138 default public Stream<PropertyMap.Property> stream() {
139 return StreamSupport.stream(spliterator(), false);
140 }
141
142
143
144
145 public interface Property
146 {
147 public String getName();
148
149 public DataType getType();
150
151
152
153
154
155
156
157 public boolean isDdl();
158
159 public Object getValue();
160
161
162
163
164
165
166
167 public void setValue(Object newValue);
168 }
169
170
171
172
173 public interface EnumValue
174 {
175
176
177
178 public Object getValue();
179 }
180
181
182
183
184 public enum DisplayControl implements EnumValue
185 {
186 BOUND_OBJECT_FRAME(108),
187 CHECK_BOX(106),
188 COMBO_BOX(111),
189 COMMAND_BUTTON(104),
190 CUSTOM_CONTROL(119),
191 EMPTY_CELL(127),
192 IMAGE(103),
193 LABEL(100),
194 LINE(102),
195 LIST_BOX(110),
196 NAVIGATION_BUTTON(130),
197 NAVIGATION_CONTROL(129),
198 OBJECT_FRAME(114),
199 OPTION_BUTTON(105),
200 OPTION_GROUP(107),
201 PAGE(124),
202 PAGE_BREAK(118),
203 RECTANGLE(101),
204 SUB_FORM(112),
205 TAB_CTL(123),
206 TEXT_BOX(109),
207 TOGGLE_BUTTON(122),
208 WEB_BROWSER(128);
209
210 private final Short _value;
211
212 private DisplayControl(int value) {
213 _value = (short)value;
214 }
215
216 @Override
217 public Short getValue() {
218 return _value;
219 }
220
221 @Override
222 public String toString() {
223 return name() + "[" + _value + "]";
224 }
225 }
226
227
228
229
230 public enum TextFormat implements EnumValue
231 {
232 HTMLRICHTEXT(1),
233 PLAIN(0);
234
235 private final Byte _value;
236
237 private TextFormat(int value) {
238 _value = (byte)value;
239 }
240
241 @Override
242 public Byte getValue() {
243 return _value;
244 }
245
246 @Override
247 public String toString() {
248 return name() + "[" + _value + "]";
249 }
250 }
251
252
253
254
255 public enum IMEMode implements EnumValue
256 {
257 NOCONTROL(0),
258 ON(1),
259 OFF(2),
260 DISABLE(3),
261 HIRAGANA(4),
262 KATAKANA(5),
263 KATAKANAHALF(6),
264 ALPHAFULL(7),
265 ALPHA(8),
266 HANGULFULL(9),
267 HANGUL(10);
268
269 private final Byte _value;
270
271 private IMEMode(int value) {
272 _value = (byte)value;
273 }
274
275 @Override
276 public Byte getValue() {
277 return _value;
278 }
279
280 @Override
281 public String toString() {
282 return name() + "[" + _value + "]";
283 }
284 }
285
286
287
288
289 public enum IMESentenceMode implements EnumValue
290 {
291 NORMAL(0),
292 PLURAL(1),
293 SPEAKING(2),
294 NONE(3);
295
296 private final Byte _value;
297
298 private IMESentenceMode(int value) {
299 _value = (byte)value;
300 }
301
302 @Override
303 public Byte getValue() {
304 return _value;
305 }
306
307 @Override
308 public String toString() {
309 return name() + "[" + _value + "]";
310 }
311 }
312
313 }