001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS <http://nuxeo.com> and others
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Jean-Marc Orliaguet, Chalmers
011 *
012 * $Id$
013 */
014
015package org.nuxeo.theme.jsf.taglib;
016
017import javax.faces.component.UIComponent;
018import javax.faces.webapp.UIComponentELTag;
019
020public class TabTag extends UIComponentELTag {
021    private String label;
022
023    private String switchTo;
024
025    private String link;
026
027    @Override
028    public String getComponentType() {
029        return "nxthemes.tab";
030    }
031
032    @Override
033    public String getRendererType() {
034        return null;
035    }
036
037    @Override
038    protected void setProperties(UIComponent component) {
039        super.setProperties(component);
040
041        // the panel's identifier
042        component.getAttributes().put("label", label);
043
044        // the perspective to switch to
045        if (switchTo != null) {
046            component.getAttributes().put("switchTo", switchTo);
047        }
048
049        // the link
050        if (link != null) {
051            component.getAttributes().put("link", link);
052        }
053    }
054
055    @Override
056    public void release() {
057        super.release();
058        label = null;
059        switchTo = null;
060        link = null;
061    }
062
063    public String getLabel() {
064        return label;
065    }
066
067    public void setLabel(String label) {
068        this.label = label;
069    }
070
071    public String getLink() {
072        return link;
073    }
074
075    public void setLink(String link) {
076        this.link = link;
077    }
078
079    public String getSwitchTo() {
080        return switchTo;
081    }
082
083    public void setSwitchTo(String switchTo) {
084        this.switchTo = switchTo;
085    }
086
087}