void () { PropertyImpl property = (PropertyImpl)PropertiesElementFactory.createProperty(getProject(), "yyy", "xxx", null); final ASTNode newDelimiter = property.getNode().findChildByType(PropertiesTokenTypes.KEY_VALUE_SEPARATOR); final ASTNode propertyNode = getNode(); final ASTNode oldDelimiter = propertyNode.findChildByType(PropertiesTokenTypes.KEY_VALUE_SEPARATOR); if (areDelimitersEqual(newDelimiter, oldDelimiter)) { return; } if (newDelimiter == null) { propertyNode.replaceChild(oldDelimiter, ASTFactory.whitespace(" ")); } else { if (oldDelimiter == null) { propertyNode.addChild(newDelimiter, getValueNode()); final ASTNode insertedDelimiter = propertyNode.findChildByType(PropertiesTokenTypes.KEY_VALUE_SEPARATOR); LOG.assertTrue(insertedDelimiter != null); ASTNode currentPrev = insertedDelimiter.getTreePrev(); final List<ASTNode> toDelete = new ArrayList<>(); while (currentPrev != null && currentPrev.getElementType() == PropertiesTokenTypes.WHITE_SPACE) { toDelete.add(currentPrev); currentPrev = currentPrev.getTreePrev(); } for (ASTNode node : toDelete) { propertyNode.removeChild(node); } } else { propertyNode.replaceChild(oldDelimiter, newDelimiter); } } }