How to apply change to source code? [message #715932] |
Tue, 16 August 2011 03:20 |
Eclipse User |
|
|
|
I want to customize new class wizard, so I new a subclass of org.eclipse.jdt.ui.wizards.NewTypeWizardPage, and plan to add some code in original code which generated by org.eclipse.jdt.ui.wizards.NewTypeWizardPage. I think @Override
protected void createTypeMembers(IType newType, ImportsManager imports,
IProgressMonitor monitor) throws CoreException { is a point.
so I rewrite this method.
createInheritedMethods(newType, false, true, imports,
new SubProgressMonitor(monitor, 1));
ICompilationUnit cu = newType.getCompilationUnit();
CompilationUnit unit = SourceGenerator.merge(cu, getPackageText(), getTypeName(),
getAuthority(), getDatabase(), tableCreators);
So, var cu is original source, unit is merged source, they are individuals.
But I don't known how to apply changes to cu, after wizard finished, the contents of source is cu not unit.
|
|
|
Powered by
FUDForum. Page generated in 0.03005 seconds