From aa2a9f7c6346357381db6f7f042ac54da382de00 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Mon, 14 Mar 2016 15:53:22 +0200 Subject: Add a default widgetset to look for in the project (#19675) Change-Id: I39c303885b5712476780cb8fb7814763610eab47 --- server/src/com/vaadin/server/UIProvider.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'server') 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 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; } /** -- cgit v1.2.3