aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/ui/CustomLayout.java
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2008-09-01 05:23:15 +0000
committerArtur Signell <artur.signell@itmill.com>2008-09-01 05:23:15 +0000
commitf1871b8525ad36aa66110b4911dd1a2595c9c9a0 (patch)
treebb24248d4aaf24422b60e5ce7d493e39f4c5ee41 /src/com/itmill/toolkit/ui/CustomLayout.java
parentf6b7e02013458950bc93c23993a1585496a0ab16 (diff)
downloadvaadin-framework-f1871b8525ad36aa66110b4911dd1a2595c9c9a0.tar.gz
vaadin-framework-f1871b8525ad36aa66110b4911dd1a2595c9c9a0.zip
Fixes #2022 - UTF-8 is now always used for custom layouts
svn changeset:5310/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/CustomLayout.java')
-rw-r--r--src/com/itmill/toolkit/ui/CustomLayout.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/com/itmill/toolkit/ui/CustomLayout.java b/src/com/itmill/toolkit/ui/CustomLayout.java
index 0cb8851202..06ef2923ea 100644
--- a/src/com/itmill/toolkit/ui/CustomLayout.java
+++ b/src/com/itmill/toolkit/ui/CustomLayout.java
@@ -57,16 +57,17 @@ public class CustomLayout extends AbstractLayout {
* Constructs a custom layout with the template given in the stream.
*
* @param templateStream
- * Stream containing template data. Must be using UTF-8
- * encoding. To use a String as a template use for instance
- * new ByteArrayInputStream("<template>".getBytes()).
+ * Stream containing template data. Must be using UTF-8 encoding.
+ * To use a String as a template use for instance new
+ * ByteArrayInputStream("<template>".getBytes()).
* @param streamLength
- * Length of the templateStream
+ * Length of the templateStream
* @throws IOException
*/
public CustomLayout(InputStream templateStream) throws IOException {
- InputStreamReader reader = new InputStreamReader(templateStream);
+ InputStreamReader reader = new InputStreamReader(templateStream,
+ "UTF-8");
StringBuffer b = new StringBuffer(BUFFER_SIZE);
char[] cbuf = new char[BUFFER_SIZE];
@@ -105,9 +106,9 @@ public class CustomLayout extends AbstractLayout {
* is already populated, the old component is removed.
*
* @param c
- * the component to be added.
+ * the component to be added.
* @param location
- * the location of the component.
+ * the location of the component.
*/
public void addComponent(Component c, String location) {
final Component old = (Component) slots.get(location);
@@ -127,7 +128,7 @@ public class CustomLayout extends AbstractLayout {
* components into that location overwrites the old components.
*
* @param c
- * the component to be added.
+ * the component to be added.
*/
public void addComponent(Component c) {
this.addComponent(c, "");
@@ -137,7 +138,7 @@ public class CustomLayout extends AbstractLayout {
* Removes the component from this container.
*
* @param c
- * the component to be removed.
+ * the component to be removed.
*/
public void removeComponent(Component c) {
if (c == null) {
@@ -153,7 +154,7 @@ public class CustomLayout extends AbstractLayout {
* Removes the component from this container from given location.
*
* @param location
- * the Location identifier of the component.
+ * the Location identifier of the component.
*/
public void removeComponent(String location) {
this.removeComponent((Component) slots.get(location));
@@ -173,8 +174,8 @@ public class CustomLayout extends AbstractLayout {
* Gets the child-component by its location.
*
* @param location
- * the name of the location where the requested component
- * resides.
+ * the name of the location where the requested component
+ * resides.
* @return the Component in the given location or null if not found.
*/
public Component getComponent(String location) {
@@ -186,7 +187,7 @@ public class CustomLayout extends AbstractLayout {
*
* @param target
* @throws PaintException
- * if the paint operation failed.
+ * if the paint operation failed.
*/
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
@@ -245,7 +246,7 @@ public class CustomLayout extends AbstractLayout {
* setStyle. Overriding to improve backwards compatibility.
*
* @param name
- * template name
+ * template name
*/
public void setStyle(String name) {
setTemplateName(name);