JDT:详解JavaUI.createTypeDialog方法
来源:互联网 发布:淘宝看店宝怎么下载 编辑:程序博客网 时间:2024/05/16 06:19
在eclipse中,诸如Open Type
Choose Super Class
Add Interfaces
都是通过JavaUI.createTypeDialog方法来实现的,只是所传的参数不一样罢了。
我们主要看这个方法中的一些 context,scope ,style, multipleSelection, filter参数。
public static SelectionDialog createTypeDialog(Shell parent, IRunnableContext context, IJavaSearchScope scope, int style, boolean multipleSelection, String filter);
context:我们可以传一new ProgressMonitorDialog(Shell shell)进去
scope:指搜索的区域(范围),可以传工程或工作空间进去,比如
IJavaSearchScope scope= SearchEngine.createJavaSearchScope(new IJavaElement[] { getJavaProject() });或SearchEngine.createWorkspaceScope();
style:表示对话框中显示的类型,可能为接口,类,枚举等等,可用的值如下:
param style flags defining the style of the dialog; the only valid values are
* <code>IJavaElementSearchConstants.CONSIDER_CLASSES</code>,
* <code>IJavaElementSearchConstants.CONSIDER_INTERFACES</code>,
* <code>IJavaElementSearchConstants.CONSIDER_ANNOTATION_TYPES</code>,
* <code>IJavaElementSearchConstants.CONSIDER_ENUMS</code>,
* <code>IJavaElementSearchConstants.CONSIDER_ALL_TYPES</code>,
* <code>IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES</code>
* <code>IJavaElementSearchConstants.CONSIDER_CLASSES_AND_ENUMS</code>.
multipleSelection:是否可多选
filter:初始显示的过滤字符串
如下示例:
SelectionDialog dialog = JavaUI.createTypeDialog(window.getShell(),new ProgressMonitorDialog(window.getShell()) , SearchEngine.createWorkspaceScope(), IJavaElementSearchConstants.CONSIDER_CLASSES,false,"IPro");dialog.setTitle("标题");dialog.setMessage("提示信息");dialog.open();显示效果:
- JDT:详解JavaUI.createTypeDialog方法
- JDT:判断某方法是否为public
- javaUI 使用举例
- JDT:获取Java类每个方法的注释
- 用图片设置javaUI界面
- javaUI之卡片布局管理器
- JDT 图标
- 【代码重构 & JDT】判断一个方法是否是实现重写,继承重写和递归
- OpenOffice API 开发 (三)--javaUI界面集成
- jdt中的ast工具
- 用JDT代替aspectj
- Eclipse JDT--AST入门
- Eclipse JDT--ASTParser介绍
- Eclipse JDT--ASTParser使用
- Junit+JDT+CVS
- Eclipse JDT--AST入门
- JDT - Java element hierarchy
- JDT学习之JavaCore
- Nutch二次开发
- zz-twitter首席工程师-如何“打败”CAP定理
- PDF 与 Word互转工具。 在线的 和安装软件
- 搬家了
- JAVA 开源缓存框架
- JDT:详解JavaUI.createTypeDialog方法
- 一个左偏树的经典应用
- 多态
- win08使用
- 手动安装Jenkins插件
- ZOJ 1051 A New Growth Industry
- 深入理解什么是javascript中的闭包
- HDU 1027 Ignatius and the Princess II
- TinyMCE富文本的安装与使用