Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/Client/src/com/google/gwt/gen2/event/logical/shared/SelectionEvent.java

Diff revisions: vs.
  @@ -1,87 +1,87 @@
1 - /*
2 - * Copyright 2008 Google Inc.
3 - *
4 - * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 - * use this file except in compliance with the License. You may obtain a copy of
6 - * the License at
7 - *
8 - * http://www.apache.org/licenses/LICENSE-2.0
9 - *
10 - * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 - * License for the specific language governing permissions and limitations under
14 - * the License.
15 - */
16 -
17 - package com.google.gwt.gen2.event.logical.shared;
18 -
19 - import com.google.gwt.gen2.event.shared.*;
20 -
21 - /**
22 - * Fired after an event source has selected a new value.
23 - *
24 - * @param <Value> the type of value the widget has selected
25 - *
26 - * @deprecated use the com.google.gwt.event.logical.shared classes instead
27 - */
28 - @Deprecated
29 - public class SelectionEvent<Value> extends AbstractEvent {
30 -
31 - /**
32 - * The event type.
33 - */
34 - public static final Type<SelectionEvent, SelectionHandler> TYPE = new Type<SelectionEvent, SelectionHandler>() {
35 -
36 - @Override
37 - protected void fire( SelectionHandler handler, SelectionEvent event ) {
38 - handler.onSelection( event );
39 - }
40 - };
41 -
42 - private Value oldValue;
43 - private Value newValue;
44 -
45 - /**
46 - * Constructor.
47 - *
48 - * @param oldValue the old value
49 - * @param newValue the new value
50 - */
51 -
52 - public SelectionEvent( Value oldValue, Value newValue ) {
53 - this.oldValue = oldValue;
54 - this.newValue = newValue;
55 - }
56 -
57 - /**
58 - * Returns the new value.
59 - *
60 - * @return the new value
61 - */
62 - public Value getNewValue() {
63 - assertLive();
64 - return newValue;
65 - }
66 -
67 - /**
68 - * Returns the old value.
69 - *
70 - * @return the old value
71 - */
72 - public Value getOldValue() {
73 - assertLive();
74 - return oldValue;
75 - }
76 -
77 - @Override
78 - public String toDebugString() {
79 - assertLive();
80 - return super.toDebugString() + " old = " + oldValue + " new =" + newValue;
81 - }
82 -
83 - @Override
84 - protected Type getType() {
85 - return TYPE;
86 - }
87 - }
1 + /*
2 + * Copyright 2008 Google Inc.
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 + * use this file except in compliance with the License. You may obtain a copy of
6 + * the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 + * License for the specific language governing permissions and limitations under
14 + * the License.
15 + */
16 +
17 + package com.google.gwt.gen2.event.logical.shared;
18 +
19 + import com.google.gwt.gen2.event.shared.*;
20 +
21 + /**
22 + * Fired after an event source has selected a new value.
23 + *
24 + * @param <Value> the type of value the widget has selected
25 + *
26 + * @deprecated use the com.google.gwt.event.logical.shared classes instead
27 + */
28 + @Deprecated
29 + public class SelectionEvent<Value> extends AbstractEvent {
30 +
31 + /**
32 + * The event type.
33 + */
34 + public static final Type<SelectionEvent, SelectionHandler> TYPE = new Type<SelectionEvent, SelectionHandler>() {
35 +
36 + @Override
37 + protected void fire( SelectionHandler handler, SelectionEvent event ) {
38 + handler.onSelection( event );
39 + }
40 + };
41 +
42 + private Value oldValue;
43 + private Value newValue;
44 +
45 + /**
46 + * Constructor.
47 + *
48 + * @param oldValue the old value
49 + * @param newValue the new value
50 + */
51 +
52 + public SelectionEvent( Value oldValue, Value newValue ) {
53 + this.oldValue = oldValue;
54 + this.newValue = newValue;
55 + }
56 +
57 + /**
58 + * Returns the new value.
59 + *
60 + * @return the new value
61 + */
62 + public Value getNewValue() {
63 + assertLive();
64 + return newValue;
65 + }
66 +
67 + /**
68 + * Returns the old value.
69 + *
70 + * @return the old value
71 + */
72 + public Value getOldValue() {
73 + assertLive();
74 + return oldValue;
75 + }
76 +
77 + @Override
78 + public String toDebugString() {
79 + assertLive();
80 + return super.toDebugString() + " old = " + oldValue + " new =" + newValue;
81 + }
82 +
83 + @Override
84 + protected Type getType() {
85 + return TYPE;
86 + }
87 + }