01: /*
02: * Created on 5 mai 2005
03: *
04: */
05: package org.openwfe.gpe.model;
06:
07: import org.eclipse.ui.views.properties.IPropertyDescriptor;
08: import org.eclipse.ui.views.properties.TextPropertyDescriptor;
09:
10: /**
11: * @author Christelle
12: *
13: */
14: public class LogElement extends NoChild {
15:
16: public static String name = "Log";
17: private String message = "";
18: private String level = "info";
19: private String engineLog = "false";
20:
21: protected static IPropertyDescriptor[] descriptors;
22:
23: public static final String MESSAGE = "message"; //$NON-NLS-1$
24: public static final String LEVEL = "level";
25: public static final String ENGINELOG = "engine-log";
26:
27: static {
28: descriptors = new IPropertyDescriptor[] {
29: new TextPropertyDescriptor(MESSAGE, "message"),
30: new TextPropertyDescriptor(LEVEL, "level"),
31: new TextPropertyDescriptor(ENGINELOG, "engine-log"), };
32: }
33:
34: public String getName() {
35: return name;
36: }
37:
38: public void setName(String s) {
39: name = s;
40: }
41:
42: public String getMessage() {
43: return message;
44: }
45:
46: public void setMessage(String s) {
47: message = s;
48: firePropertyChange(MESSAGE, null, s);
49: }
50:
51: public String getLevel() {
52: return level;
53: }
54:
55: public void setLevel(String s) {
56: level = s;
57: firePropertyChange(LEVEL, null, s);
58: }
59:
60: public String getEngineLog() {
61: return engineLog;
62: }
63:
64: public void setEngineLog(String s) {
65: engineLog = s;
66: firePropertyChange(ENGINELOG, null, s);
67: }
68:
69: public IPropertyDescriptor[] getPropertyDescriptors() {
70: return descriptors;
71: }
72:
73: public Object getPropertyValue(Object propName) {
74: if (MESSAGE.equals(propName))
75: return getMessage();
76: if (LEVEL.equals(propName))
77: return getLevel();
78: if (ENGINELOG.equals(propName))
79: return getEngineLog();
80: return super .getPropertyValue(propName);
81: }
82:
83: public void setPropertyValue(Object id, Object value) {
84: if (id == MESSAGE)
85: setMessage((String) value);
86: if (id == LEVEL)
87: setLevel((String) value);
88: if (id == ENGINELOG)
89: setEngineLog((String) value);
90: }
91:
92: }
|