01: /*
02: * Copyright 2005 jWic group (http://www.jwic.de)
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: * de.jwic.events.ValueChangedEvent
17: * Created on 28.08.2005
18: * $Id: ValueChangedEvent.java,v 1.2 2006/08/14 09:34:59 lordsam Exp $
19: */
20: package de.jwic.events;
21:
22: import de.jwic.base.Event;
23: import de.jwic.util.StringTool;
24:
25: /**
26: * @author Florian Lippisch
27: * @version $Revision: 1.2 $
28: */
29: public class ValueChangedEvent extends Event {
30:
31: private static final long serialVersionUID = 1L;
32: private String oldValues[] = null;
33: private String newValues[] = null;
34:
35: /**
36: * Default Constructor.
37: * @param eventSource
38: */
39: public ValueChangedEvent(Object eventSource) {
40: super (eventSource);
41: }
42:
43: /**
44: * @param eventSource
45: */
46: public ValueChangedEvent(Object eventSource, String[] oldValues,
47: String[] newValues) {
48: super (eventSource);
49: this .oldValues = oldValues;
50: this .newValues = newValues;
51: }
52:
53: /**
54: * Returns the old value. If the value is an array, the values are
55: * returned seperated by semmicolon (;).
56: * @return
57: */
58: public String getOldValue() {
59: return StringTool.getSingleString(oldValues);
60: }
61:
62: /**
63: * Returns the old values as array.
64: * @return
65: */
66: public String[] getOldValues() {
67: return oldValues;
68: }
69:
70: /**
71: * Returns the new value. If the value is an array, the values are
72: * returned seperated by semmicolon (;).
73: * @return
74: */
75: public String getNewValue() {
76: return StringTool.getSingleString(newValues);
77: }
78:
79: /**
80: * Returns the new values as array.
81: * @return
82: */
83: public String[] getNewValues() {
84: return newValues;
85: }
86:
87: }
|