aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarko Grönroos <magi@iki.fi>2008-08-29 11:12:32 +0000
committerMarko Grönroos <magi@iki.fi>2008-08-29 11:12:32 +0000
commita08bc03832fabeb3b0b5d848234a60ba8f62b604 (patch)
tree1d6363153cb41f6885bd9c1af2be0d3f347d59b0
parentfed159396c52901384235e04a2bd3ab969faf74c (diff)
downloadvaadin-framework-a08bc03832fabeb3b0b5d848234a60ba8f62b604.tar.gz
vaadin-framework-a08bc03832fabeb3b0b5d848234a60ba8f62b604.zip
Reformatted generated Table column example code.
svn changeset:5305/svn branch:trunk
-rw-r--r--WebContent/ITMILL/themes/example/styles.css3
-rw-r--r--src/com/itmill/toolkit/demo/featurebrowser/GeneratedColumnExample.java24
2 files changed, 15 insertions, 12 deletions
diff --git a/WebContent/ITMILL/themes/example/styles.css b/WebContent/ITMILL/themes/example/styles.css
index b68c9cc2bb..56911914f4 100644
--- a/WebContent/ITMILL/themes/example/styles.css
+++ b/WebContent/ITMILL/themes/example/styles.css
@@ -37,4 +37,5 @@
.i-label-column-price, .i-label-column-consumption, .i-label-column-dailycost {
color: blue;
text-align: right;
-} \ No newline at end of file
+}
+
diff --git a/src/com/itmill/toolkit/demo/featurebrowser/GeneratedColumnExample.java b/src/com/itmill/toolkit/demo/featurebrowser/GeneratedColumnExample.java
index 417828480f..8d9dd3abf7 100644
--- a/src/com/itmill/toolkit/demo/featurebrowser/GeneratedColumnExample.java
+++ b/src/com/itmill/toolkit/demo/featurebrowser/GeneratedColumnExample.java
@@ -1,3 +1,7 @@
+/*
+@ITMillApache2LicenseForJavaFiles@
+ */
+
package com.itmill.toolkit.demo.featurebrowser;
import java.util.Collection;
@@ -250,25 +254,25 @@ public class GeneratedColumnExample extends CustomComponent {
}
public boolean isLastId(Object itemId) {
- return ((Integer) itemId).intValue() == (items.size() - 1);
+ return ((Integer) itemId).intValue() == (items.size()-1);
}
public Object lastItemId() {
- return new Integer(items.size() - 1);
+ return new Integer(items.size()-1);
}
public Object nextItemId(Object itemId) {
int pos = indexOfId(itemId);
- if (pos >= items.size() - 1)
+ if (pos >= items.size()-1)
return null;
- return getIdByIndex(pos + 1);
+ return getIdByIndex(pos+1);
}
public Object prevItemId(Object itemId) {
int pos = indexOfId(itemId);
if (pos <= 0)
return null;
- return getIdByIndex(pos - 1);
+ return getIdByIndex(pos-1);
}
}
@@ -293,15 +297,13 @@ public class GeneratedColumnExample extends CustomComponent {
/** Formats the value in a column containing Double objects. */
class ValueColumnGenerator implements Table.ColumnGenerator {
- String format;
-
- /** Format string for the Double values. */
-
+ String format; /* Format string for the Double values. */
+
/** Creates double value column formatter with the given format string. */
public ValueColumnGenerator(String format) {
this.format = format;
}
-
+
/**
* Generates the cell containing the Double value. The column is
* irrelevant in this use case.
@@ -367,7 +369,7 @@ public class GeneratedColumnExample extends CustomComponent {
// Retrieve the POJOs.
FillUp fillup = (FillUp) ((BeanItem) indexedSource.getItem(itemId)).getBean();
- FillUp prev = (FillUp) ((BeanItem) source.getItem(prevItemId)).getBean();
+ FillUp prev = (FillUp) ((BeanItem) source.getItem(prevItemId)).getBean();
// Do the business logic
return generateCell(fillup, prev);