*/
protected void executeOperation() throws JavaModelException {
try {
beginTask(getMainTaskName(), getMainAmountOfWork());
JavaElementDelta delta = newJavaElementDelta();
ICompilationUnit unit = getCompilationUnit();
generateNewCompilationUnitAST(unit);
if (this.creationOccurred) {
//a change has really occurred
unit.save(null, false);
boolean isWorkingCopy = unit.isWorkingCopy();
if (!isWorkingCopy)
setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);
worked(1);
resultElements = generateResultHandles();
if (!isWorkingCopy // if unit is working copy, then save will have already fired the delta
&& !Util.isExcluded(unit)
&& unit.getParent().exists()) {
for (int i = 0; i < resultElements.length; i++) {
delta.added(resultElements[i]);
}
addDelta(delta);
} // else unit is created outside classpath