01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.uilib.util;
16:
17: import org.araneaframework.uilib.ConfigurationContext;
18: import org.araneaframework.uilib.form.FormElementValidationErrorRenderer;
19:
20: /**
21: * @author Taimo Peelo (taimo@araneaframework.org)
22: * @since 1.1
23: */
24: public abstract class ConfigurationContextUtil {
25: private ConfigurationContextUtil() {
26: }
27:
28: public static boolean isBackgroundFormValidationEnabled(
29: ConfigurationContext cctx) {
30: Boolean b = (Boolean) cctx
31: .getEntry(ConfigurationContext.BACKGROUND_FORM_VALIDATION);
32: return b == null ? false : b.booleanValue();
33: }
34:
35: public static Long getDefaultListItemsOnPage(
36: ConfigurationContext cctx) {
37: Long l = (Long) cctx
38: .getEntry(ConfigurationContext.DEFAULT_LIST_ITEMS_ON_PAGE);
39: return l;
40: }
41:
42: public static FormElementValidationErrorRenderer getFormElementValidationErrorRenderer(
43: ConfigurationContext cctx) {
44: FormElementValidationErrorRenderer r = (FormElementValidationErrorRenderer) cctx
45: .getEntry(ConfigurationContext.FORMELEMENT_ERROR_RENDERER);
46: return r;
47: }
48: }
|