码迷,mamicode.com
首页 > 其他好文 > 详细

设置TableViewer 中的高度和宽度

时间:2014-11-06 14:59:14      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:style   使用   sp   on   bs   ad   line   new   as   

//此处的Table就是读者所使用的table

//此处本人所使用的table  是通过 tableViewer.getTable();来的 读者可自行做转换

Table.addListener(SWT.MeasureItem, new Listener() {


@Override
public void handleEvent(Event event) {
// TODO 自动生成的方法存根
// 设置宽度 
event.width = soluTable.getGridLineWidth(); 
// 设置高度为字体高度的1.5倍
event.height = (int) Math.floor(event.gc .getFontMetrics().getHeight() * 1.5); 
}
});

设置TableViewer 中的高度和宽度

标签:style   使用   sp   on   bs   ad   line   new   as   

原文地址:http://blog.csdn.net/mrzhang0419/article/details/40858257

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!