/**
 * Copyright 2005-2014 The Kuali Foundation
 *
 * Licensed under the Educational Community License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.opensource.org/licenses/ecl2.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.rice.krad.uif.widget;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.kuali.rice.krad.datadictionary.parse.BeanTag;
import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
import org.kuali.rice.krad.uif.CssConstants;
import org.kuali.rice.krad.uif.UifConstants;
import org.kuali.rice.krad.uif.component.ClientSideState;
import org.kuali.rice.krad.uif.component.Component;
import org.kuali.rice.krad.uif.container.TabGroup;
import org.kuali.rice.krad.uif.util.LifecycleElement;

/**
 * Widget used for configuring tab options, use componentOptions for most options.
 * See http://jqueryui.com/demos/tabs/ for usable options
 *
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
@BeanTag(name = "tabs", parent = "Uif-Tabs")
public class Tabs extends WidgetBase {
    private static final long serialVersionUID = 2L;

    private String tabContentClass;
    private String tabNavClass;

    private UifConstants.Position position = UifConstants.Position.TOP;

    public Tabs() {
        super();
    }

    /**
     * The following is performed:
     *
     * <ul>
     * <li>If the active tab id is configured, set the active plugin option</li>
     * </ul>
     */
    @Override
    public void performFinalize(Object model, LifecycleElement parent) {
        super.performFinalize(model, parent);

        if (!(parent instanceof TabGroup)) {
            throw new RuntimeException("Parent for tabs widget should be tab group, not " + parent.getClass());
        }

        if (position.equals(UifConstants.Position.LEFT) || position.equals(UifConstants.Position.RIGHT)) {
            tabNavClass = tabNavClass + " col-sm-3";
            tabContentClass = tabContentClass + " col-sm-9";
        }

        if (position.equals(UifConstants.Position.LEFT)) {
            ((TabGroup) parent).addStyleClass(CssConstants.Tabs.TABS_LEFT);
        } else if (position.equals(UifConstants.Position.RIGHT)) {
            ((TabGroup) parent).addStyleClass(CssConstants.Tabs.TABS_RIGHT);
        } else if (position.equals(UifConstants.Position.BOTTOM)) {
            ((TabGroup) parent).addStyleClass(CssConstants.Tabs.TABS_BOTTOM);
        }
    }

    /**
     * The position the tabs will appear related to the group, options are TOP, BOTTOM, RIGHT, or LEFT
     *
     * @return position for tabs
     */
    @BeanTagAttribute
    public UifConstants.Position getPosition() {
        return position;
    }

    /**
     * Setter for the tabs position
     *
     * @param position
     */
    public void setPosition(UifConstants.Position position) {
        this.position = position;
    }

    /**
     * Css class for the div which wraps the tab content panels, the default bean defines this as "tabs-content"
     *
     * @return css tab content css class
     */
    @BeanTagAttribute(name = "tabContentClass")
    public String getTabContentClass() {
        return tabContentClass;
    }

    /**
     * @see org.kuali.rice.krad.uif.widget.Tabs#getTabContentClass()
     */
    public void setTabContentClass(String tabContentClass) {
        this.tabContentClass = tabContentClass;
    }

    /**
     * Css class for the ul list of tab navigation links, the default bean defines this as "nav nav-tabs"
     *
     * @return the ul tab navigation css class
     */
    @BeanTagAttribute(name = "tabNavClass")
    public String getTabNavClass() {
        return tabNavClass;
    }

    /**
     * @see org.kuali.rice.krad.uif.widget.Tabs#getTabNavClass()
     */
    public void setTabNavClass(String tabNavClass) {
        this.tabNavClass = tabNavClass;
    }
}

@@ -2134,10 +2134,8 @@
  if 
-(!
 (par
@@ -2158,25 +2158,24 @@
 abGroup)
-)
  %7B%0D%0A    
         
@@ -2170,130 +2170,8 @@
     
-        throw new RuntimeException(%22Parent for tabs widget should be tab group, not %22 + parent.getClass());%0D%0A        %7D%0D%0A%0D%0A
     
@@ -2286,16 +2286,20 @@
         
+    
 tabNavCl
@@ -2344,16 +2344,20 @@
         
+   
+ 
 tabConte
@@ -2402,24 +2402,28 @@
 %22;%0D%0A        
+    
 %7D%0D%0A%0D%0A       
@@ -2415,32 +2415,36 @@
    %7D%0D%0A%0D%0A        
+ 
+   
 if (position.equ
@@ -2483,32 +2483,36 @@
  %7B%0D%0A            
+  
+  
 ((TabGroup) pare
@@ -2556,24 +2556,28 @@
 ABS_LEFT);%0D%0A
+    
         %7D el
@@ -2636,32 +2636,36 @@
  %7B%0D%0A            
+    
 ((TabGroup) pare
@@ -2714,32 +2714,36 @@
 IGHT);%0D%0A        
+ 
+   
 %7D else if (posit
@@ -2783,24 +2783,28 @@
 BOTTOM)) %7B%0D%0A
+    
             
@@ -2866,24 +2866,39 @@
 S_BOTTOM);%0D%0A
+            %7D%0D%0A
         %7D%0D%0A 

Remove hard code check for TabGroup from Tabs.java