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:
17: package org.romaframework.core.domain.message;
18:
19: import org.romaframework.aspect.core.annotation.AnnotationConstants;
20: import org.romaframework.aspect.core.annotation.CoreClass;
21: import org.romaframework.aspect.i18n.I18NAspect;
22: import org.romaframework.aspect.view.annotation.ViewClass;
23: import org.romaframework.aspect.view.annotation.ViewField;
24: import org.romaframework.core.flow.ObjectContext;
25:
26: @CoreClass(orderFields="icon message")
27: @ViewClass(label="Information",columns=2)
28: public class MessageText extends Message {
29: public MessageText() {
30: }
31:
32: public MessageText(String iId, String iTitle) {
33: this (iId, iTitle, null);
34: }
35:
36: public MessageText(String iId, String iTitle,
37: MessageResponseListener iListener) {
38: this (iId, iTitle, iListener, null);
39: }
40:
41: public MessageText(String iId, String iTitle,
42: MessageResponseListener iListener, String iMessage) {
43: super (iId, iTitle, iListener);
44: setMessage(iMessage);
45: setIcon("information.gif");
46: }
47:
48: public String getMessage() {
49: return message;
50: }
51:
52: public void setMessage(String iMessage) {
53: message = ObjectContext.getInstance().getComponent(
54: I18NAspect.class).resolveString(iMessage);
55: }
56:
57: public String getIcon() {
58: return icon;
59: }
60:
61: public void setIcon(String icon) {
62: this .icon = icon;
63: }
64:
65: @ViewField(label="",render="image")
66: protected String icon;
67:
68: @ViewField(label="",render="html",enabled=AnnotationConstants.FALSE)
69: protected String message;
70:
71: }
|