Parcourir la source

Fix minor issues with Tree theme and TB API (#9226)

Removes background color from Tree, adds release notes mention, JavaDoc updates.
tags/8.1.0.alpha7
Teemu Suo-Anttila il y a 7 ans
Parent
révision
3a7e95b98a

+ 3
- 2
all/src/main/templates/release-notes.html Voir le fichier

@@ -84,7 +84,7 @@
<ul>
<li>Components In Grid</li>
<li>HTML5 Drag and Drop support</li>
<li>TreeGrid and HierarchicalDataProvider</li>
<li>TreeGrid, Tree and HierarchicalDataProvider</li>
<li>Improved OSGi Support</li>
</ul>

@@ -100,7 +100,8 @@

<h2 id="incompatible">Incompatible or Behavior-altering Changes in @version@</h2>
<li>The <tt>TreeGrid</tt> component replaces both <tt>TreeTable</tt> and <tt>Tree</tt> component</li>
<li>The <tt>TreeGrid</tt> component replaces <tt>TreeTable</tt> component</li>
<li>The <tt>Tree</tt> component replaces old <tt>Tree</tt> component</li>
<li>The <tt>HierarchicalDataProvider</tt> interface replaces <tt>Container.Hierarchical</tt> and <<tt>InMemoryHierarchicalDataProvider</tt> replaces <tt>HierarchicalContainer</tt></li>
<li>The <tt>DragSourceExtension</tt> and <tt>DropTargetExtension</tt> extensions replace the old DnD features</li>
<li>OSGi bundle manifests of Vaadin Framework JARs no longer export <tt>/VAADIN</tt>, and there are new mechanisms for publishing static resources for OSGi</li>

+ 24
- 8
testbench-api/src/main/java/com/vaadin/testbench/elements/TreeElement.java Voir le fichier

@@ -17,6 +17,7 @@ package com.vaadin.testbench.elements;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
@@ -109,25 +110,40 @@ public class TreeElement extends AbstractComponentElement {
}

/**
* Gets all items currently shown in this tree.
* Gets all items currently shown in this tree. The returned element objects
* are the rendered contents for each item.
*
* @return list of all items
* @return list of content elements for all items
*/
public List<TestBenchElement> getAllItems() {
return TestBenchElement.wrapElements(
asTreeGrid().getBody().findElements(By.tagName("tr")),
getCommandExecutor());
return asTreeGrid().getBody().findElements(By.tagName("tr")).stream()
.map(this::findCellContentFromRow).collect(Collectors.toList());
}

/**
* Gets an item at given index.
* Gets an item at given index. The returned element object is the rendered
* content in the given index.
*
* @param index
* 0-based row index
* @return item at given index
* @return content element for item at given index
*/
public TestBenchElement getItem(int index) {
return asTreeGrid().getCell(index, 0);
return findCellContentFromRow(asTreeGrid().getRow(index));
}

/**
* Finds the rendered cell content from given row element. This expects the
* row to contain only a single column rendered with TreeRenderer.
*
* @param rowElement
* the row element
* @return cell content element
*/
protected TestBenchElement findCellContentFromRow(WebElement rowElement) {
return TestBenchElement.wrapElement(
rowElement.findElement(By.className("gwt-HTML")),
getCommandExecutor());
}

/**

+ 11
- 8
themes/src/main/themes/VAADIN/themes/valo/components/_newtree.scss Voir le fichier

@@ -6,16 +6,20 @@ $v-newtree-border-radius: 3px;

@include valo-treegrid($primary-stylename);

.#{$primary-stylename} {
background-color: transparent;
}

.#{$primary-stylename}-row > td {
background-color: transparent;
border: none;
}
.#{$primary-stylename}-tablewrapper {
background-color: transparent;
border: none;
}
.#{$primary-stylename}-row-selected > .#{$primary-stylename}-cell {
background-color: transparent;
background-image: none;
@@ -23,23 +27,23 @@ $v-newtree-border-radius: 3px;
text-shadow: none;
border: none;
}
.#{$primary-stylename}:focus .#{$primary-stylename}-rowmode-row-focused:before {
display: none;
}
.#{$primary-stylename}-cell-content {
border: $v-grid-cell-focused-border;
border-color: transparent;
border-radius: $v-newtree-border-radius;
padding: $v-grid-cell-padding;
}
.#{$primary-stylename}:focus .#{$primary-stylename}-rowmode-cell-focused
.#{$primary-stylename}:focus .#{$primary-stylename}-rowmode-cell-focused
> .#{$primary-stylename}-node > .#{$primary-stylename}-cell-content {
border: $v-grid-cell-focused-border;
}
// Selected
.#{$primary-stylename}-row-selected {
$grid-sel-bg: $v-grid-row-selected-background-color;
@@ -56,4 +60,3 @@ $v-newtree-border-radius: 3px;
}
}
}


Chargement…
Annuler
Enregistrer