DataEditor implements Widget { public void navigate(FactoryBase<?,?> newValue) { updateState(dataEditorState.edit(newValue)); } DataEditor(AttributeVisualisationMappingBuilder attributeVisualisationMappingBuilder, UniformDesign uniformDesign, BiFunction<Node, FactoryBase<?,?>,Node> dataVisualisationCustomizer);  DataEditor(AttributeVisualisationMappingBuilder attributeVisualisationMappingBuilder, UniformDesign uniformDesign); ReadOnlyObjectProperty<FactoryBase<?,?>> editData(); void navigate(FactoryBase<?,?> newValue); void navigateBack(FactoryBase<?,?> newValue); void edit(FactoryBase<?,?> newValue); void setHistory(List<FactoryBase<?,?>> data); void reset(); @Override Node createContent(); SimpleBooleanProperty historyNavigationVisibleProperty(); @Override void destroy();  }
@Test public void testBack_limit() { UniformDesign uniformDesign = UniformDesignBuilder.build(); DataEditor dataEditor = new DataEditor(new AttributeVisualisationMappingBuilder(new ArrayList<>()),uniformDesign); for (int i=0;i<100;i++){ dataEditor.navigate(new ExampleData1()); } Assertions.assertEquals(DataEditorState.HISTORY_LIMIT,dataEditor.dataEditorState.displayedEntities.size()); }
@Test public void test_navigated_hierarchy() { UniformDesign uniformDesign = UniformDesignBuilder.build(); DataEditor dataEditor = new DataEditor(new AttributeVisualisationMappingBuilder(new ArrayList<>()),uniformDesign); ExampleData1 root = new ExampleData1(); ExampleData2 value = new ExampleData2(); root.referenceAttribute.set(value); dataEditor.navigate(root); dataEditor.navigate(value); Assertions.assertEquals(1,dataEditor.dataEditorState.displayedEntities.size()); Assertions.assertEquals(root,new ArrayList<>(dataEditor.dataEditorState.displayedEntities).get(0)); dataEditor.navigate(root); Assertions.assertEquals(2,dataEditor.dataEditorState.displayedEntities.size()); Assertions.assertEquals(value,new ArrayList<>(dataEditor.dataEditorState.displayedEntities).get(0)); }