|
@@ -16,24 +16,21 @@ |
16 |
16 |
|
|
17 |
17 |
|
package com.google.gwt.gen2.table.event.client; |
18 |
18 |
|
|
19 |
|
- |
import java.util.*; |
20 |
|
- |
|
21 |
19 |
|
import com.google.gwt.gen2.event.logical.shared.*; |
22 |
20 |
|
import com.google.gwt.gen2.table.event.client.TableEvent.*; |
23 |
21 |
|
|
|
22 |
+ |
import java.util.*; |
|
23 |
+ |
|
24 |
24 |
|
/** |
25 |
25 |
|
* Logical event fired when a cell is highlighted. |
26 |
26 |
|
*/ |
27 |
|
- |
public class RowSelectionEvent extends SelectionEvent<Set<Row>> |
28 |
|
- |
{ |
|
27 |
+ |
public class RowSelectionEvent extends SelectionEvent<Set<Row>> { |
29 |
28 |
|
/** |
30 |
29 |
|
* Event Key for {@link RowSelectionEvent}. |
31 |
30 |
|
*/ |
32 |
|
- |
public static final Type<RowSelectionEvent, RowSelectionHandler> TYPE = new Type<RowSelectionEvent, RowSelectionHandler>() |
33 |
|
- |
{ |
|
31 |
+ |
public static final Type<RowSelectionEvent, RowSelectionHandler> TYPE = new Type<RowSelectionEvent, RowSelectionHandler>() { |
34 |
32 |
|
@Override |
35 |
|
- |
protected void fire( RowSelectionHandler handler, RowSelectionEvent event ) |
36 |
|
- |
{ |
|
33 |
+ |
protected void fire( RowSelectionHandler handler, RowSelectionEvent event ) { |
37 |
34 |
|
handler.onRowSelection( event ); |
38 |
35 |
|
} |
39 |
36 |
|
}; |
|
@@ -44,23 +41,19 @@ |
44 |
41 |
|
* @param oldList the set of rows that were previously selected |
45 |
42 |
|
* @param newList the set of rows that are now selected |
46 |
43 |
|
*/ |
47 |
|
- |
public RowSelectionEvent( Set<Row> oldList, Set<Row> newList ) |
48 |
|
- |
{ |
|
44 |
+ |
public RowSelectionEvent( Set<Row> oldList, Set<Row> newList ) { |
49 |
45 |
|
super( oldList, newList ); |
50 |
46 |
|
} |
51 |
47 |
|
|
52 |
48 |
|
/** |
53 |
49 |
|
* @return the newly deselected rows |
54 |
50 |
|
*/ |
55 |
|
- |
public Set<Row> getDeselectedRows() |
56 |
|
- |
{ |
|
51 |
+ |
public Set<Row> getDeselectedRows() { |
57 |
52 |
|
Set<Row> deselected = new TreeSet<Row>(); |
58 |
53 |
|
Set<Row> oldList = getOldValue(); |
59 |
54 |
|
Set<Row> newList = getNewValue(); |
60 |
|
- |
for ( Row row : oldList ) |
61 |
|
- |
{ |
62 |
|
- |
if ( !newList.contains( row ) ) |
63 |
|
- |
{ |
|
55 |
+ |
for ( Row row : oldList ) { |
|
56 |
+ |
if ( !newList.contains( row ) ) { |
64 |
57 |
|
deselected.add( row ); |
65 |
58 |
|
} |
66 |
59 |
|
} |
|
@@ -70,15 +63,12 @@ |
70 |
63 |
|
/** |
71 |
64 |
|
* @return the newly selected rows |
72 |
65 |
|
*/ |
73 |
|
- |
public Set<Row> getSelectedRows() |
74 |
|
- |
{ |
|
66 |
+ |
public Set<Row> getSelectedRows() { |
75 |
67 |
|
Set<Row> selected = new TreeSet<Row>(); |
76 |
68 |
|
Set<Row> oldList = getOldValue(); |
77 |
69 |
|
Set<Row> newList = getNewValue(); |
78 |
|
- |
for ( Row row : newList ) |
79 |
|
- |
{ |
80 |
|
- |
if ( !oldList.contains( row ) ) |
81 |
|
- |
{ |
|
70 |
+ |
for ( Row row : newList ) { |
|
71 |
+ |
if ( !oldList.contains( row ) ) { |
82 |
72 |
|
selected.add( row ); |
83 |
73 |
|
} |
84 |
74 |
|
} |
|
@@ -86,8 +76,7 @@ |
86 |
76 |
|
} |
87 |
77 |
|
|
88 |
78 |
|
@Override |
89 |
|
- |
protected Type getType() |
90 |
|
- |
{ |
|
79 |
+ |
protected Type getType() { |
91 |
80 |
|
return TYPE; |
92 |
81 |
|
} |
93 |
82 |
|
} |