code: @SuppressWarnings("resource")
      public static void readAndLocalizeDesign(Component component, CmsMessages messages, Map<String, String> macros) {
  
          Class<?> componentClass = component.getClass();
          List<Class<?>> classes = Lists.newArrayList();
          classes.add(componentClass);
          classes.addAll(ClassUtils.getAllSuperclasses(componentClass));
          InputStream designStream = null;
          for (Class<?> cls : classes) {
              if (cls.getName().startsWith("com.vaadin")) {
                  break;
              }
              String filename = cls.getSimpleName() + ".html";
              designStream = cls.getResourceAsStream(filename);
              if (designStream != null) {
                  break;
              }
  
          }
          if (designStream == null) {
              throw new IllegalArgumentException("Design not found for : " + component.getClass());
          }
          readAndLocalizeDesign(component, designStream, messages, macros);
      }
docs: Reads the declarative design for a component and localizes it using a messages object.<p>
  
  The design will need to be located in the same directory as the component's class and have '.html' as a file extension.
  
  @param component the component for which to read the design
  @param messages the message bundle to use for localization
  @param macros the macros to use on the HTML template