Bug 14368 Create getter and setter insert code into read-only file
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java
writeSuperClass(buf, imports);
		writeSuperInterfaces(buf, imports);	
		buf.append('{');
		buf.append(lineDelimiter);
		buf.append(lineDelimiter);
		buf.append('}');
		buf.append(lineDelimiter);
		return buf.toString();
	}
	/**
	 * Called from createType to allow adding methods, fielse, inner types ect for the newly created type.
	 * Implementors can use the create methods on the new type.
	 * Formatting will be applied to the content by the createType
	 * @param newType The new type to add members to
	 * @param imports To add the needed imports to. 
	 * @param monitor Progress monitor
	 */		
	protected void createTypeMembers(IType newType, IImportsStructure imports, IProgressMonitor monitor) throws CoreException {
		
		
		
		
	}
	
	/**
	 * Called from createType to get a file comment. By default the content of template
	 * 'filecomment' is taken.
	 * Returns source or null, if no file comment should be added
	 */		
	protected String getFileComment(ICompilationUnit parentCU) {