PL-10078 Add more context to FieldGroup error message "field already registered"

This commit is contained in:
Yuriy Artamonov 2017-11-24 15:22:15 +04:00
parent 991001a315
commit d94475755b
2 changed files with 4 additions and 4 deletions

View File

@ -209,7 +209,7 @@ public class DesktopFieldGroup extends DesktopAbstractComponent<JPanel>
@Override
public void addField(FieldConfig fc, int colIndex) {
checkArgument(!fields.containsKey(fc.getId()), "Field is already registered");
checkArgument(!fields.containsKey(fc.getId()), "Field '%s' is already registered", fc.getId());
checkArgument(this == ((FieldConfigImpl) fc).getOwner(), "Field does not belong to this FieldGroup");
if (colIndex < 0 || colIndex >= getColumns()) {
@ -222,7 +222,7 @@ public class DesktopFieldGroup extends DesktopAbstractComponent<JPanel>
@Override
public void addField(FieldConfig fc, int colIndex, int rowIndex) {
checkArgument(!fields.containsKey(fc.getId()), "Field is already registered");
checkArgument(!fields.containsKey(fc.getId()), "Field '%s' is already registered", fc.getId());
checkArgument(this == ((FieldConfigImpl) fc).getOwner(), "Field does not belong to this FieldGroup");
if (colIndex < 0 || colIndex >= getColumns()) {

View File

@ -162,7 +162,7 @@ public class WebFieldGroup extends WebAbstractComponent<CubaFieldGroupLayout>
@Override
public void addField(FieldConfig fc, int colIndex) {
checkArgument(!fields.containsKey(fc.getId()), "Field is already registered");
checkArgument(!fields.containsKey(fc.getId()), "Field '%s' is already registered", fc.getId());
checkArgument(this == ((FieldConfigImpl) fc).getOwner(), "Field does not belong to this FieldGroup");
if (colIndex < 0 || colIndex >= component.getColumns()) {
@ -175,7 +175,7 @@ public class WebFieldGroup extends WebAbstractComponent<CubaFieldGroupLayout>
@Override
public void addField(FieldConfig fc, int colIndex, int rowIndex) {
checkArgument(!fields.containsKey(fc.getId()), "Field is already registered");
checkArgument(!fields.containsKey(fc.getId()), "Field '%s' is already registered", fc.getId());
checkArgument(this == ((FieldConfigImpl) fc).getOwner(), "Field does not belong to this FieldGroup");
if (colIndex < 0 || colIndex >= component.getColumns()) {