protected void loadFieldCaptionWidth(FieldGroup resultComponent, Element element) { String fieldCaptionWidth = element.attributeValue("fieldCaptionWidth"); if (StringUtils.isNotEmpty(fieldCaptionWidth)) { if (fieldCaptionWidth.startsWith(MessageTools.MARK)) { fieldCaptionWidth = loadResourceString(fieldCaptionWidth); } if (fieldCaptionWidth.endsWith("px")) { fieldCaptionWidth = fieldCaptionWidth.substring(0, fieldCaptionWidth.indexOf("px")); } resultComponent.setFieldCaptionWidth(Integer.parseInt(fieldCaptionWidth)); } }
protected void initFieldCaptionWidth(FieldGroup newRuntimeFieldGroup) { if (fieldCaptionWidth != null) { if (fieldCaptionWidth.contains("%")) { throw new IllegalStateException("RuntimePropertiesFrame fieldCaptionWidth with '%' unit is unsupported"); } int captionWidth = Integer.parseInt(fieldCaptionWidth.replace("px", "")); newRuntimeFieldGroup.setFieldCaptionWidth(captionWidth); } if (fieldCaptionWidths != null) { for (int i = 0; i < fieldCaptionWidths.length; i++) { if (fieldCaptionWidths[i].contains("%")) { throw new IllegalStateException("RuntimePropertiesFrame fieldCaptionWidth with '%' unit is unsupported"); } int captionWidth = Integer.parseInt(fieldCaptionWidths[i].replace("px", "")); newRuntimeFieldGroup.setFieldCaptionWidth(i, captionWidth); } } }
resultComponent.setFieldCaptionWidth(colIndex, Integer.parseInt(columnFieldCaptionWidth));