@Test public void testSelectionOnReconnect() { setup(); assertEquals("modelSize", 10, this.model.things.size()); this.model.things.getSelection().setInterval(2, 4); assertEquals("model.things.getSelection().size()", 3, this.model.things.getSelection().size()); assertEquals("listCell.getSelectedIndices().length", 3, this.list.getSelectedIndices().length); this.provider.setPresentationModel(null); assertEquals("model.things.getSelection().size()", 3, this.model.things.getSelection().size()); assertEquals("listCell.getSelectedIndices().length", 0, this.list.getSelectedIndices().length); this.provider.setPresentationModel(this.model); assertEquals("model.things.getSelection().size()", 3, this.model.things.getSelection().size()); assertEquals("listCell.getSelectedIndices().length", 3, this.list.getSelectedIndices().length); }
public void setPresentationModel(IListPM newModel) { IListPM oldModel = this.presentationModel; if (newModel == oldModel) { return; } disconnect(); this.presentationModel = newModel; connect(); this.firePropertyChange("presentationModel", oldModel, newModel); }
BnList extends JList implements View<IListPM>, ModelSubscriber { public void setPresentationModel(IListPM newModel) { IListPM oldModel = this.presentationModel; if (newModel == oldModel) { return; } disconnect(); this.presentationModel = newModel; connect(); this.firePropertyChange("presentationModel", oldModel, newModel); } }
BnList extends JList implements View<IListPM>, ModelSubscriber { public void setPresentationModel(IListPM newModel) { IListPM oldModel = this.presentationModel; if (newModel == oldModel) { return; } disconnect(); this.presentationModel = newModel; connect(); this.firePropertyChange("presentationModel", oldModel, newModel); } BnList(); }
BnList extends JList implements View<IListPM>, ModelSubscriber { public void setPresentationModel(IListPM newModel) { IListPM oldModel = this.presentationModel; if (newModel == oldModel) { return; } disconnect(); this.presentationModel = newModel; connect(); this.firePropertyChange("presentationModel", oldModel, newModel); } BnList(); IListPM getPresentationModel(); void setPresentationModel(IListPM newModel); IModelProvider getModelProvider(); void setModelProvider(IModelProvider provider); Path getPath(); void setPath(Path path); CellConfig getCellConfig(); void setCellConfig(CellConfig cellConfig); }
BnList extends JList implements View<IListPM>, ModelSubscriber { public void setPresentationModel(IListPM newModel) { IListPM oldModel = this.presentationModel; if (newModel == oldModel) { return; } disconnect(); this.presentationModel = newModel; connect(); this.firePropertyChange("presentationModel", oldModel, newModel); } BnList(); IListPM getPresentationModel(); void setPresentationModel(IListPM newModel); IModelProvider getModelProvider(); void setModelProvider(IModelProvider provider); Path getPath(); void setPath(Path path); CellConfig getCellConfig(); void setCellConfig(CellConfig cellConfig);  }