How to programmatically new a java class which implements sepecified interface in eclipse plugin development
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.
作者:高级测试开发网
博客地址:https://seniortesting.club
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。