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;
16:
17: import org.romaframework.aspect.core.annotation.AnnotationConstants;
18: import org.romaframework.aspect.view.ViewException;
19: import org.romaframework.aspect.view.annotation.ViewAction;
20: import org.romaframework.aspect.view.annotation.ViewClass;
21: import org.romaframework.aspect.view.page.EntityPage;
22: import org.romaframework.core.domain.message.MessageOk;
23: import org.romaframework.core.flow.ObjectContext;
24: import org.romaframework.core.schema.SchemaManager;
25: import org.romaframework.core.validation.CustomValidation;
26: import org.romaframework.core.validation.ValidationException;
27: import org.romaframework.module.designer.domain.RadClass;
28:
29: @ViewClass(entity=RadClass.class)
30: public class RadClassPage extends EntityPage<RadClass> implements
31: CustomValidation {
32: private Object container;
33:
34: public RadClassPage(RadClass iEntity) {
35: super (null);
36: ObjectContext.getInstance().getComponent(SchemaManager.class)
37: .getClassInfo(iEntity.getClass().getSimpleName());
38: setEntity(iEntity);
39: }
40:
41: public void onFieldsAdd() {
42: ObjectContext.getInstance().show(
43: new MessageOk("", "", null, "Not implemented yet!"));
44: }
45:
46: public void onActionsAdd() {
47: ObjectContext.getInstance().show(
48: new MessageOk("", "", null, "Not implemented yet!"));
49: }
50:
51: public void onActionsEdit() {
52: ActionAspectsPage page = new ActionAspectsPage(entity
53: .getSelectedAction());
54: page.setBackObject(container);
55: ObjectContext.getInstance().show(page);
56: }
57:
58: public void onFieldsEdit() throws ViewException,
59: CloneNotSupportedException {
60: FieldAspectsPage page = new FieldAspectsPage(entity
61: .getSelectedField());
62: page.setBackObject(container);
63: ObjectContext.getInstance().show(page);
64: }
65:
66: @Override
67: public String toString() {
68: return entity.toString();
69: }
70:
71: public void validate() throws ValidationException {
72: }
73:
74: @ViewAction(visible=AnnotationConstants.FALSE)
75: public void cancel() {
76: }
77:
78: public void setContainer(Object container) {
79: this.container = container;
80: }
81: }
|