@Test public void setRoot2() { ModelProvider provider = new ModelProvider(); MockBnTextField tfHeight = new MockBnTextField(); tfHeight.setModelProvider(provider); tfHeight.setPath(new Path("this.dimension.height")); MockBnTextField tfWidth = new MockBnTextField(); tfWidth.setModelProvider(provider); tfWidth.setPath(new Path("this.dimension.width")); provider.setPresentationModel(root); ProductPM root2 = new ProductPM(); provider.setPresentationModel(root2); }
public void setPresentationModel(PresentationModel newPresentationModel) { if (newPresentationModel != null) { if (this.presentationModelType.isInstance(newPresentationModel) == false) { throw new IllegalArgumentException("the new presentationModel must be instance of " + presentationModelType.getName() + " but was " + newPresentationModel.getClass().getName()); } } PresentationModel old = this.presentationModel; if (old == newPresentationModel) { return; } if (old != null) { for (Subscription b : subscriptions) { b.stopObservation(); } } this.presentationModel = newPresentationModel; if (this.presentationModel != null) { for (Subscription b : subscriptions) { b.startObservation(); } } this.getPropertyChangeSupport().firePropertyChange("presentationModel", old, newPresentationModel); }
ModelProvider extends AbstractBean implements IModelProvider, Serializable { public void setPresentationModel(PresentationModel newPresentationModel) { if (newPresentationModel != null) { if (this.presentationModelType.isInstance(newPresentationModel) == false) { throw new IllegalArgumentException("the new presentationModel must be instance of " + presentationModelType.getName() + " but was " + newPresentationModel.getClass().getName()); } } PresentationModel old = this.presentationModel; if (old == newPresentationModel) { return; } if (old != null) { for (Subscription b : subscriptions) { b.stopObservation(); } } this.presentationModel = newPresentationModel; if (this.presentationModel != null) { for (Subscription b : subscriptions) { b.startObservation(); } } this.getPropertyChangeSupport().firePropertyChange("presentationModel", old, newPresentationModel); } }
ModelProvider extends AbstractBean implements IModelProvider, Serializable { public void setPresentationModel(PresentationModel newPresentationModel) { if (newPresentationModel != null) { if (this.presentationModelType.isInstance(newPresentationModel) == false) { throw new IllegalArgumentException("the new presentationModel must be instance of " + presentationModelType.getName() + " but was " + newPresentationModel.getClass().getName()); } } PresentationModel old = this.presentationModel; if (old == newPresentationModel) { return; } if (old != null) { for (Subscription b : subscriptions) { b.stopObservation(); } } this.presentationModel = newPresentationModel; if (this.presentationModel != null) { for (Subscription b : subscriptions) { b.startObservation(); } } this.getPropertyChangeSupport().firePropertyChange("presentationModel", old, newPresentationModel); } ModelProvider();  ModelProvider(Class<? extends PresentationModel> presentationModelType);  ModelProvider(PresentationModel presentationModel); }
ModelProvider extends AbstractBean implements IModelProvider, Serializable { public void setPresentationModel(PresentationModel newPresentationModel) { if (newPresentationModel != null) { if (this.presentationModelType.isInstance(newPresentationModel) == false) { throw new IllegalArgumentException("the new presentationModel must be instance of " + presentationModelType.getName() + " but was " + newPresentationModel.getClass().getName()); } } PresentationModel old = this.presentationModel; if (old == newPresentationModel) { return; } if (old != null) { for (Subscription b : subscriptions) { b.stopObservation(); } } this.presentationModel = newPresentationModel; if (this.presentationModel != null) { for (Subscription b : subscriptions) { b.startObservation(); } } this.getPropertyChangeSupport().firePropertyChange("presentationModel", old, newPresentationModel); } ModelProvider();  ModelProvider(Class<? extends PresentationModel> presentationModelType);  ModelProvider(PresentationModel presentationModel); @SuppressWarnings("unchecked") T getPresentationModel(); void setPresentationModel(PresentationModel newPresentationModel); @SuppressWarnings("unchecked") T getPresentationModel(Path path); Class<? extends PresentationModel> getPresentationModelType(); void setPresentationModelType(Class<? extends PresentationModel> newType); void addModelProviderListener(Path path, ModelProviderListener l); void removeModelProviderListener(Path path, ModelProviderListener l); }
ModelProvider extends AbstractBean implements IModelProvider, Serializable { public void setPresentationModel(PresentationModel newPresentationModel) { if (newPresentationModel != null) { if (this.presentationModelType.isInstance(newPresentationModel) == false) { throw new IllegalArgumentException("the new presentationModel must be instance of " + presentationModelType.getName() + " but was " + newPresentationModel.getClass().getName()); } } PresentationModel old = this.presentationModel; if (old == newPresentationModel) { return; } if (old != null) { for (Subscription b : subscriptions) { b.stopObservation(); } } this.presentationModel = newPresentationModel; if (this.presentationModel != null) { for (Subscription b : subscriptions) { b.startObservation(); } } this.getPropertyChangeSupport().firePropertyChange("presentationModel", old, newPresentationModel); } ModelProvider();  ModelProvider(Class<? extends PresentationModel> presentationModelType);  ModelProvider(PresentationModel presentationModel); @SuppressWarnings("unchecked") T getPresentationModel(); void setPresentationModel(PresentationModel newPresentationModel); @SuppressWarnings("unchecked") T getPresentationModel(Path path); Class<? extends PresentationModel> getPresentationModelType(); void setPresentationModelType(Class<? extends PresentationModel> newType); void addModelProviderListener(Path path, ModelProviderListener l); void removeModelProviderListener(Path path, ModelProviderListener l);  }