diff options
author | Henrik Paul <henrik@vaadin.com> | 2014-10-14 16:04:22 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-10-16 09:36:34 +0000 |
commit | 6290daf788d6a96afaae4d6db058762b713af291 (patch) | |
tree | 528df4f69978ce60cb9dfa8e12948635c2aeabad | |
parent | 4519559f35333670942b29d2640c95e67990f0c1 (diff) | |
download | vaadin-framework-6290daf788d6a96afaae4d6db058762b713af291.tar.gz vaadin-framework-6290daf788d6a96afaae4d6db058762b713af291.zip |
Clarifies server-side exceptions relating to Columns (#13334)
Change-Id: I0723e731b87cbab6212ad6a11ab6fb21534c3ae4
-rw-r--r-- | server/src/com/vaadin/ui/components/grid/GridColumn.java | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/server/src/com/vaadin/ui/components/grid/GridColumn.java b/server/src/com/vaadin/ui/components/grid/GridColumn.java index 7b1261f70f..e47b9ed4a7 100644 --- a/server/src/com/vaadin/ui/components/grid/GridColumn.java +++ b/server/src/com/vaadin/ui/components/grid/GridColumn.java @@ -142,7 +142,8 @@ public class GridColumn implements Serializable { checkColumnIsAttached(); if (pixelWidth < 0) { throw new IllegalArgumentException( - "Pixel width should be greated than 0"); + "Pixel width should be greated than 0 (in " + toString() + + ")"); } state.width = pixelWidth; grid.markAsDirty(); @@ -231,7 +232,8 @@ public class GridColumn implements Serializable { "Could not find a converter for converting from the model type " + getModelType() + " to the renderer presentation type " - + renderer.getPresentationType()); + + renderer.getPresentationType() + " (in " + + toString() + ")"); } } @@ -251,7 +253,8 @@ public class GridColumn implements Serializable { Converter<? extends T, ?> converter) { if (renderer.getParent() != null) { throw new IllegalArgumentException( - "Cannot set a renderer that is already connected to a grid column"); + "Cannot set a renderer that is already connected to a grid column (in " + + toString() + ")"); } if (getRenderer() != null) { @@ -281,7 +284,7 @@ public class GridColumn implements Serializable { throw new IllegalArgumentException("The converter model type " + converter.getModelType() + " is not compatible with the property type " - + modelType); + + modelType + " (in " + toString() + ")"); } else if (!getRenderer().getPresentationType().isAssignableFrom( converter.getPresentationType())) { @@ -289,7 +292,8 @@ public class GridColumn implements Serializable { "The converter presentation type " + converter.getPresentationType() + " is not compatible with the renderer presentation type " - + getRenderer().getPresentationType()); + + getRenderer().getPresentationType() + " (in " + + toString() + ")"); } } @@ -312,7 +316,8 @@ public class GridColumn implements Serializable { + "as renderer's presentation type " + rendererPresentationType.getName() + " and column's " + "model " + modelType.getName() + " type aren't " - + "directly compatible with each other"); + + "directly compatible with each other (in " + + toString() + ")"); } } @@ -395,4 +400,10 @@ public class GridColumn implements Serializable { public boolean isSortable() { return state.sortable; } + + @Override + public String toString() { + return getClass().getSimpleName() + "[propertyId:" + + grid.getPropertyIdByColumnId(state.id) + "]"; + } } |