http://w3facility.org/question/how-to-programmatically-new-a-java-class-which-implements-sepecified-interface-in-eclipse-plugin-development/
OpenNewClassWizardAction wizard = new OpenNewClassWizardAction();
wizard.setOpenEditorOnFinish(false);
NewClassWizardPage page = new NewClassWizardPage();
page.setPackageFragmentRoot(sourceFolder, false);
wizard.setConfiguredWizardPage(page);
wizard.run();
return (IType) wizard.getCreatedElement();
add more here:
check which button use is clicked,
if finished button is clicked : wizard.getCreatedElement() will not return null ,otherwise it will return null value.
本文转自hcy's workbench博客园博客,原文链接:http://www.cnblogs.com/alterhu/p/4555734.html
,如需转载请自行联系原作者。