[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pdt-dev] add method to class

Hi all,

could someone give me a hint how i can add a method to a class and make it visible in the editor ?

So far, i've tried the following:

sourceModule.becomeWorkingCopy(null, null);
classDeclaration.getBody.addStatement(myNewMethod); //classDeclaration is child of the sourcemodule
sourceModule.reconcile(true, null, null);
sourceModule.commitWorkingCopy(true, null);

Do i need to alter the IBuffer of the sourcemodule manually for this to work ?

thanks !