001/*
002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Jean-Marc Orliaguet, Chalmers
018 *
019 * $Id$
020 */
021
022package org.nuxeo.theme.jsf.taglib;
023
024import javax.faces.component.UIComponent;
025import javax.faces.webapp.UIComponentELTag;
026
027public class TabsTag extends UIComponentELTag {
028    private String identifier;
029
030    private String styleClass;
031
032    private String controlledBy;
033
034    @Override
035    public String getComponentType() {
036        return "nxthemes.tabs";
037    }
038
039    @Override
040    public String getRendererType() {
041        return null;
042    }
043
044    @Override
045    protected void setProperties(UIComponent component) {
046        super.setProperties(component);
047
048        component.getAttributes().put("identifier", identifier);
049
050        if (styleClass != null) {
051            component.getAttributes().put("styleClass", styleClass);
052        }
053
054        // the perspective controller(s)
055        if (controlledBy != null) {
056            component.getAttributes().put("controlledBy", controlledBy);
057        }
058    }
059
060    @Override
061    public void release() {
062        super.release();
063        identifier = null;
064        styleClass = null;
065        controlledBy = null;
066    }
067
068    public String getIdentifier() {
069        return identifier;
070    }
071
072    public void setIdentifier(String identifier) {
073        this.identifier = identifier;
074    }
075
076    public String getStyleClass() {
077        return styleClass;
078    }
079
080    public void setStyleClass(String styleClass) {
081        this.styleClass = styleClass;
082    }
083
084    public String getControlledBy() {
085        return controlledBy;
086    }
087
088    public void setControlledBy(String controlledBy) {
089        this.controlledBy = controlledBy;
090    }
091
092}