diff options
author | Miki <miki@vaadin.com> | 2015-01-16 14:02:19 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-02-03 11:15:41 +0000 |
commit | a508ed7b4aa062334ad84d7967cb2bdd5d8ecc26 (patch) | |
tree | 5215ac87b3063efd9d7c8a67d5b3b008ff931b70 /server/src/com/vaadin/ui/AbstractComponent.java | |
parent | 293b62ab6ed402b188685027b100025597a37d00 (diff) | |
download | vaadin-framework-a508ed7b4aa062334ad84d7967cb2bdd5d8ecc26.tar.gz vaadin-framework-a508ed7b4aa062334ad84d7967cb2bdd5d8ecc26.zip |
Declarative for DateFields (and related) with ISO8601 (#16313)
DesignAttributeHandler supports method names that contains some words in
uppercase
DesignAttributeHandler and other components now use extensible Formatter
with Converters rather than static methods
Change-Id: I9f68414bd4821f47ff37a26375091d154cae9a93
Diffstat (limited to 'server/src/com/vaadin/ui/AbstractComponent.java')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractComponent.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 9ff6dff21e..ebe438b908 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -959,8 +959,8 @@ public abstract class AbstractComponent extends AbstractClientConnector } // handle immediate if (attr.hasKey("immediate")) { - setImmediate(DesignAttributeHandler.parseBoolean(attr - .get("immediate"))); + setImmediate(DesignAttributeHandler.getFormatter().parse( + attr.get("immediate"), Boolean.class)); } // handle locale @@ -984,8 +984,8 @@ public abstract class AbstractComponent extends AbstractClientConnector // handle responsive if (attr.hasKey("responsive")) { - setResponsive(DesignAttributeHandler.parseBoolean(attr - .get("responsive"))); + setResponsive(DesignAttributeHandler.getFormatter().parse( + attr.get("responsive"), Boolean.class)); } // check for unsupported attributes Set<String> supported = new HashSet<String>(); @@ -1138,9 +1138,8 @@ public abstract class AbstractComponent extends AbstractClientConnector } else if (widthAuto) { attributes.put("width-auto", "true"); } else { - String widthString = DesignAttributeHandler - .formatFloat(getWidth()) - + getWidthUnits().getSymbol(); + String widthString = DesignAttributeHandler.getFormatter() + .format(getWidth()) + getWidthUnits().getSymbol(); attributes.put("width", widthString); } @@ -1152,9 +1151,8 @@ public abstract class AbstractComponent extends AbstractClientConnector } else if (heightAuto) { attributes.put("height-auto", "true"); } else { - String heightString = DesignAttributeHandler - .formatFloat(getHeight()) - + getHeightUnits().getSymbol(); + String heightString = DesignAttributeHandler.getFormatter() + .format(getHeight()) + getHeightUnits().getSymbol(); attributes.put("height", heightString); } } |