aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java
diff options
context:
space:
mode:
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>2009-04-12 00:07:09 +0000
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>2009-04-12 00:07:09 +0000
commit204a857eb54f1840f27969faa9855c38390d2751 (patch)
tree5beda66dabd194abe84219349472ba05be73b667 /src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java
parent8c21a6f36ea05bfa48b34d6162bc5a2fe3fa488b (diff)
downloadvaadin-framework-204a857eb54f1840f27969faa9855c38390d2751.tar.gz
vaadin-framework-204a857eb54f1840f27969faa9855c38390d2751.zip
Implementation serialization support for Toolkit. Fixes #695
svn changeset:7387/svn branch:6.0
Diffstat (limited to 'src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java')
-rw-r--r--src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java b/src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java
index 6052d96642..4872a670fb 100644
--- a/src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java
+++ b/src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java
@@ -37,6 +37,7 @@ import com.itmill.toolkit.ui.Button.ClickListener;
* @author magi
*/
public class GeneratedColumnExample extends CustomComponent {
+
/**
* The business model: fill-up at a gas station.
*/
@@ -116,12 +117,13 @@ public class GeneratedColumnExample extends CustomComponent {
* implementations, as they are not needed in this example.
*/
public class MySimpleIndexedContainer implements Container, Indexed {
- Vector items;
+
+ Vector<BeanItem> items;
Object itemtemplate;
public MySimpleIndexedContainer(Object itemtemplate) {
this.itemtemplate = itemtemplate;
- items = new Vector(); // Yeah this is just a test
+ items = new Vector<BeanItem>(); // Yeah this is just a test
}
public boolean addContainerProperty(Object propertyId, Class type,
@@ -164,7 +166,7 @@ public class GeneratedColumnExample extends CustomComponent {
if (itemId instanceof Integer) {
int pos = ((Integer) itemId).intValue();
if (pos >= 0 && pos < items.size()) {
- Item item = (Item) items.get(pos);
+ Item item = items.get(pos);
// The BeanItem provides the property objects for the items.
return item.getItemProperty(propertyId);
@@ -185,7 +187,7 @@ public class GeneratedColumnExample extends CustomComponent {
if (itemId instanceof Integer) {
int pos = ((Integer) itemId).intValue();
if (pos >= 0 && pos < items.size()) {
- return (Item) items.get(pos);
+ return items.get(pos);
}
}
return null;
@@ -365,6 +367,9 @@ public class GeneratedColumnExample extends CustomComponent {
/** Table column generator for calculating consumption column. */
class ConsumptionColumnGenerator implements Table.ColumnGenerator {
+
+ private static final long serialVersionUID = -1077081052659001251L;
+
/**
* Generates a cell containing value calculated from the item.
*/
@@ -408,6 +413,7 @@ public class GeneratedColumnExample extends CustomComponent {
/** Table column generator for calculating daily cost column. */
class DailyCostColumnGenerator extends ConsumptionColumnGenerator {
+
@Override
public Component generateCell(FillUp fillup, FillUp prev) {
double dailycost = fillup.dailyCost(prev);