01: /**
02: * Copyright 2006-2007 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.Environment;
18: import org.araneaframework.http.util.EnvironmentUtil;
19: import org.araneaframework.uilib.ConfigurationContext;
20: import org.araneaframework.uilib.core.MenuContext;
21: import org.araneaframework.uilib.form.FormContext;
22: import org.araneaframework.uilib.tree.TreeContext;
23: import org.araneaframework.uilib.tree.TreeNodeContext;
24:
25: /**
26: * @author Taimo Peelo (taimo@araneaframework.org)
27: * @since 1.1
28: */
29: public abstract class UilibEnvironmentUtil extends EnvironmentUtil {
30: public static ConfigurationContext getConfigurationContext(
31: Environment env) {
32: return (ConfigurationContext) env
33: .getEntry(ConfigurationContext.class);
34: }
35:
36: public static FormContext getFormContext(Environment env) {
37: return (FormContext) env.getEntry(FormContext.class);
38: }
39:
40: public static TreeContext getTreeContext(Environment env) {
41: return (TreeContext) env.getEntry(TreeContext.class);
42: }
43:
44: public static TreeNodeContext getTreeNodeContext(Environment env) {
45: return (TreeNodeContext) env.getEntry(TreeNodeContext.class);
46: }
47:
48: public static MenuContext getMenuContext(Environment env) {
49: return (MenuContext) env.getEntry(MenuContext.class);
50: }
51: }
|