summaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java')
-rw-r--r--src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java13
1 files changed, 9 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..5b9e4d86eb 100644
--- a/src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java
+++ b/src/com/itmill/toolkit/automatedtests/featurebrowser/GeneratedColumnExample.java
@@ -36,7 +36,9 @@ import com.itmill.toolkit.ui.Button.ClickListener;
*
* @author magi
*/
+@SuppressWarnings("serial")
public class GeneratedColumnExample extends CustomComponent {
+
/**
* The business model: fill-up at a gas station.
*/
@@ -116,12 +118,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 +167,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 +188,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 +368,7 @@ public class GeneratedColumnExample extends CustomComponent {
/** Table column generator for calculating consumption column. */
class ConsumptionColumnGenerator implements Table.ColumnGenerator {
+
/**
* Generates a cell containing value calculated from the item.
*/
@@ -408,6 +412,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);