码迷,mamicode.com
首页 > 编程语言 > 详细

How to programmatically new a java class which implements sepecified interface in eclipse plugin development

时间:2015-06-06 00:06:40      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:

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.

How to programmatically new a java class which implements sepecified interface in eclipse plugin development

标签:

原文地址:http://www.cnblogs.com/alterhu/p/4555734.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!