aboutsummaryrefslogtreecommitdiffstats
path: root/compatibility-server/src/test/java/com/vaadin/tests/server/ComponentDesignWriterUtility.java
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2016-10-24 11:32:16 +0300
committerVaadin Code Review <review@vaadin.com>2016-10-26 05:59:27 +0000
commit9abe01a5881ae7fb43d2706ca9302aa68cc0221b (patch)
tree97b3fabfd917c5513b4adbce20b37af1a78dac87 /compatibility-server/src/test/java/com/vaadin/tests/server/ComponentDesignWriterUtility.java
parent5bc31e8267230fc4abfef34dcaa77ce5eae447b3 (diff)
downloadvaadin-framework-9abe01a5881ae7fb43d2706ca9302aa68cc0221b.tar.gz
vaadin-framework-9abe01a5881ae7fb43d2706ca9302aa68cc0221b.zip
Introduce "shouldWriteDefaultValues" property to DesignContext.
Change-Id: I979448e5af032333a6a2f7b99b11ab16c41d7b18
Diffstat (limited to 'compatibility-server/src/test/java/com/vaadin/tests/server/ComponentDesignWriterUtility.java')
-rw-r--r--compatibility-server/src/test/java/com/vaadin/tests/server/ComponentDesignWriterUtility.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/compatibility-server/src/test/java/com/vaadin/tests/server/ComponentDesignWriterUtility.java b/compatibility-server/src/test/java/com/vaadin/tests/server/ComponentDesignWriterUtility.java
index 15ae1c9cf4..6009385ccc 100644
--- a/compatibility-server/src/test/java/com/vaadin/tests/server/ComponentDesignWriterUtility.java
+++ b/compatibility-server/src/test/java/com/vaadin/tests/server/ComponentDesignWriterUtility.java
@@ -24,7 +24,6 @@ import com.vaadin.ui.components.colorpicker.ColorPickerPopup;
import com.vaadin.ui.components.colorpicker.ColorPickerPreview;
import com.vaadin.ui.components.colorpicker.ColorPickerSelect;
import com.vaadin.ui.declarative.Design;
-import com.vaadin.ui.declarative.DesignAttributeHandler;
import com.vaadin.ui.declarative.DesignContext;
/**
@@ -33,6 +32,10 @@ import com.vaadin.ui.declarative.DesignContext;
public class ComponentDesignWriterUtility {
private static final Set<String> WHITE_LIST_FQNS = new HashSet<>();
+ private static final Document document = new Document("");
+ private static final DesignContext designContext = new DesignContext(
+ document);
+
static {
WHITE_LIST_FQNS.add(DragAndDropWrapper.class.getName());
WHITE_LIST_FQNS.add(Navigator.EmptyView.class.getName());
@@ -86,11 +89,9 @@ public class ComponentDesignWriterUtility {
"com.vaadin.server.VaadinPortlet$VaadinWebSpherePortalRequest");
WHITE_LIST_FQNS.add("com.vaadin.server.VaadinPortlet");
WHITE_LIST_FQNS.add("com.vaadin.server.VaadinPortletRequest");
- }
- private static final Document document = new Document("");
- private static final DesignContext designContext = new DesignContext(
- document);
+ designContext.setShouldWriteDefaultValues(true);
+ }
@SafeVarargs
public static List<String> getDeclarativeSyntax(
@@ -100,13 +101,10 @@ public class ComponentDesignWriterUtility {
public static List<String> getDeclarativeSyntax(
List<Class<? extends Component>> components) {
- DesignAttributeHandler.setWriteDefaultValues(true);
-
List<String> declarativeStrings = components.stream()
.map(ComponentDesignWriterUtility::getDeclarativeSyntax)
.collect(Collectors.toList());
- DesignAttributeHandler.setWriteDefaultValues(false);
return declarativeStrings;
}
@@ -156,10 +154,8 @@ public class ComponentDesignWriterUtility {
private static void printFullDeclarativeSyntax(
List<Class<? extends Component>> components) {
- DesignAttributeHandler.setWriteDefaultValues(true);
components.stream().forEach(component -> System.out
.println(getDeclarativeSyntax(component)));
- DesignAttributeHandler.setWriteDefaultValues(false);
}
private static List<Class<? extends Component>> getVaadin8Components()