Prashant P
Prashant P

Reputation: 21

Populate table on combo box selection using SWT/Jface

Is there any way to populate table viewer on combo box value selection using SWT/Jface databinding?

Upvotes: 0

Views: 745

Answers (1)

l1sq0u48
l1sq0u48

Reputation: 381

You will not use JFace databinding with this solution but I hope you will find what you want :

Use a ComboViewer with your TableViewer and do something like :

comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {

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

Upvotes: 1

Related Questions