\r
}\r
\r
+ public void testParentWhenRemovingFilterFromContainer() {\r
+ HierarchicalContainer container = new HierarchicalContainer();\r
+ initializeContainer(container);\r
+ container.setIncludeParentsWhenFiltering(true);\r
+ container.addContainerFilter(FULLY_QUALIFIED_NAME, "ab", false, false);\r
+ Object p1 = container.getParent("com.vaadin.ui.TabSheet");\r
+ assertEquals("com.vaadin.ui", p1);\r
+ p1 = container\r
+ .getParent("com.vaadin.terminal.gwt.client.ui.VPopupCalendar");\r
+ assertNull(p1);\r
+ container.removeAllContainerFilters();\r
+ p1 = container\r
+ .getParent("com.vaadin.terminal.gwt.client.ui.VPopupCalendar");\r
+ assertEquals("com.vaadin.terminal.gwt.client.ui", p1);\r
+\r
+ }\r
+\r
+ public void testChangeParentInFilteredContainer() {\r
+ HierarchicalContainer container = new HierarchicalContainer();\r
+ initializeContainer(container);\r
+ container.setIncludeParentsWhenFiltering(true);\r
+ container.addContainerFilter(FULLY_QUALIFIED_NAME, "Tab", false, false);\r
+\r
+ // Change parent of filtered item\r
+ Object p1 = container.getParent("com.vaadin.ui.TabSheet");\r
+ assertEquals("com.vaadin.ui", p1);\r
+ container.setParent("com.vaadin.ui.TabSheet", "com.vaadin");\r
+ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
+ assertEquals("com.vaadin", p1);\r
+ container.setParent("com.vaadin.ui.TabSheet", "com");\r
+ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
+ assertEquals("com", p1);\r
+ container.setParent("com.vaadin.ui.TabSheet", null);\r
+ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
+ assertNull(p1);\r
+\r
+ // root -> non-root\r
+ container.setParent("com.vaadin.ui.TabSheet", "com");\r
+ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
+ assertEquals("com", p1);\r
+\r
+ }\r
+\r
public void testHierarchicalFilteringWithParents() {\r
HierarchicalContainer container = new HierarchicalContainer();\r
initializeContainer(container);\r