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.Column;
14: import nextapp.echo2.app.Component;
15: import nextapp.echo2.app.Label;
16:
17: import org.romaframework.aspect.view.echo2.look.LookAndFeelManager;
18: import org.romaframework.core.flow.ObjectContext;
19:
20: /**
21: * Handle three frame: TOP/MENU/PATH/BODY and FLOATING
22: *
23: * @deprecated Use the much more powerful ConfigurableScreen instead!
24: * @author Luca Garulli (luca.garulli@assetdata.it)
25: */
26: @Deprecated
27: public class SimpleScreen extends Echo2Screen {
28: public static final String TOP = "top";
29: public static final String MENU = "menu";
30: public static final String PATH = "path";
31: public static final String BOTTOM = "bottom";
32:
33: /**
34: * Creates a new <code>SplittableDesktop</code>.
35: */
36: public SimpleScreen() {
37: super ();
38: ObjectContext.getInstance().getComponent(
39: LookAndFeelManager.class).assignStyle(this );
40: mainPanel = new Column();
41: add(mainPanel);
42: mainPanel.add(new Label());
43: mainPanel.add(new Label());
44: mainPanel.add(new Label());
45: mainPanel.add(new Label());
46: }
47:
48: @Override
49: public String view(String iArea, Component iComponent) {
50: if (iArea == null)
51: // USE LAST AREA POSITION
52: iArea = lastArea;
53: if (iArea != null && !iArea.equals(lastArea))
54: // UPDATE LAST AREA
55: lastArea = iArea;
56: if (iArea.equals(TOP)) {
57: mainPanel.remove(0);
58: mainPanel.add(iComponent, 0);
59: } else if (iArea.equals(MENU)) {
60: mainPanel.remove(1);
61: mainPanel.add(iComponent, 1);
62: } else if (iArea.equals(PATH)) {
63: mainPanel.remove(2);
64: mainPanel.add(iComponent, 2);
65: } else if (iArea.equals(BODY)) {
66: mainPanel.remove(3);
67: mainPanel.add(iComponent, 3);
68: } else if (iArea.startsWith(POPUP)) {
69: displayPopUp(iArea, iComponent);
70: }
71: return iArea;
72: }
73:
74: private Column mainPanel;
75:
76: public void setVisibleArea(String iArea, boolean iValue) {
77: if (iArea.equals(TOP)) {
78: mainPanel.setVisible(iValue);
79: } else if (iArea.equals(MENU)) {
80: mainPanel.setVisible(iValue);
81: } else if (iArea.equals(PATH)) {
82: mainPanel.setVisible(iValue);
83: } else if (iArea.equals(BODY)) {
84: mainPanel.setVisible(iValue);
85: } else if (iArea.startsWith(POPUP)) {
86: }
87: }
88: }
|