aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2016-03-14 15:53:22 +0200
committerTeemu Suo-Anttila <teemusa@vaadin.com>2016-03-14 15:53:22 +0200
commitaa2a9f7c6346357381db6f7f042ac54da382de00 (patch)
tree0b1addaae131364ecae7e18882d28527d79da863 /server
parenta1437e6f878e3933c8e44cd90cc4a63ea9f21ede (diff)
downloadvaadin-framework-aa2a9f7c6346357381db6f7f042ac54da382de00.tar.gz
vaadin-framework-aa2a9f7c6346357381db6f7f042ac54da382de00.zip
Add a default widgetset to look for in the project (#19675)
Change-Id: I39c303885b5712476780cb8fb7814763610eab47
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/UIProvider.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/src/com/vaadin/server/UIProvider.java b/server/src/com/vaadin/server/UIProvider.java
index 4ed86b9c31..7fd880919e 100644
--- a/server/src/com/vaadin/server/UIProvider.java
+++ b/server/src/com/vaadin/server/UIProvider.java
@@ -16,6 +16,7 @@
package com.vaadin.server;
+import java.io.InputStream;
import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.annotation.Inherited;
@@ -30,6 +31,10 @@ import com.vaadin.shared.ui.ui.Transport;
import com.vaadin.ui.UI;
public abstract class UIProvider implements Serializable {
+
+ /* Default widgetset name to look for */
+ private static final String APP_WIDGETSET_NAME = "AppWidgetset";
+
public abstract Class<? extends UI> getUIClass(UIClassSelectionEvent event);
public UI createInstance(UICreateEvent event) {
@@ -136,8 +141,13 @@ public abstract class UIProvider implements Serializable {
if (uiWidgetset != null) {
return uiWidgetset.value();
} else {
- return null;
+ InputStream resource = event.getUIClass().getResourceAsStream(
+ "/" + APP_WIDGETSET_NAME + ".gwt.xml");
+ if (resource != null) {
+ return APP_WIDGETSET_NAME;
+ }
}
+ return null;
}
/**