1 11 12 package org.eclipse.jface.internal.databinding.provisional.factories; 13 14 import org.eclipse.jface.internal.databinding.provisional.DataBindingContext; 15 import org.eclipse.jface.internal.databinding.provisional.description.ListModelDescription; 16 import org.eclipse.jface.internal.databinding.provisional.description.TableModelDescription; 17 import org.eclipse.jface.internal.databinding.provisional.observable.IObservable; 18 19 23 public class DefaultObservableFactory implements IObservableFactory { 24 25 private final DataBindingContext dataBindingContext; 26 27 32 public DefaultObservableFactory(DataBindingContext dataBindingContext) { 33 this.dataBindingContext = dataBindingContext; 34 } 35 36 public IObservable createObservable(Object description) { 37 if (description instanceof ListModelDescription) { 38 ListModelDescription listModelDescription = (ListModelDescription) description; 39 TableModelDescription tableModelDescription = new TableModelDescription( 40 listModelDescription.getCollectionProperty(), 41 new Object [] { listModelDescription.getPropertyID() }); 42 return dataBindingContext.createObservable(tableModelDescription); 43 } 44 return null; 45 } 46 47 } 48 | Popular Tags |