} | } | ||||
/** | /** | ||||
* Checks if the given custom component or composite may accept a root component. | |||||
* Checks if the given custom component or composite may accept a root | |||||
* component. | |||||
* <p> | * <p> | ||||
* For internal use only. | * For internal use only. | ||||
* | * | ||||
* | * | ||||
*/ | */ | ||||
public static boolean canSetRoot(Component customComponent) { | public static boolean canSetRoot(Component customComponent) { | ||||
if(customComponent instanceof CustomComponent) { | |||||
if (customComponent instanceof CustomComponent) { | |||||
return true; | return true; | ||||
} | } | ||||
if(customComponent instanceof Composite) { | |||||
return ((Composite)customComponent).getCompositionRoot() == null; | |||||
if (customComponent instanceof Composite) { | |||||
return ((Composite) customComponent).getCompositionRoot() == null; | |||||
} | } | ||||
return false; | return false; | ||||
} | } |
.concat("' is not in any recognized format"); | .concat("' is not in any recognized format"); | ||||
} | } | ||||
} | |||||
} |
public static Collection<Object[]> hexdata() { | public static Collection<Object[]> hexdata() { | ||||
Object[][] validValues = { { "#000000", 0, 0, 0, true }, | Object[][] validValues = { { "#000000", 0, 0, 0, true }, | ||||
{ "#ffffff", 255, 255, 255, true }, | { "#ffffff", 255, 255, 255, true }, | ||||
{ "#FF00ff", 255, 0, 255, true }, { "#aa90e3",170,144,227, true }, | |||||
{ "#FF00ff", 255, 0, 255, true }, | |||||
{ "#aa90e3", 170, 144, 227, true }, | |||||
{ "#016953", 1, 105, 83, true }, | { "#016953", 1, 105, 83, true }, | ||||
{ "#bC64D0", 188, 100, 208, true }, | { "#bC64D0", 188, 100, 208, true }, | ||||
{ "#F100FF", 241, 0, 255, true }, | { "#F100FF", 241, 0, 255, true }, |
public void testUpdateExisting() { | public void testUpdateExisting() { | ||||
Tree tree = new Tree(); | Tree tree = new Tree(); | ||||
String treeDesign = | |||||
"<vaadin-tree selection-mode=\"MULTI\">" + | |||||
"<node item=\"A\">A</node>" + | |||||
"<node item=\"B\">B</node>" + | |||||
"<node item=\"AA\" parent=\"A\">AA</node>" + | |||||
"</vaadin-tree>"; | |||||
String treeDesign = "<vaadin-tree selection-mode=\"MULTI\">" | |||||
+ "<node item=\"A\">A</node>" + "<node item=\"B\">B</node>" | |||||
+ "<node item=\"AA\" parent=\"A\">AA</node>" + "</vaadin-tree>"; | |||||
Design.read(new ByteArrayInputStream(treeDesign.getBytes()), tree); | Design.read(new ByteArrayInputStream(treeDesign.getBytes()), tree); | ||||
Object[] items = tree.getDataProvider(). | |||||
fetchChildren(new HierarchicalQuery(null, null)).toArray(); | |||||
assertArrayEquals(new Object[]{"A", "B"}, items); | |||||
Object[] itemsA = tree.getDataProvider(). | |||||
fetchChildren(new HierarchicalQuery(null, "A")).toArray(); | |||||
assertArrayEquals(new Object[]{"AA"}, itemsA); | |||||
long countB = tree.getDataProvider(). | |||||
fetchChildren(new HierarchicalQuery(null, "B")).count(); | |||||
Object[] items = tree.getDataProvider() | |||||
.fetchChildren(new HierarchicalQuery(null, null)).toArray(); | |||||
assertArrayEquals(new Object[] { "A", "B" }, items); | |||||
Object[] itemsA = tree.getDataProvider() | |||||
.fetchChildren(new HierarchicalQuery(null, "A")).toArray(); | |||||
assertArrayEquals(new Object[] { "AA" }, itemsA); | |||||
long countB = tree.getDataProvider() | |||||
.fetchChildren(new HierarchicalQuery(null, "B")).count(); | |||||
assertEquals(0L, countB); | assertEquals(0L, countB); | ||||
assertTrue(tree.getSelectionModel() instanceof SelectionModel.Multi); | assertTrue(tree.getSelectionModel() instanceof SelectionModel.Multi); | ||||
} | } |
<build> | <build> | ||||
<plugins> | <plugins> | ||||
<plugin> | |||||
<groupId>net.revelc.code.formatter</groupId> | |||||
<artifactId>formatter-maven-plugin</artifactId> | |||||
</plugin> | |||||
<plugin> | <plugin> | ||||
<groupId>org.apache.maven.plugins</groupId> | <groupId>org.apache.maven.plugins</groupId> | ||||
<artifactId>maven-checkstyle-plugin</artifactId> | <artifactId>maven-checkstyle-plugin</artifactId> |
Optional<WebElement> toggleButton = getDriver() | Optional<WebElement> toggleButton = getDriver() | ||||
.findElement(By.className("v-grid-sidebar-content")) | .findElement(By.className("v-grid-sidebar-content")) | ||||
.findElements(By.className("column-hiding-toggle")).stream() | .findElements(By.className("column-hiding-toggle")).stream() | ||||
.filter(element -> element.getText().equals(toggleCaption)).findAny(); | |||||
.filter(element -> element.getText().equals(toggleCaption)) | |||||
.findAny(); | |||||
if (toggleButton.isPresent()) { | if (toggleButton.isPresent()) { | ||||
toggleButton.ifPresent(element -> element.click()); | toggleButton.ifPresent(element -> element.click()); | ||||
} else { | } else { |