use of org.gwtproject.view.client.TreeViewModel.DefaultNodeInfo in project gwtproject by treblereel.
the class DefaultNodeInfoTest method testSetDataDisplay.
public void testSetDataDisplay() {
SelectionModel<String> model = new SingleSelectionModel<String>();
org.gwtproject.view.client.DefaultSelectionEventManager<String> manager = DefaultSelectionEventManager.createDefaultManager();
MockDataProvider<String> provider = new MockDataProvider<String>(null);
DefaultNodeInfo<String> nodeInfo = new DefaultNodeInfo<String>(provider, new TextCell(), model, manager, null);
MockHasData<String> display = new MockHasData<String>();
display.setVisibleRange(0, 10);
display.clearLastRowDataAndRange();
assertEquals(0, display.getHandlerCount(org.gwtproject.view.client.CellPreviewEvent.getType()));
// setDataDisplay.
nodeInfo.setDataDisplay(display);
assertEquals(1, display.getHandlerCount(org.gwtproject.view.client.CellPreviewEvent.getType()));
provider.assertLastRangeChanged(display);
provider.clearLastRangeChanged();
display.setVisibleRange(0, 5);
provider.assertLastRangeChanged(display);
provider.clearLastRangeChanged();
// unsetDataDisplay.
nodeInfo.unsetDataDisplay();
assertEquals(0, display.getHandlerCount(CellPreviewEvent.getType()));
display.setVisibleRange(0, 5);
provider.assertLastRangeChanged(null);
}
use of org.gwtproject.view.client.TreeViewModel.DefaultNodeInfo in project gwtproject by treblereel.
the class DefaultNodeInfoTest method testAccessors.
public void testAccessors() {
org.gwtproject.view.client.ListDataProvider<String> provider = new ListDataProvider<String>();
TextCell cell = new TextCell();
org.gwtproject.view.client.SingleSelectionModel<String> selectionModel = new org.gwtproject.view.client.SingleSelectionModel<String>(null);
ValueUpdater<String> valueUpdater = new ValueUpdater<String>() {
@Override
public void update(String value) {
}
};
DefaultNodeInfo<String> nodeInfo = new DefaultNodeInfo<String>(provider, cell, selectionModel, valueUpdater);
assertEquals(provider, nodeInfo.getProvidesKey());
assertEquals(cell, nodeInfo.getCell());
assertEquals(selectionModel, nodeInfo.getSelectionModel());
assertEquals(valueUpdater, nodeInfo.getValueUpdater());
}
Aggregations