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的更多相关文章

  1. 错误:java.util.Map is an interface, and JAXB can't handle interfaces.

    问题: 在整合spring+cxf时报错java.util.Map is an interface, and JAXB can't handle interfaces. 解决方法: 将服务端的serv ...

  2. ubuntu14.04下配置Java环境以及安装最新版本的eclipse

    首先是配置JDK 步骤一:下载最新版本的JDK,链接:http://www.oracle.com/technetwork/java/javase/downloads/index.html 步骤二:首先 ...

  3. ubuntu java开发环境搭建(jdk+tomcat+eclipse)

    一.jdk的安装配置. 1.下载jdk. 下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-213 ...

  4. java:[1,1] 需要class, interface或enum

    状态: cmd编译.java文件时报异常:java:[1,1] 需要class, interface或enum异常原因: 主要原因是java文件的编码问题. 在中文操作系统中,使用一贯的"j ...

  5. 我写了一个java实体类,implements了Serializable接口,然后我如何让serialversionUID自动生成

    写了一个java实体类,implements了Serializable接口,让serialversionUID自动生成方法: 1.点击类旁边的警告符号: 2.选择Add generated seria ...

  6. JAVA 构造器, extends[继承], implements[实现], Interface[接口], reflect[反射], clone[克隆], final, static, abstrac

    记录一下: 构造器[构造函数]: 在java中如果用户编写类的时候没有提供构造函数,那么编译器会自动提供一个默认构造函数.它会把所有的实例字段设置为默认值:所有的数字变量初始化为0;所有的布尔变量设置 ...

  7. Java 8函数式接口functional interface的秘密

    Java 8函数式接口functional interface的秘密 2014年10月29日 17:52:55 西瓜可乐520 阅读数:3729   目录 [−] JDK 8之前已有的函数式接口 新定 ...

  8. Java基础-面向接口(interface)编程

    Java基础-面向接口(interface)编程 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.接口的概念 接口是功能的集合,同样可看做是一种数据类型,是比抽象类更为抽象的“类 ...

  9. 实验一 Java开发环境的熟悉(Linux+Eclipse)

    实验一 Java开发环境的熟悉(Linux+Eclipse) 实验内容及步骤 使用JDK编译.运行简单的Java程序 打开windows下的cmd → 输入cd Code命令进入Code目录 → 输入 ...

随机推荐

  1. jquery 遍历 数组1

    使用了jquery有段时间了,整理下jquery中的遍历问题. 1.jquery 遍历对象 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Tr ...

  2. 20145225 《Java程序设计》 第3周学习总结

    20145225<Java程序设计> 第3周学习总结 教材学习内容总结 4.1类与对象 相当于设计图纸,用"new"创建的对象,就是依据设计图做成的成品 . 例(定义C ...

  3. PRISM ‘VS100COMNTOOLS’ not set. Cannot set the build environment

    prism 注册dll,出现以上错误 在系统环境变量,增加 VS100COMNTOOLS 设置路径C:\Program Files (x86)\Microsoft Visual Studio 11.0 ...

  4. UWP深入学习五: 传感器与搜索、共享及链接

    Responding to motion and orientation sensors: Quickstart: Responding to user movement with the accel ...

  5. wexinjs 调用

    public class Utils    {       static string appid = GetAppSettingValue("appid");       sta ...

  6. Mispelling 1510

    #include<iostream>#include<string>#include<cstdio>using namespace std;int main(){  ...

  7. 【树上莫队】【带修莫队】【权值分块】bzoj4129 Haruna’s Breakfast

    #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> using ...

  8. 我的复杂的OpenCV编译之路(OpenCV3.1.0 + VS2010 + Win7)

    教程:www.cnblogs.com/jliangqiu2016/p/5597501.html 这里主要记载我编译遇到的错误及解决方法. OpenCV3.1软件下载:https://sourcefor ...

  9. FileOutputStream保存文件

    //保存文件,根据传入的路径,存放在SD卡目录下public boolean saveToPath(String title, String pageName) { Bitmap b = getCha ...

  10. UIPageControl页控制器

    一.基本知识 #import "ViewController.h"@interface ViewController ()<UIScrollViewDelegate>{ ...