简体   繁体   English

使用SWT / Jface在组合框选择上填充表格

[英]Populate table on combo box selection using SWT/Jface

有什么方法可以使用SWT / Jface数据绑定在组合框值选择上填充表查看器?

You will not use JFace databinding with this solution but I hope you will find what you want : 您不会在此解决方案中使用JFace数据绑定,但希望您能找到所需的内容:

Use a ComboViewer with your TableViewer and do something like : ComboViewerTableViewer一起使用,并执行以下操作:

comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {

    @Override
    public void selectionChanged(SelectionChangedEvent event) {
         tableViewer.setInput(event.getSelection());
         tableViewer.refresh();
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM