插件开发自我总结

插件源码查找

第一种

http://xpenxpen.iteye.com/blog/1607903

 

  1. http://www.eclipse.org/downloads/下载eclipse,注意一定要下载eclipse classic,只有这个才带源代码的,其他比如Eclipse IDE for Java EE Developers, Eclipse IDE for Java Developers都是不带源码的。 

    2.1
    打开eclipse,File->Import..,选择Plug-in development下面的Plug-ins and Fragments. Next 
     


    2.2
    出现Import Plug-ins and Fragments对话框,Import As 选择Projects with source folders,其余2项默认。 
     


    2.3
    选择想阅读的源码,比如选择junit插件相关sourceAdd到右边去。点Finish 
     


    这样就生成了工程,可以看junit插件源码了。 


     

     

    看到的全是class文件

    去github上搜索org.testng.eclipse.TestNGPlugin

这样我们就找到了源码

 

第二种
  • 例如TestNG for Eclipse 插件源码

 

  • 插件源码org.eclipse.ui.workbench.source_3.106.2.v20150204-1030.jar

输入网址

http://grepcode.com/snapshot/repository.grepcode.com/java/eclipse.org/4.4.2/org.eclipse.ui/workbench/3.106.2/

 

 

插件开发快捷键

Shift+alt+F1

Ctrl+alt+F1 = shift+alt+F1

插件api

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Findex.html&overview-summary.html

 

画图工具插件

WindowBuilder

报错

内存溢出

 

Unhandled event loop exception

PermGen space

 

 

java.lang.OutOfMemoryError: PermGen space

原理以及解决

http://www.cnblogs.com/javaexam2/archive/2012/04/15/2632724.html

http://www.cnblogs.com/shihujiang/archive/2012/06/07/2539967.html

 

设置参数如下

-Xms512m -Xmx512m -Dfile.encoding=UTF-8 -XX:PermSize=256m -XX:MaxPermSize=256m

如图

 

编程

List控件滚动条不显示

解决链接

http://www.programgo.com/article/24282915845/

必须要让GridData占满垂直方向,List的滚动条才会显示出来。

org.eclipse.swt.widgets.List list = new org.eclipse.swt.widgets.List(

shell, SWT.V_SCROLL);

不显示

//set grabExcessVerticalSpace to false

list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

显示

//set grabExcessVerticalSpace to true

list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

如何设置list控件高度 ,并且随着主题窗口的大小而改变

GridLayout布局GridData进行设置SWT.FILL, SWT.FILL水平和垂直自动设置对齐

grid.heightHint设置初始高度

http://wjy320.iteye.com/blog/1999908

GridData grid = new GridData(SWT.FILL, SWT.FILL, true, true);

        grid.heightHint= 60;

 

每次调用的时候都会初始化 怎么解决listElements.size()的值不变

原因

EnumElementsEnumPage enumElementsEnumPage = enumParentDialog.getEnumElementsEnumPage();

写在了for循环之中所以每次调用都会初始化

posted @ 2016-06-16 08:52  zhaozhenqiang  阅读(224)  评论(0编辑  收藏  举报