/**
 * Copyright (c) 2015 Bosch Software Innovations GmbH and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.eclipse.hawkbit.ui.decorators;

import org.apache.commons.lang3.StringUtils;

import com.vaadin.server.Resource;
import com.vaadin.ui.Button;
import com.vaadin.ui.themes.ValoTheme;

/**
 * Decorator class for a borderless Button with icon.
 */
public class SPUIButtonStyleNoBorderWithIcon implements SPUIButtonDecorator {

    private Button button;

    @Override
    public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {

        this.button = button;

        button.addStyleName(ValoTheme.LABEL_SMALL);
        button.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);

        setButtonStyle(style, setStyle);
        setButtonIcon(icon);

        button.setSizeFull();

        setButtonStyle(style, setStyle);

        return button;
    }

    /**
     * It is possible to add or set a new style to the button. If a new style is
     * set the other styles (LABEL_SMALL and BUTTON_BORDERLESS_COLORED) will be
     * overwritten
     * 
     * @param style
     *            styleName
     * @param setStyle
     *            boolean: Trigger if the style should be added or replace the
     *            other styles
     */
    private void setButtonStyle(final String style, final boolean setStyle) {

        if (StringUtils.isEmpty(style)) {
            return;
        }

        if (setStyle) {
            button.setStyleName(style);
        } else {
            button.addStyleName(style);
        }
    }

    private void setButtonIcon(final Resource icon) {

        if (icon == null) {
            return;
        }
        button.setIcon(icon);
    }
}

@@ -562,16 +562,19 @@
 on with 
+an 
 icon.%0A *
@@ -837,24 +837,54 @@
 on = button;
+%0A        button.setSizeFull();
 %0A%0A        bu
@@ -991,17 +991,16 @@
 LORED);%0A
-%0A
         
@@ -994,32 +994,37 @@
 ED);%0A        set
+OrAdd
 ButtonStyle(styl
@@ -1033,24 +1033,25 @@
  setStyle);%0A
+%0A
         setB
@@ -1080,508 +1080,55 @@
     
-button.setSizeFull();%0A%0A        setButtonStyle(style, setStyle);%0A%0A        return button;%0A    %7D%0A%0A    /**%0A     * It is possible to add or set a new style to the button. If a new style is%0A     * set the other styles (LABEL_SMALL and BUTTON_BORDERLESS_COLORED) will be%0A     * overwritten%0A     * %0A     * @param style%0A     *            styleName%0A     * @param setStyle%0A     *            boolean: Trigger if the style should be added or replace the%0A     *            other styles%0A     */%0A    private void set
+return button;%0A    %7D%0A%0A    private void setOrAdd
 Butt
@@ -1275,24 +1275,66 @@
 setStyle) %7B%0A
+            // overwrite all other styles%0A
             

Refactor methodname and method call order