在JfaceTable中连续使用DoubleClick来获取该行上对象的详细信息

时间:2014-11-08 17:47:38

标签: swt jface e4

eclipse e4。

双击jface表中的一行,我希望将该行的数据视为对话框。

现有代码

orgTable.addDoubleClickListener(new IDoubleClickListener() {

        @Override
        public void doubleClick(DoubleClickEvent event) {
            System.out.println("Double CLikc works");
        }
    });

1 个答案:

答案 0 :(得分:0)

OrgTable.addDoubleClickListener(new IDoubleClickListener() {

        @Override
        public void doubleClick(DoubleClickEvent event) {
            System.out.println("Double CLikc works");
            IStructuredSelection sel = (IStructuredSelection) event.getSelection();
            OrgDetails org = (OrgDetails) sel.getFirstElement();
            if(org != null){
                System.out.println("Double-click on : "+ org.getOrgName()+ " " + org.getTin());
            }
            System.out.println(orgTable.getElementAt());
        }
    });