ソースを参照

Clarifies client-side exceptions relating to Columns (#13334)

Change-Id: Idad4b6588e0ca8a9bc614111b00429d230d9aba0
tags/7.4.0.beta1
Henrik Paul 9年前
コミット
4b11ba764a
1個のファイルの変更32行の追加3行の削除
  1. 32
    3
      client/src/com/vaadin/client/ui/grid/Grid.java

+ 32
- 3
client/src/com/vaadin/client/ui/grid/Grid.java ファイルの表示

@@ -852,7 +852,8 @@ public class Grid<T> extends ResizeComposite implements
*/
public AbstractGridColumn(Renderer<? super C> renderer) {
if (renderer == null) {
throw new IllegalArgumentException("Renderer cannot be null.");
throw new IllegalArgumentException("Renderer cannot be null. "
+ "(in: " + toString() + ")");
}
bodyRenderer = renderer;
}
@@ -865,8 +866,9 @@ public class Grid<T> extends ResizeComposite implements
private void setGrid(Grid<T> grid) {
if (this.grid != null && grid != null) {
// Trying to replace grid
throw new IllegalStateException(
"Column already is attached to grid. Remove the column first from the grid and then add it.");
throw new IllegalStateException("Column already is attached "
+ "to a grid. Remove the column first from the grid "
+ "and then add it. (in: " + toString() + ")");
}

this.grid = grid;
@@ -1048,6 +1050,33 @@ public class Grid<T> extends ResizeComposite implements
public boolean isSortable() {
return sortable;
}

@Override
public String toString() {
String details = "";

if (headerText != null && !headerText.isEmpty()) {
details += "header:\"" + headerText + "\" ";
} else {
details += "header:empty ";
}

if (grid != null) {
int index = grid.getColumns().indexOf(this);
if (index != -1) {
details += "attached:#" + index + " ";
} else {
details += "attached:unindexed ";
}
} else {
details += "detached ";
}

details += "visible:" + visible + " ";
details += "sortable:" + sortable + " ";

return getClass().getSimpleName() + "[" + details.trim() + "]";
}
}

protected class BodyUpdater implements EscalatorUpdater {

読み込み中…
キャンセル
保存