use of org.eclipse.core.databinding.observable.map.IObservableMap in project eclipse-pmd by acanda.
the class AddRuleSetConfigurationWizardPage method initDataBindings.
private DataBindingContext initDataBindings() {
final DataBindingContext bindingContext = new DataBindingContext();
//
final IObservableValue locationObserveText = SWTObservables.observeDelayedValue(200, SWTObservables.observeText(location, SWT.Modify));
final IObservableValue locationObserveValue = BeansObservables.observeValue(controller.getModel(), "location");
bindingContext.bindValue(locationObserveText, locationObserveValue, null, null);
//
final ObservableListContentProvider rulesContentProvider = new ObservableListContentProvider();
final IObservableMap rulesObserveMap = PojoObservables.observeMap(rulesContentProvider.getKnownElements(), Rule.class, "name");
tableViewer.setLabelProvider(new ObservableMapLabelProvider(rulesObserveMap));
tableViewer.setContentProvider(rulesContentProvider);
//
final IObservableList rulesObserveList = BeansObservables.observeList(Realm.getDefault(), controller.getModel(), "rules");
tableViewer.setInput(rulesObserveList);
//
final IObservableValue nameObserveTextObserveWidget = SWTObservables.observeDelayedValue(100, SWTObservables.observeText(name, SWT.Modify));
final IObservableValue controllergetModelNameObserveValue = BeansObservables.observeValue(controller.getModel(), "name");
bindingContext.bindValue(nameObserveTextObserveWidget, controllergetModelNameObserveValue, null, null);
//
final IObservableValue observeVisibleBrowseObserveWidget = WidgetProperties.visible().observe(browse);
final IObservableValue browseEnabledControllergetModelObserveValue = BeanProperties.value("browseEnabled").observe(controller.getModel());
bindingContext.bindValue(observeVisibleBrowseObserveWidget, browseEnabledControllergetModelObserveValue, null, null);
//
return bindingContext;
}
Aggregations