| 1 |
|
package org.kuali.student.common.ui.client.widgets.table.scroll; |
| 2 |
|
|
| 3 |
|
import com.google.gwt.user.client.ui.Label; |
| 4 |
|
import com.google.gwt.user.client.ui.Widget; |
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
|
|
|
| 0% |
Uncovered Elements: 67 (67) |
Complexity: 27 |
Complexity Density: 0.79 |
|
| 11 |
|
public class Column { |
| 12 |
|
|
| 13 |
|
public final static int Ascending = 1; |
| 14 |
|
|
| 15 |
|
public final static int Descending = 2; |
| 16 |
|
|
| 17 |
|
public final static int NotOrdered = 3; |
| 18 |
|
|
| 19 |
|
private Widget columnTitleWidget; |
| 20 |
|
private String id; |
| 21 |
|
private String name = ""; |
| 22 |
|
private String width; |
| 23 |
|
private int sortDirection = NotOrdered; |
| 24 |
|
private boolean isVisible = true; |
| 25 |
|
private boolean isSortable; |
| 26 |
|
|
| 27 |
|
private RowComparator ascendingRowComparator; |
| 28 |
|
private RowComparator descendingRowComparator; |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 33 |
0
|
public RowComparator getComparator() {... |
| 34 |
0
|
if (this.sortDirection == Ascending) { |
| 35 |
0
|
return ascendingRowComparator; |
| 36 |
0
|
} else if (this.sortDirection == Descending) { |
| 37 |
0
|
return descendingRowComparator; |
| 38 |
|
} else { |
| 39 |
0
|
return null; |
| 40 |
|
} |
| 41 |
|
} |
| 42 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 43 |
0
|
public RowComparator getAscendingRowComparator() {... |
| 44 |
0
|
return ascendingRowComparator; |
| 45 |
|
} |
| 46 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 47 |
0
|
public void setAscendingRowComparator(RowComparator ascendingRowComparator) {... |
| 48 |
0
|
this.ascendingRowComparator = ascendingRowComparator; |
| 49 |
0
|
this.isSortable = true; |
| 50 |
|
} |
| 51 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 52 |
0
|
public RowComparator getDescendingRowComparator() {... |
| 53 |
0
|
return descendingRowComparator; |
| 54 |
|
} |
| 55 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 56 |
0
|
public void setDescendingRowComparator(RowComparator descedingRowcomparator) {... |
| 57 |
0
|
this.descendingRowComparator = descedingRowcomparator; |
| 58 |
0
|
this.isSortable = true; |
| 59 |
|
} |
| 60 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 61 |
0
|
public boolean isVisible() {... |
| 62 |
0
|
return isVisible; |
| 63 |
|
} |
| 64 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 65 |
0
|
public void setVisible(boolean isVisible) {... |
| 66 |
0
|
this.isVisible = isVisible; |
| 67 |
|
} |
| 68 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 69 |
0
|
public Widget getColumnTitleWidget() {... |
| 70 |
0
|
if (columnTitleWidget == null) { |
| 71 |
0
|
return new Label(name); |
| 72 |
|
} |
| 73 |
|
|
| 74 |
0
|
return columnTitleWidget; |
| 75 |
|
} |
| 76 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 77 |
0
|
public void setColumnTitleWidget(Widget c) {... |
| 78 |
0
|
columnTitleWidget = c; |
| 79 |
|
} |
| 80 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 81 |
0
|
public String getId() {... |
| 82 |
0
|
return id; |
| 83 |
|
} |
| 84 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 85 |
0
|
public void setId(String id) {... |
| 86 |
0
|
this.id = id; |
| 87 |
|
} |
| 88 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 89 |
0
|
public boolean isSortable() {... |
| 90 |
0
|
return isSortable; |
| 91 |
|
} |
| 92 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 93 |
0
|
public void setSortable(boolean isSortable) {... |
| 94 |
0
|
this.isSortable = isSortable; |
| 95 |
|
} |
| 96 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 97 |
0
|
public String getName() {... |
| 98 |
0
|
return name; |
| 99 |
|
} |
| 100 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 101 |
0
|
public void setName(String name) {... |
| 102 |
0
|
this.name = name; |
| 103 |
|
} |
| 104 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 105 |
0
|
public String getWidth() {... |
| 106 |
0
|
return width; |
| 107 |
|
} |
| 108 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 109 |
0
|
public void setWidth(String width) {... |
| 110 |
0
|
this.width = width; |
| 111 |
|
} |
| 112 |
|
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 4 |
Complexity Density: 0.67 |
|
| 113 |
0
|
public void changeSortDirection() {... |
| 114 |
0
|
if (this.sortDirection == NotOrdered) { |
| 115 |
0
|
this.sortDirection = Ascending; |
| 116 |
0
|
} else if (this.sortDirection == Ascending) { |
| 117 |
0
|
this.sortDirection = Descending; |
| 118 |
0
|
} else if (this.sortDirection == Descending) { |
| 119 |
0
|
this.sortDirection = Ascending; |
| 120 |
|
} |
| 121 |
|
} |
| 122 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 123 |
0
|
public void setSortDirection(int sortDirection) {... |
| 124 |
0
|
this.sortDirection = sortDirection; |
| 125 |
|
} |
| 126 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 127 |
0
|
public int getSortDirection() {... |
| 128 |
0
|
return sortDirection; |
| 129 |
|
} |
| 130 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 131 |
0
|
public void setSortedType(int direction) {... |
| 132 |
0
|
sortDirection = direction; |
| 133 |
|
} |
| 134 |
|
} |