2014-11-08 43 views
-1

在eclipse e4中。雙擊JfaceTable中的一行以獲取該行上對象的詳細信息

在雙擊jface表中的一行時,我想將該行上的數據看作對話框。

現有代碼

orgTable.addDoubleClickListener(new IDoubleClickListener() { 

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

當反對投票ATLEAST發表評論,這樣我可以確保我不要讓同樣的錯誤 – Praveen 2014-11-10 01:25:41

回答

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()); 
     } 
    }); 
相關問題