01: /*
02: * Copyright 2007 Giordano Maestro (giordano.maestro@assetdata.it)
03: *
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
06: * use this file except in compliance with the License.
07: *
08: * You may obtain a copy of the License at
09: * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
10: * or agreed to in writing, software distributed under the License is
11: * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
12: * KIND, either express or implied. See the License for the specific language
13: * governing permissions and limitations under the License.
14: */
15: package org.romaframework.module.designer.view.domain.radpage.aspect;
16:
17: import java.util.ArrayList;
18: import java.util.HashMap;
19: import java.util.List;
20: import java.util.Map;
21: import java.util.Map.Entry;
22:
23: import org.romaframework.aspect.flow.FlowAspect;
24: import org.romaframework.core.schema.SchemaFeatures;
25: import org.romaframework.module.designer.DesignerHelper;
26: import org.romaframework.module.designer.view.domain.FeatureListable;
27:
28: public class FlowAspectPage extends FeatureAspectPage {
29: public FlowAspectPage(SchemaFeatures iActualFeature) {
30: super (FlowAspect.ASPECT_NAME, iActualFeature
31: .getFeatures(FlowAspect.ASPECT_NAME));
32:
33: }
34:
35: @Override
36: protected List<FeatureListable> fillConfigurable() {
37: List<FeatureListable> result = new ArrayList<FeatureListable>();
38: if (actualFeature.getAttributes() != null) {
39: for (Entry<String, Object> entry : actualFeature
40: .getAttributes().entrySet()) {
41: if (entry.getKey().equals("back")) {
42: result.add(new FeatureListable(entry.getKey(),
43: DesignerHelper
44: .getBooleanWrapper((Boolean) entry
45: .getValue())));
46: } else if (entry.getKey().equals("position")
47: || entry.getKey().equals("error")) {
48: result.add(new FeatureListable(entry.getKey(),
49: DesignerHelper.getTextWrapper(entry
50: .getValue(), String.class)));
51: }
52: }
53: }
54: return result;
55: }
56:
57: @Override
58: public Map<String, Object> getDefaultValues() {
59: /***********************************************************************
60: * Init Flow Values
61: **********************************************************************/
62: Map<String, Object> defaultFlowValues = new HashMap<String, Object>();
63: defaultFlowValues.put("back", Boolean.TRUE);
64: return defaultFlowValues;
65: }
66: }
|