code: public static Button getButton(final String id, final String buttonName, final String buttonDesc,
              final String style, final boolean setStyle, final Resource icon,
              final Class<? extends SPUIButtonDecorator> buttonDecoratorclassName) {
          Button button = null;
          SPUIButtonDecorator buttonDecorator = null;
          try {
              // Create instance
              buttonDecorator = buttonDecoratorclassName.newInstance();
              // Decorate button
              button = buttonDecorator.decorate(new SPUIButton(id, buttonName, buttonDesc), style, setStyle, icon);
          } catch (final InstantiationException exception) {
              LOG.error("Error occured while creating Button decorator-" + buttonName, exception);
          } catch (final IllegalAccessException exception) {
              LOG.error("Error occured while acessing Button decorator-" + buttonName, exception);
          }
          return button;
      }
docs: Get Button - Factory Approach for decoration.
  
  @param id
  as string
  @param buttonName
  as string
  @param buttonDesc
  as string
  @param style
  string as string
  @param setStyle
  string as boolean
  @param icon
  as image
  @param buttonDecoratorclassName
  as decorator
  @return Button as UI