svn changeset:24155/svn branch:6.8tags/7.0.0.beta1
row.addStyleName("v-selected"); | row.addStyleName("v-selected"); | ||||
} | } | ||||
tBodyElement.appendChild(row.getElement()); | tBodyElement.appendChild(row.getElement()); | ||||
adopt(row); | |||||
// Add to renderedRows before adopt so iterator() will return also | |||||
// this row if called in an attach handler (#9264) | |||||
renderedRows.add(row); | renderedRows.add(row); | ||||
adopt(row); | |||||
} | } | ||||
private void insertRowAt(VScrollTableRow row, int index) { | private void insertRowAt(VScrollTableRow row, int index) { | ||||
} | } | ||||
availW -= totalExtraWidth; | availW -= totalExtraWidth; | ||||
int forceScrollBodyWidth = -1; | int forceScrollBodyWidth = -1; | ||||
int extraSpace = availW - usedMinimumWidth; | int extraSpace = availW - usedMinimumWidth; | ||||
if (extraSpace < 0) { | if (extraSpace < 0) { | ||||
if (getTotalRows() == 0) { | if (getTotalRows() == 0) { |
if (isTreeCellAdded) { | if (isTreeCellAdded) { | ||||
return false; | return false; | ||||
} | } | ||||
return curColIndex == colIndexOfHierarchy | |||||
+ (showRowHeaders ? 1 : 0); | |||||
return curColIndex == getHierarchyColumnIndex(); | |||||
} | } | ||||
@Override | @Override | ||||
super.onAttach(); | super.onAttach(); | ||||
if (getIndentWidth() < 0) { | if (getIndentWidth() < 0) { | ||||
detectIndent(this); | detectIndent(this); | ||||
// If we detect indent here then the size of the hierarchy | |||||
// column is still wrong as it has been set when the indent | |||||
// was not known. | |||||
int w = getCellWidthFromDom(getHierarchyColumnIndex()); | |||||
if (w >= 0) { | |||||
setColWidth(getHierarchyColumnIndex(), w); | |||||
} | |||||
} | |||||
} | |||||
private int getCellWidthFromDom(int cellIndex) { | |||||
final Element cell = DOM.getChild(getElement(), cellIndex); | |||||
String w = cell.getStyle().getProperty("width"); | |||||
if (w == null || "".equals(w) || !w.endsWith("px")) { | |||||
return -1; | |||||
} else { | |||||
return Integer.parseInt(w.substring(0, w.length() - 2)); | |||||
} | } | ||||
} | } | ||||
@Override | @Override | ||||
protected void setCellWidth(int cellIx, int width) { | protected void setCellWidth(int cellIx, int width) { | ||||
if (cellIx == colIndexOfHierarchy + (showRowHeaders ? 1 : 0)) { | |||||
if (cellIx == getHierarchyColumnIndex()) { | |||||
// take indentation padding into account if this is the | // take indentation padding into account if this is the | ||||
// hierarchy column | // hierarchy column | ||||
width = Math.max(width - getIndent(), 0); | |||||
int indent = getIndent(); | |||||
if (indent != -1) { | |||||
width = Math.max(width - getIndent(), 0); | |||||
} | |||||
} | } | ||||
super.setCellWidth(cellIx, width); | super.setCellWidth(cellIx, width); | ||||
} | } | ||||
private int getHierarchyColumnIndex() { | |||||
return colIndexOfHierarchy + (showRowHeaders ? 1 : 0); | |||||
} | |||||
private int getIndent() { | private int getIndent() { | ||||
return (depth + 1) * getIndentWidth(); | return (depth + 1) * getIndentWidth(); | ||||
} | } |
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case"> | |||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |||||
<link rel="selenium.base" href="" /> | |||||
<title>New Test</title> | |||||
</head> | |||||
<body> | |||||
<table cellpadding="1" cellspacing="1" border="1"> | |||||
<thead> | |||||
<tr><td rowspan="1" colspan="3">New Test</td></tr> | |||||
</thead><tbody> | |||||
<tr> | |||||
<td>open</td> | |||||
<td>/run/com.vaadin.tests.components.treetable.TreeTableTest?restartApplication</td> | |||||
<td></td> | |||||
</tr> | |||||
<tr> | |||||
<td>mouseClick</td> | |||||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_Smenu#item0</td> | |||||
<td>38,10</td> | |||||
</tr> | |||||
<tr> | |||||
<td>mouseClick</td> | |||||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[0]/VMenuBar[0]#item5</td> | |||||
<td>52,6</td> | |||||
</tr> | |||||
<tr> | |||||
<td>mouseClick</td> | |||||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[1]/VMenuBar[0]#item1</td> | |||||
<td>68,8</td> | |||||
</tr> | |||||
<tr> | |||||
<td>mouseClick</td> | |||||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[2]/VMenuBar[0]#item0</td> | |||||
<td>12,4</td> | |||||
</tr> | |||||
<tr> | |||||
<td>open</td> | |||||
<td>/run/com.vaadin.tests.components.treetable.TreeTableTest</td> | |||||
<td></td> | |||||
</tr> | |||||
<tr> | |||||
<td>mouseClick</td> | |||||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_Smenu#item0</td> | |||||
<td>33,7</td> | |||||
</tr> | |||||
<tr> | |||||
<td>mouseClick</td> | |||||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[0]/VMenuBar[0]#item5</td> | |||||
<td>52,9</td> | |||||
</tr> | |||||
<tr> | |||||
<td>mouseClick</td> | |||||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[1]/VMenuBar[0]#item1</td> | |||||
<td>39,5</td> | |||||
</tr> | |||||
<tr> | |||||
<td>mouseClick</td> | |||||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[2]/VMenuBar[0]#item1</td> | |||||
<td>23,3</td> | |||||
</tr> | |||||
<tr> | |||||
<td>screenCapture</td> | |||||
<td></td> | |||||
<td>item-added-to-empty-treetable</td> | |||||
</tr> | |||||
</tbody></table> | |||||
</body> | |||||
</html> |