![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java SWT Tree
文章平均质量分 75
iteye_7333
这个作者很懒,什么都没留下…
展开
-
Tree的小例子(3级树)
例子来源:http://www.eclipse.org/swt/snippets 在org.eclipse.swt.widgets.Tree的javadoc中可以看,Tree可以支持的类型和事件,TreeItem没有什么类型和事件,这样对于一个特定的Item的事件就要加到Tree上面,后分辨不同的Item来处理了。Styles: SINGLE, MULTI, CHECK, FUL...2011-08-03 15:50:27 · 287 阅读 · 0 评论 -
jface treeView 的sample
原文:http://www.ibm.com/developerworks/cn/linux/opensource/os-ecgui1/原创 2013-07-04 16:27:57 · 137 阅读 · 0 评论 -
学习定制表格树的项(二)
表格和树的项只可以有一个图像,而且这个图像只能够画在图像的前面。学习了定制表格和树的项后,觉得前面也可以定制多个图像了。 例子:public class Snippet300 { private static int IMAGE_MARGIN = 2; private static Image xImage; private static Display display...2011-08-11 11:11:30 · 118 阅读 · 0 评论 -
学习定制表格树的项(一)
原文:http://www.eclipse.org/articles/article.php?file=Article-CustomDrawingTableAndTreeItems/index.html本来将原来那篇拷贝过来,想写一些注释的,但太大了,太慢了,还是另写吧: 总述1,为什么要定制去画呢?因为原来的Item有自己的局限性: For example, an item...原创 2011-08-11 10:47:48 · 192 阅读 · 0 评论 -
绘制Item
原文链接:http://www.eclipse.org/articles/article.php?file=Article-CustomDrawingTableAndTreeItems/index.htmlCustom Drawing Table and Tree ItemsSummaryPopulating a table or tree widget involves c...原创 2011-08-10 10:55:19 · 236 阅读 · 0 评论 -
Tree中增加图像
原来程序:Snippet220程序说明:1,newItem.setData(image); 将Item和Image关联起来。2,SWT.MeasureItem; 计算Item应该画多大,就是计算好了画多大后,在加上Image的宽度,这里要注意的是改变event.width的宽度就改变的项的宽度了。3,SWT.PaintItem; 画上设置的图像。 public cl...原创 2011-08-05 15:04:07 · 129 阅读 · 0 评论 -
SWT树也可以支持列 列的顺序可以随时变
原来程序:Snippet170 代码:public class Snippet170 { public static void main(String[] args) { Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new Fill...原创 2011-08-05 10:39:49 · 207 阅读 · 0 评论 -
控制树的可选择项
控制树的可选择项,就是根据所选的项。重新选择。 public class Snippet80 { public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(...原创 2011-08-05 10:31:23 · 193 阅读 · 0 评论 -
树的事件展开收缩 多选
原来例子:Snippet61 public class Snippet61 { public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout (new FillLayout...原创 2011-08-04 11:16:36 · 227 阅读 · 0 评论 -
树中插入项
原来例子:Snippet102其实就是:TreeItem (Tree parent, int style, int index)TreeItem 的构造函数可以指定index。public class Snippet102 { public static void main (String [] args) { Display display = new Display ()...原创 2011-08-04 11:10:41 · 277 阅读 · 0 评论 -
Java SWT Tree目录结构
1,Tree的小例子(3级树):http://xmind.iteye.com/blog/1139188一个简单的3级树的例子,还有一个没有滚动条的树,SWT.NO_SCROLL。2,SWT 树的展开事件,懒加载:http://xmind.iteye.com/blog/1139396一个懒加载的树,浏览文件结构。SWT.Expand事件发生的时候加载树项。3,SWT 树的展开事件...原创 2011-08-03 20:58:30 · 448 阅读 · 0 评论 -
SWT 树的事件 SWT.CHECK
原来程序:Snippet274用到SWT.CHECK这个的时候,通常还用到setGrayed,这两个一起组合在一起,一个Item就有了4种状态,但是图形中只能看出来3中。 所以在用到SWT.CHECK,还要完善。Checked true Grayed false表示下面的子全部先上的;Checked true Grayed true表示下面的子只有部分被选上。 因为我们...原创 2011-08-03 20:48:05 · 463 阅读 · 0 评论 -
SWT 树的事件 SWT.Selection SWT.CHECK SWT.DefaultSelection
原程序:Snippet114 1,Tree支持 SWT.CHECK 类型的树。2,单击复选框或Item产生SWT.Selection事件,如果单击的是复选框,event.detail = SWT.CHECK。3,双击Item产生SWT.DefaultSelection public class Snippet114 { public static void main (...原创 2011-08-03 20:06:05 · 421 阅读 · 0 评论 -
SWT 树的展开事件 SWT.VIRTUAL SWT.SetData
原程序:Snippet202 public class Snippet202 { public static void main(String[] args) { Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout (new FillLayou...原创 2011-08-03 19:45:18 · 477 阅读 · 0 评论 -
SWT 树的展开事件,懒加载
原文来自:Snippet8SWT中的树可以利用SWT.Expand事件实现懒加载。 public class Snippet8 { public static void main (String [] args) { final Display display = new Display (); final Shell shell = new Shell (disp...原创 2011-08-03 17:59:01 · 626 阅读 · 0 评论 -
TreeView 使用属性监听;保护以前TreeTable的功能
TreeView 使用属性监听感觉比Table复杂一些,写了一个仿照书上的例子: import java.beans.PropertyChangeEvent;import java.beans.PropertyChangeListener;import java.beans.PropertyChangeSupport;import java.util.ArrayList;...原创 2013-04-17 18:28:03 · 206 阅读 · 0 评论