SWT/Jface SelectionlIstener
来源:互联网 发布:手机淘宝全部宝贝设置 编辑:程序博客网 时间:2024/04/28 06:07
SelectionListener listener = new SelectionListener(){
public void widgetSelected(SelectionEvent e) {
System.out.println("widgetSelected事件");
}
public void widgetDefaultSelected(SelectionEvent e) {
System.out.println("widgetDefaultSelected事件");
}
};
对于selection的监听一直很好奇,为什么会有2个方法,什么控件执行什么方法?
widgetDefaultSelected
void widgetDefaultSelected(SelectionEvent e)
- Sent when default selection occurs in the control.
For example, on some platforms default selection occurs in a List when the user double-clicks an item or types return in a Text. On some platforms, the event occurs when a mouse button or key is pressed. On others, it happens when the mouse or key is released. The exact key or mouse gesture that causes this event is platform specific.
- Parameters:
e
- an event containing information about the default selection
官方的api说的也很泛泛。我们直观的理解就是List 这个控件在双击的时候会触发widgetDefaultSelected的方法,但是同时也会触发widgetSelected这个方法,所以我觉得就没default存在的必要了。
真正的开发中真没遇到widgetDefaultSelected方法来处理业务逻辑时候,求解释??
以下是老外的说法:
Use widgetSelected
. In fact, all the better is to simply extendSelectionAdapter
and only override thewidgetSelected
method and completely ignorewidgetDefaultSelected
.
和咱的想法是一样的。
- SWT/Jface SelectionlIstener
- SWT/JFACE
- JFace/SWT
- SWT Jface
- SWT/Jface
- 关于SWT/JFACE
- java基础 ---SWT/JFace
- SWT 和 JFace
- SWT/JFace基础
- SWT/JFace高级应用
- SWT/JFACE学习积累
- swt/jface 自定义 Dialog
- swt/jface dialog
- java基础 ---SWT/JFace
- swt/jface 自定义 Dialog
- Swt/Jface进度条
- SWT/JFace 基础1
- rcp swt jface
- WhirlyCache介绍
- servlet init 方法
- c++ hash_map 详细介绍
- Solr开发文档
- Windows Phone 7 墓碑机制
- SWT/Jface SelectionlIstener
- Sigar获取系统信息
- 南京长江大桥拟封闭大修1年半 将重换正桥桥面-南京长江大桥-重修-封闭大修
- 好人缘是经营出来的
- 命令行编译工具mxmlc
- 判断文本框中输入的是否为数字,不是则清除
- 线程和进程区别和联系。什么是“线程安全”(2012.5.6 百度实习笔试题)
- read some disk a sector
- JAVA 导出EXCEL DEMO