diff options
author | Artur Signell <artur@vaadin.com> | 2014-12-12 11:01:55 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2014-12-14 19:41:57 +0200 |
commit | 2789f701678106e9f5141b096706ace0d6880780 (patch) | |
tree | f785abafd7d0987d70b6da09eeadf808e8e832d1 | |
parent | 628a2edf50c355e6e43e1da2e32224d32651327d (diff) | |
download | vaadin-framework-2789f701678106e9f5141b096706ace0d6880780.tar.gz vaadin-framework-2789f701678106e9f5141b096706ace0d6880780.zip |
Rename LayoutHandler to Design (#7749)
Change-Id: I86fcf9062804c7eb71d460d2003a3f5eb8d775eb
-rw-r--r-- | server/src/com/vaadin/ui/declarative/Design.java (renamed from server/src/com/vaadin/ui/declarative/LayoutHandler.java) | 10 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/design/InvalidLayoutTemplate.java (renamed from server/tests/src/com/vaadin/tests/layoutparser/InvalidLayoutTemplate.java) | 2 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/design/LayoutTemplate.java (renamed from server/tests/src/com/vaadin/tests/layoutparser/LayoutTemplate.java) | 2 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/design/ParseAllSupportedComponentsTest.java (renamed from server/tests/src/com/vaadin/tests/layoutparser/ParseAllSupportedComponentsTest.java) | 8 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/design/ParseLayoutTest.java (renamed from server/tests/src/com/vaadin/tests/layoutparser/ParseLayoutTest.java) | 21 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/design/TestLocale.java (renamed from server/tests/src/com/vaadin/tests/layoutparser/TestLocale.java) | 8 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/design/all-components.html (renamed from server/tests/src/com/vaadin/tests/layoutparser/all-components.html) | 0 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/design/testFile.html (renamed from server/tests/src/com/vaadin/tests/layoutparser/testFile.html) | 0 |
8 files changed, 25 insertions, 26 deletions
diff --git a/server/src/com/vaadin/ui/declarative/LayoutHandler.java b/server/src/com/vaadin/ui/declarative/Design.java index b3ef2f15c7..89e992181b 100644 --- a/server/src/com/vaadin/ui/declarative/LayoutHandler.java +++ b/server/src/com/vaadin/ui/declarative/Design.java @@ -35,16 +35,16 @@ import com.vaadin.ui.declarative.DesignContext.ComponentCreatedEvent; import com.vaadin.ui.declarative.DesignContext.ComponentCreationListener; /** - * LayoutHandler is used for parsing a component hierarchy from an html file - * and, conversely, for generating an html tree representation corresponding to - * a given component hierarchy. For both parsing and tree generation the - * component hierarchy must contain a single root. + * Design is used for parsing a component hierarchy from an html file and, + * conversely, for generating an html tree representation corresponding to a + * given component hierarchy. For both parsing and tree generation the component + * hierarchy must contain a single root. * * * @since 7.4 * @author Vaadin Ltd */ -public class LayoutHandler implements Serializable { +public class Design implements Serializable { /** * Constructs a component hierarchy from the design specified as an html * document. The component hierarchy must contain exactly one top-level diff --git a/server/tests/src/com/vaadin/tests/layoutparser/InvalidLayoutTemplate.java b/server/tests/src/com/vaadin/tests/design/InvalidLayoutTemplate.java index a595bac4fc..bdfa4b47cc 100644 --- a/server/tests/src/com/vaadin/tests/layoutparser/InvalidLayoutTemplate.java +++ b/server/tests/src/com/vaadin/tests/design/InvalidLayoutTemplate.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.tests.layoutparser; +package com.vaadin.tests.design; import org.junit.Ignore; diff --git a/server/tests/src/com/vaadin/tests/layoutparser/LayoutTemplate.java b/server/tests/src/com/vaadin/tests/design/LayoutTemplate.java index 533379e298..95f30fb728 100644 --- a/server/tests/src/com/vaadin/tests/layoutparser/LayoutTemplate.java +++ b/server/tests/src/com/vaadin/tests/design/LayoutTemplate.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.tests.layoutparser; +package com.vaadin.tests.design; import org.junit.Ignore; diff --git a/server/tests/src/com/vaadin/tests/layoutparser/ParseAllSupportedComponentsTest.java b/server/tests/src/com/vaadin/tests/design/ParseAllSupportedComponentsTest.java index c3d1b36320..ff13522b2f 100644 --- a/server/tests/src/com/vaadin/tests/layoutparser/ParseAllSupportedComponentsTest.java +++ b/server/tests/src/com/vaadin/tests/design/ParseAllSupportedComponentsTest.java @@ -13,15 +13,15 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.tests.layoutparser; +package com.vaadin.tests.design; import java.io.FileInputStream; import java.io.FileNotFoundException; import junit.framework.TestCase; +import com.vaadin.ui.declarative.Design; import com.vaadin.ui.declarative.DesignContext; -import com.vaadin.ui.declarative.LayoutHandler; /** * Just top level test case that contains all synchronizable components @@ -32,9 +32,9 @@ public class ParseAllSupportedComponentsTest extends TestCase { public void testParsing() { try { - DesignContext ctx = LayoutHandler + DesignContext ctx = Design .parse(new FileInputStream( - "server/tests/src/com/vaadin/tests/layoutparser/all-components.html")); + "server/tests/src/com/vaadin/tests/design/all-components.html")); assertNotNull("The returned design context can not be null", ctx); assertNotNull("the component root can not be null", ctx.getComponentRoot()); diff --git a/server/tests/src/com/vaadin/tests/layoutparser/ParseLayoutTest.java b/server/tests/src/com/vaadin/tests/design/ParseLayoutTest.java index 0c7ac50601..07a0b218f7 100644 --- a/server/tests/src/com/vaadin/tests/layoutparser/ParseLayoutTest.java +++ b/server/tests/src/com/vaadin/tests/design/ParseLayoutTest.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.tests.layoutparser; +package com.vaadin.tests.design; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -35,9 +35,9 @@ import com.vaadin.ui.NativeButton; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.declarative.Design; import com.vaadin.ui.declarative.DesignContext; import com.vaadin.ui.declarative.DesignException; -import com.vaadin.ui.declarative.LayoutHandler; /** * A test for checking that parsing a layout preserves the IDs and the mapping @@ -54,9 +54,8 @@ public class ParseLayoutTest extends TestCase { @Override protected void setUp() throws Exception { super.setUp(); - ctx = LayoutHandler - .parse(new FileInputStream( - "server/tests/src/com/vaadin/tests/layoutparser/testFile.html")); + ctx = Design.parse(new FileInputStream( + "server/tests/src/com/vaadin/tests/design/testFile.html")); } /* @@ -79,8 +78,8 @@ public class ParseLayoutTest extends TestCase { */ @Test public void testThatSerializationPreservesProperties() throws IOException { - Document doc = LayoutHandler.createHtml(ctx); - DesignContext newContext = LayoutHandler.parse(doc.toString()); + Document doc = Design.createHtml(ctx); + DesignContext newContext = Design.parse(doc.toString()); // Check that the elements can still be found by id and caption findElements(newContext); checkHierarchy(newContext); @@ -116,8 +115,8 @@ public class ParseLayoutTest extends TestCase { public void testFieldBinding() throws IOException { LayoutTemplate template = new LayoutTemplate(); InputStream htmlFile = new FileInputStream( - "server/tests/src/com/vaadin/tests/layoutparser/testFile.html"); - LayoutHandler.parse(htmlFile, template); + "server/tests/src/com/vaadin/tests/design/testFile.html"); + Design.parse(htmlFile, template); assertNotNull(template.getFirstButton()); assertNotNull(template.getSecondButton()); assertNotNull(template.getYetanotherbutton()); @@ -134,9 +133,9 @@ public class ParseLayoutTest extends TestCase { public void testUnboundFields() throws IOException { InvalidLayoutTemplate template = new InvalidLayoutTemplate(); InputStream htmlFile = new FileInputStream( - "server/tests/src/com/vaadin/tests/layoutparser/testFile.html"); + "server/tests/src/com/vaadin/tests/design/testFile.html"); try { - LayoutHandler.parse(htmlFile, template); + Design.parse(htmlFile, template); // we are expecting an exception fail(); } catch (DesignException e) { diff --git a/server/tests/src/com/vaadin/tests/layoutparser/TestLocale.java b/server/tests/src/com/vaadin/tests/design/TestLocale.java index eea533243c..8b46c9feff 100644 --- a/server/tests/src/com/vaadin/tests/layoutparser/TestLocale.java +++ b/server/tests/src/com/vaadin/tests/design/TestLocale.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.tests.layoutparser; +package com.vaadin.tests.design; import java.util.Locale; @@ -28,7 +28,7 @@ import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.declarative.DesignContext; -import com.vaadin.ui.declarative.LayoutHandler; +import com.vaadin.ui.declarative.Design; /** * Tests the handling of the locale property in parsing and html generation. @@ -73,7 +73,7 @@ public class TestLocale extends TestCase { hlayout2.addComponent(l2); ctx.setComponentRoot(vLayout); // create the html tree corresponding to the component hierarchy - Document doc = LayoutHandler.createHtml(ctx); + Document doc = Design.createHtml(ctx); // check the created html Element body = doc.body(); Element evLayout = body.child(0); @@ -131,7 +131,7 @@ public class TestLocale extends TestCase { // parse the created document and check the constructed component // hierarchy - VerticalLayout vLayout = (VerticalLayout) LayoutHandler.parse( + VerticalLayout vLayout = (VerticalLayout) Design.parse( doc.toString()).getComponentRoot(); assertEquals("Wrong locale.", new Locale("en", "US"), vLayout.getLocale()); diff --git a/server/tests/src/com/vaadin/tests/layoutparser/all-components.html b/server/tests/src/com/vaadin/tests/design/all-components.html index 71aeeeaa41..71aeeeaa41 100644 --- a/server/tests/src/com/vaadin/tests/layoutparser/all-components.html +++ b/server/tests/src/com/vaadin/tests/design/all-components.html diff --git a/server/tests/src/com/vaadin/tests/layoutparser/testFile.html b/server/tests/src/com/vaadin/tests/design/testFile.html index 79ae1e9eaf..79ae1e9eaf 100644 --- a/server/tests/src/com/vaadin/tests/layoutparser/testFile.html +++ b/server/tests/src/com/vaadin/tests/design/testFile.html |