// Find out the widgetset of this UI based on @Widgetset annotation
Class<?> currentType = getClass();
String usedWidgetset = VaadinServlet.DEFAULT_WIDGETSET;
while (currentType != Object.class) {
Widgetset annotation = currentType.getAnnotation(Widgetset.class);
if (annotation != null) {
usedWidgetset = annotation.value();
break;
} else {
currentType = currentType.getSuperclass();
}
}