/** * Appends an existing list placeholders to this text run. * @param text optional text to add to the run * @param offset the offset of the placeholders (added to the start / end) * @param propertyTextUnitPlaceholders The existing placeholders to add. */ public void appendWithPropertyTextUnitPlaceholders(String text, int offset, List<PropertyTextUnitPlaceholder> propertyTextUnitPlaceholders) { if ( text != null ) this.text.append(text); for(PropertyTextUnitPlaceholder p : propertyTextUnitPlaceholders) { p.setMainStartPos(p.getMainStartPos()+offset); p.setMainEndPos(p.getMainEndPos()+offset); p.setValueStartPos(p.getValueStartPos()+offset); p.setValueEndPos(p.getValueEndPos()+offset); if (this.propertyTextUnitPlaceholders==null) this.propertyTextUnitPlaceholders = new ArrayList<PropertyTextUnitPlaceholder>(); this.propertyTextUnitPlaceholders.add(p); } }