summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorMika Murtojarvi <mika@vaadin.com>2014-11-28 17:58:15 +0200
committerMika Murtojarvi <mika@vaadin.com>2014-12-02 17:49:35 +0200
commitecb037d2d9ead3324b052ad69e73f22ed8672870 (patch)
treec054b1d9432f527bef22cbc78152a72fb4c12948 /uitest
parentd3af8be5a52365a51a0dd177617976ad566ead0e (diff)
downloadvaadin-framework-ecb037d2d9ead3324b052ad69e73f22ed8672870.tar.gz
vaadin-framework-ecb037d2d9ead3324b052ad69e73f22ed8672870.zip
Vaadin declarative: parser and html generator.
The parser creates a Component hierarchy from a given html file. The html generator does the converse, outputs html given a component hierarchy with a single root. Current TODOs: 1) add automatic tests - some of the functionality may not have been tested in any way. 2) Remove files that are not relevant for this change set but were accidentally included in a commit. Change-Id: I222e01291aab75c2249d4aa4904f16fb153d4397
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/abstractcomponent/ParseComponentHierarchy.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/abstractcomponent/ParseComponentHierarchy.java b/uitest/src/com/vaadin/tests/components/abstractcomponent/ParseComponentHierarchy.java
new file mode 100644
index 0000000000..c85086b042
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/abstractcomponent/ParseComponentHierarchy.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.abstractcomponent;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.DesignSynchronizable;
+import com.vaadin.ui.declarative.LayoutHandler;
+
+/**
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public class ParseComponentHierarchy extends AbstractTestUI {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
+ * VaadinRequest)
+ */
+ @Override
+ protected void setup(VaadinRequest request) {
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(
+ "C:\\Users\\mika\\Projects\\Vaadin\\vaadin\\server\\src\\com\\vaadin\\ui\\declarative\\testFile.html");
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ DesignSynchronizable root = LayoutHandler.parse(fis).getComponentRoot();
+ addComponent(root);
+ }
+}