2013-04-01 43 views
0

我正在eclipse中基于Form的插件编辑器上工作。我的表单包含3个文本字段和一个表查看器和4个按钮,顺序相同。在eclipse中基于tab编辑器插件的Tabbing顺序

我想通过键盘“Tab”按钮添加支持。当用户从1个文本字段移动到2个和下一个时,选项卡的顺序可以确定。但是当用户移动到Table查看器时,Tab按钮不能按预期工作。

但直到现在我没有编写任何代码来处理Tab排序,任何人都可以告诉我如何为我的窗体实现这种行为。

在此先感谢..

回答

3

看看下面的方法上Composite

public void setTabList (Control [] tabList) 

ex: 
    Composite comp = new Composite(parent,SWT.NONE); 
    comp.setLayout(new GridLayout(4,false)); 
    Button b1 = new Button(comp,SWT.NONE); 
    b1.setText("button1"); 
    Button b2 = new Button(comp,SWT.NONE); 
    b2.setText("button2"); 
    Button b3 = new Button(comp,SWT.NONE); 
    b3.setText("button3"); 
    Button b4 = new Button(comp,SWT.NONE); 
    b4.setText("button4"); 
    comp.setTabList(new Control[]{b1,b3,b4,b2});