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;
16:
17: import java.util.ArrayList;
18: import java.util.List;
19:
20: import org.apache.commons.logging.Log;
21: import org.apache.commons.logging.LogFactory;
22: import org.romaframework.core.domain.page.ContainerPage;
23: import org.romaframework.core.flow.ObjectContext;
24: import org.romaframework.module.designer.view.domain.radpage.aspect.ChildPage;
25:
26: /**
27: * Page Container for the creation of designer pages
28: *
29: * @author Giordano Maestro(giordano.maestro@assetdata.it) 09/nov/07
30: *
31: */
32: public abstract class DesignerContainerPage extends ContainerPage {
33: protected Log log = LogFactory.getLog(getClass());
34: protected List<ChildPage> pages = new ArrayList<ChildPage>();
35:
36: public DesignerContainerPage() {
37: }
38:
39: /**
40: * Add a page to the container
41: *
42: * @param obj
43: */
44: public void addPage(Object obj) {
45: getInnerPages().put(obj.toString(), obj);
46: if (obj instanceof ChildPage) {
47: pages.add((ChildPage) obj);
48: }
49: ObjectContext.getInstance().refresh(this , "innerPages");
50: }
51:
52: }
|