站内搜索: 请输入搜索关键词

当前页面: 开发资料首页Eclipse 专题Eclipse 插件开发

Eclipse 插件开发

摘要: Eclipse 插件开发
上个周末买了一本Contributing to Eclipse中文版,感觉这本书真的很不错。并开始学习Eclipse插件的开发。下面是我想做的第一个程序。

com.jet.anySqlRun PES

说明:

Com.jet.anySqlRun是一个eclipse插件(目标版本3.1)。

开发平台:

Eclipse 3.1 j2sdk 5.0

开发目的:

问题:在现在的开发过程中经常需要Check一个Sql是否正确(一般指Web 应用程序)。目前的做法是:


这么做的缺点有如下几点:

克服这些缺点就是该控件需要做的。

解决方案:根据用户自己选定的SQL,产生一个Junit的测试用例。运行该测试用例。返回Data Base Server的结果(如果查询成功返回记录集的View,失败的返回失败描述)。具体内容用下图描述。

实现和模块划分

根据用户选中的代码片断,分析出代码片断中使用了那些外部变量。

Note:外部变量是指在该代码片断中使用了但是没有初始化的变量。他们的值需要从外部获得(及用户的输入)。例如:

id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"> <tr> <td width="23" height="10">
</td> </tr> <tr> <td>
</td> <td width="522" height="130" bgcolor="silver" style="border: 0.75pt solid black; background: silver none repeat scroll 0%; vertical-align: top; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"> <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td>

strSql = "SELECT * FROM ebbcd where formNo = ";

strSql += strFormNo;

strSql += " and ver = ";

strSql += strVer;

这一段代码中strFormNo和strVer就是外部变量。

</tr> </table> </tr> </table>


为用户设置外部变量提供界面。如下图所示(图示中是Refactor中分析的结果):





o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">