summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-09-04 09:38:38 +0300
committerArtur Signell <artur@vaadin.com>2012-09-04 09:39:00 +0300
commit52c4b1905e311f72fdf8080a1917e87c30355a61 (patch)
treeea6550035a87b957f2ede7e37ca0881b2237ce74 /server
parent112572a700c288fc49df60ea23a2ade7c51c5165 (diff)
downloadvaadin-framework-52c4b1905e311f72fdf8080a1917e87c30355a61.tar.gz
vaadin-framework-52c4b1905e311f72fdf8080a1917e87c30355a61.zip
ItemStyleGenerator.getStyle now includes source component (#5822)
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/ui/Table.java11
-rw-r--r--server/src/com/vaadin/ui/Tree.java7
2 files changed, 12 insertions, 6 deletions
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java
index 5eb18ee61f..65189fed0c 100644
--- a/server/src/com/vaadin/ui/Table.java
+++ b/server/src/com/vaadin/ui/Table.java
@@ -3479,8 +3479,8 @@ public class Table extends AbstractSelect implements Action.Container,
* target.
*/
if (cellStyleGenerator != null) {
- String cellStyle = cellStyleGenerator
- .getStyle(itemId, columnId);
+ String cellStyle = cellStyleGenerator.getStyle(this, itemId,
+ columnId);
if (cellStyle != null && !cellStyle.equals("")) {
target.addAttribute("style-" + columnIdMap.key(columnId),
cellStyle);
@@ -3567,7 +3567,7 @@ public class Table extends AbstractSelect implements Action.Container,
* to the target.
*/
if (cellStyleGenerator != null) {
- String rowStyle = cellStyleGenerator.getStyle(itemId, null);
+ String rowStyle = cellStyleGenerator.getStyle(this, itemId, null);
if (rowStyle != null && !rowStyle.equals("")) {
target.addAttribute("rowstyle", rowStyle);
}
@@ -4602,6 +4602,8 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Called by Table when a cell (and row) is painted.
*
+ * @param source
+ * the source Table
* @param itemId
* The itemId of the painted cell
* @param propertyId
@@ -4610,7 +4612,8 @@ public class Table extends AbstractSelect implements Action.Container,
* name will be v-table-cell-content-[style name], or
* v-table-row-[style name] for rows)
*/
- public abstract String getStyle(Object itemId, Object propertyId);
+ public abstract String getStyle(Table source, Object itemId,
+ Object propertyId);
}
@Override
diff --git a/server/src/com/vaadin/ui/Tree.java b/server/src/com/vaadin/ui/Tree.java
index ad3674fe1e..306d1f18ba 100644
--- a/server/src/com/vaadin/ui/Tree.java
+++ b/server/src/com/vaadin/ui/Tree.java
@@ -611,7 +611,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
}
if (itemStyleGenerator != null) {
- String stylename = itemStyleGenerator.getStyle(itemId);
+ String stylename = itemStyleGenerator
+ .getStyle(this, itemId);
if (stylename != null) {
target.addAttribute(TreeConstants.ATTRIBUTE_NODE_STYLE,
stylename);
@@ -1255,12 +1256,14 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
/**
* Called by Tree when an item is painted.
*
+ * @param source
+ * the source Tree
* @param itemId
* The itemId of the item to be painted
* @return The style name to add to this item. (the CSS class name will
* be v-tree-node-[style name]
*/
- public abstract String getStyle(Object itemId);
+ public abstract String getStyle(Tree source, Object itemId);
}
// Overriden so javadoc comes from Container.Hierarchical