@@ -0,0 +1,2679 @@
+/*%0A * Copyright 2016 Red Hat, Inc. and/or its affiliates.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *       http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.uberfire.ext.widgets.common.client.common;%0A%0Aimport com.google.gwt.dom.client.Element;%0Aimport com.google.gwt.dom.client.Style;%0A%0A/**%0A * Borrow from GWTBootstrap3 (https://github.com/gwtbootstrap3/gwtbootstrap3)%0A */%0Apublic final class StyleHelper %7B%0A%0A    public static %3CE extends Style.HasCssName, F extends Enum%3C? extends Style.HasCssName%3E%3E void addUniqueEnumStyleName( final Element element,%0A                                                                                                                        final Class%3CF%3E enumClass,%0A                                                                                                                        final E style ) %7B%0A        removeEnumStyleNames( element, enumClass );%0A        addEnumStyleName( element, style );%0A    %7D%0A%0A    public static %3CE extends Enum%3C? extends Style.HasCssName%3E%3E void removeEnumStyleNames( final Element element,%0A                                                                                          final Class%3CE%3E enumClass ) %7B%0A%0A        for ( final Enum%3C? extends Style.HasCssName%3E constant : enumClass.getEnumConstants() ) %7B%0A            final String cssClass = ( (Style.HasCssName) constant ).getCssName();%0A%0A            if ( cssClass != null && !cssClass.isEmpty() ) %7B%0A                element.removeClassName( cssClass );%0A            %7D%0A        %7D%0A    %7D%0A%0A    public static %3CE extends Style.HasCssName%3E void addEnumStyleName( final Element element,%0A                                                                      final E style ) %7B%0A%0A        if ( style != null && style.getCssName() != null && !style.getCssName().isEmpty() ) %7B%0A            element.addClassName( style.getCssName() );%0A        %7D%0A    %7D%0A%0A    public static %3CE extends Style.HasCssName%3E void removeEnumStyleName( final Element element,%0A                                                                         final E style ) %7B%0A%0A        if ( style != null && style.getCssName() != null && !style.getCssName().isEmpty() ) %7B%0A            element.removeClassName( style.getCssName() );%0A        %7D%0A    %7D%0A%0A%7D%0A

Move StyleHelper from kie-wb-common to uberfire-extensions