01: /*
02: * Copyright 2006 Luca Garulli (luca.garulli@assetdata.it) Licensed under the
03: * Apache License, Version 2.0 (the "License"); you may not use this file except
04: * in compliance with the License. You may obtain a copy of the License at
05: * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
06: * or agreed to in writing, software distributed under the License is
07: * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
08: * KIND, either express or implied. See the License for the specific language
09: * governing permissions and limitations under the License.
10: */
11: package org.romaframework.aspect.view.echo2.screen;
12:
13: import nextapp.echo2.app.Component;
14:
15: import org.romaframework.aspect.view.echo2.form.FormUtil;
16:
17: /**
18: * Handle only one component that cover all desktop
19: *
20: * @author Luca
21: */
22: public class BasicScreen extends Echo2Screen {
23: @Override
24: public String view(String iArea, Component iComponent) {
25: if (iArea == null)
26: // USE LAST AREA POSITION
27: iArea = lastArea;
28: String areaParts[] = FormUtil.extractTokens(iArea, ":");
29: String areaName = areaParts[0];
30: String subAreaName = areaParts.length > 1 ? areaParts[1]
31: : areaName;
32: if (areaName != null && !areaName.equals(lastArea))
33: // UPDATE LAST AREA
34: lastArea = areaName;
35: if (areaName.equals(NULL)) {
36: // DO NOTHING
37: } else if (areaName.equals(POPUP)) {
38: displayPopUp(subAreaName, iComponent);
39: } else {
40: removeAll();
41: add(iComponent);
42: }
43: return iArea;
44: }
45:
46: public void setVisibleArea(String iArea, boolean iValue) {
47: }
48: }
|