01: /*
02: * Copyright 2006 Luca Garulli (luca.garulli@assetdata.it)
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: */
16: package org.romaframework.aspect.view.echo2.screen;
17:
18: import nextapp.echo2.app.ContentPane;
19: import nextapp.echo2.app.Window;
20:
21: import org.romaframework.aspect.view.screen.Screen;
22: import org.romaframework.aspect.view.screen.ScreenContainer;
23:
24: /**
25: * Container for Screen instances.
26: *
27: * @author Luca Garulli (luca.garulli@assetdata.it)
28: */
29: public class Echo2ScreenContainer implements ScreenContainer {
30:
31: public Echo2ScreenContainer(Window iWindow) {
32: window = iWindow;
33: }
34:
35: public void destroy() {
36: if (window != null)
37: window = null;
38: }
39:
40: public Screen getScreen() {
41: Object content = window.getContent();
42: if (content instanceof Screen)
43: return (Screen) content;
44:
45: return null;
46: }
47:
48: public void setScreen(Screen iScreen) {
49: window.setContent((ContentPane) iScreen);
50: }
51:
52: private Window window;
53: }
|