swt comboBoxCelleditor 的使用
来源:互联网 发布:mac移动硬盘无法写入 编辑:程序博客网 时间:2024/04/30 04:39
属性描述器的使用
1.新建一个descriptor 继承自 comboBoxpropertyDescriptor
复写createPropertyEditor()
如:
@Override
public CellEditor createPropertyEditor(Composite parent) {
ComboCellEditor editor = null;
if(labelsArray == null)
{
editor = new ComboCellEditor(parent,new String[]{},operator);
}
else
{
editor = new ComboCellEditor(parent,labelsArray,operator);
}
if (getValidator() != null) {
editor.setValidator(getValidator());
}
return editor;
}
2.扩展一个自己comboBoxcellEditor comboCellEditor
复写dosetValue()
@Override
protected void doSetValue(Object value){
// TODO 自动生成的方法存根
if(!StringUtil.isNullOrEmpty(value)){
CCombo combo = (CCombo)getControl();//获得cellEditor的控件
combo.select(new Integer(""+value));//将已选值设回下拉控件中
}
}
ps: 在comboBoxCellEditor 中,doset与doget中返回的值都是下拉控件的下标,在你使用的时候,需要与你的String [] 进行相应的转换
- swt comboBoxCelleditor 的使用
- 自定义的ComboBoxCellEditor类
- swt控件的使用
- SWT - Table的使用
- SWT的ExpandBar的使用
- SWT的ExpandBar的使用
- SWT的TreeVierer的使用
- SWT的ListVierer的使用
- SWT中TableViewer的使用:
- Swt/Jface treeViewer的使用
- Swt/Jface treeViewer的使用
- SWT之Combo的使用
- Swt/Jface treeViewer的使用
- Swt/Jface treeViewer的使用
- Java SWT Ribbon的使用
- SWT的TableVierer的使用一
- 怎么正确的使用SWT进度条
- swt-designer中关于gridlayout的使用
- C语言复习
- soap消息分析和soap消息的传递和处理(一)
- 【笨木头Lua专栏】基础补充04:迭代器初探
- hdu1002
- 黑马程序员:OC学习日记之内存管理
- swt comboBoxCelleditor 的使用
- 推荐系统
- 【笨木头Lua专栏】基础补充04:for循环与迭代器的秘密
- 黑马程序员-block和protocol
- 高并发服务器端设计
- MD5 的使用
- java语言常用包
- 非递归的归并排序(MergeSort)
- Objective-C objc_class 介绍