aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2016-11-17 20:43:45 +0200
committerLeif Åstrand <leif@vaadin.com>2016-11-17 20:44:09 +0200
commit9d6baef98851d0cd5092581f954f9b3ee6908003 (patch)
treeca67293aa7350239a6dcd89c611e5b2537a66ac1
parent49b766285f4e6cbc81e85847cc5a0078665f05ce (diff)
downloadvaadin-framework-9d6baef98851d0cd5092581f954f9b3ee6908003.tar.gz
vaadin-framework-9d6baef98851d0cd5092581f954f9b3ee6908003.zip
Make ValoTheme subclassable
Change-Id: Ib8976949108888deac51a90eb775445f0b5cecf8
-rw-r--r--server/src/main/java/com/vaadin/ui/themes/ValoTheme.java2
-rw-r--r--server/src/test/java/com/vaadin/ui/themes/ValoThemeTest.java26
2 files changed, 27 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/ui/themes/ValoTheme.java b/server/src/main/java/com/vaadin/ui/themes/ValoTheme.java
index 48fad1ce95..fd670a175b 100644
--- a/server/src/main/java/com/vaadin/ui/themes/ValoTheme.java
+++ b/server/src/main/java/com/vaadin/ui/themes/ValoTheme.java
@@ -1073,6 +1073,6 @@ public class ValoTheme {
*/
public static final String MENU_APPEAR_ON_HOVER = "valo-menu-hover";
- private ValoTheme() {
+ protected ValoTheme() {
}
}
diff --git a/server/src/test/java/com/vaadin/ui/themes/ValoThemeTest.java b/server/src/test/java/com/vaadin/ui/themes/ValoThemeTest.java
new file mode 100644
index 0000000000..658b804d46
--- /dev/null
+++ b/server/src/test/java/com/vaadin/ui/themes/ValoThemeTest.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2016 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.ui.themes;
+
+public class ValoThemeTest {
+ /*
+ * No runtime behavior to test. Just verifying that it's possible to create
+ * a custom subclass for inheriting the constants from the built-in theme.
+ */
+ public static class CustomValoTheme extends ValoTheme {
+ public static String MY_THEME_CONSTANT = "my theme constant";
+ }
+}