protected DataBindingContext initDataBindings() { DataBindingContext bindingContext = new DataBindingContext(); // ObservableListContentProvider listContentProvider = new ObservableListContentProvider(); IObservableMap[] observeMaps = BeansObservables.observeMaps( listContentProvider.getKnownElements(), ApprovalMini.class, new String[] { "idApproval1", "approval1LetterDate", "apprMinisRef", "minisapprLetterDate", "minisapprRef", "letterdatetoDept", "refapprtoDept", "monthAppr", "quarterYear", "yearAppr", "filename", "attachment", "caseID" }); tableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps)); tableViewer.setContentProvider(listContentProvider); // approvalMiniList = Properties.selfList(ApprovalMini.class).observe(approvalMinis); tableViewer.setInput(approvalMiniList); // return bindingContext; }
private static IObservableMap[] createAttributeMap( IObservableSet knownElements, AbstractColumnLabelProviderDelegate... baseProviders) { List<String> propertyNamesToObserve = new ArrayList<String>(); for (AbstractColumnLabelProviderDelegate baseProvider : baseProviders) { propertyNamesToObserve.addAll(baseProvider.getPropertyNamesToObserve()); } IValueProperty[] labelProperties = new IValueProperty[propertyNamesToObserve.size()]; for (int i = 0; i < labelProperties.length; i++) { IBeanValueProperty property = BeanProperties.value(propertyNamesToObserve.get(i)); labelProperties[i] = property; } return Properties.observeEach(knownElements, labelProperties); }