/*
 * $Id: TabInfo.java,v 1.1 2006/10/04 03:15:03 marbobo Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: TabInfo.java,v $
 * Revision 1.1  2006/10/04 03:15:03  marbobo
 * + Vollständige Unterstützung für Templates implementiert
 * + Alles von Virtoweb auf ProCoBa umgestellt
 *
 * Revision 1.10  2005/02/16 16:32:49  jonyp
 * put creator/created into tabinfo
 *
 * Revision 1.9  2005/02/10 01:10:09  marbobo
 * + getTabShortName() auf Unicode-Zeichen angepasst
 *
 * Revision 1.8  2004/08/04 23:23:44  marbobo
 * + Flag für Kategorien/Projekte berücksichtigen
 *
 * Revision 1.7  2004/07/20 09:02:07  jonyp
 * added copyright info + cvs log
 *
 *
 */

package vkc.procoba;

import vkc.util.StringUtils;
import vkc.util.VKCStringUtils;

public class TabInfo {
	
	private Integer tabId = null;
	private Integer tabFlag = null; 
	private Integer tabStatus = null; 
	private String tabDescription = "";
	private String tabLink = "";
	private String tabName = "";
	private String tabFlagLabel = "";
	private String tabStatusLabel = "";
	private String tabCreator = "";
	private String tabCreated = "";
	
	public String getTabDescription() {
		return tabDescription;
	}

	public void setTabDescription( String string ) {
		tabDescription = string;
	}

	public Integer getTabId() {
		return tabId;
	}

	public void setTabId( Integer integer ) {
		tabId = integer;
	}

	public String getTabLabel() {
	    String label = getTabName();
	    
	    if ( !StringUtils.isEmpty( getTabDescription() ) ) {
	        label += "\n\n" + getTabDescription();
	    }
	    
	    if ( !StringUtils.isEmpty( getTabFlagLabel() ) ) {
	        label += "\n\n" + getTabFlagLabel();
	    }

	    if ( !StringUtils.isEmpty( getTabStatusLabel() ) ) {
	        label += "\n\n" + getTabStatusLabel();
	    }
	    
	    if ( !StringUtils.isEmpty( getTabCreator() ) ) {
	        label += "\n\n" + getTabCreator();
	    }
	    
	    if ( !StringUtils.isEmpty( getTabCreated() ) ) {
	        label += "\n" + getTabCreated();
	    }
	    
	    return label;
	}
	
	public String getTabLink() {
		return tabLink;
	}

	public void setTabLink( String string ) {
		tabLink = string;
	}

	public String getTabName() {
		return tabName;
	}

	public void setTabName( String string ) {
		tabName = string;
	}

    public String getTabShortName() {
		String name = VKCStringUtils.decodeXmlEntities( getTabName() );
        
        if ( name.length() > 12 ) {
			return VKCStringUtils.encodeXmlEntities( name.substring( 0, 11 ) ) + "...";
		} 

		return VKCStringUtils.encodeXmlEntities( name );
    }

    public Integer getTabFlag() {
        return tabFlag;
    }

    public void setTabFlag( Integer tabFlag1 ) {
        tabFlag = tabFlag1;
    }

    public Integer getTabStatus() {
        return tabStatus;
    }

    public void setTabStatus( Integer tabStatus1 ) {
        tabStatus = tabStatus1;
    }

    public String getTabFlagLabel() {
        return tabFlagLabel;
    }
    
    public void setTabFlagLabel( String tabFlagLabel1 ) {
        tabFlagLabel = tabFlagLabel1;
    }

    public String getTabStatusLabel() {
        return tabStatusLabel;
    }
    
    public void setTabStatusLabel( String tabStatusLabel1 ) {
        tabStatusLabel = tabStatusLabel1;
    }
    
    public String getTabCreated() {
        return tabCreated;
    }
    
    public void setTabCreated(String tabCreated) {
        this.tabCreated = tabCreated;
    }
    
    public String getTabCreator() {
        return tabCreator;
    }
    
    public void setTabCreator(String tabCreator) {
        this.tabCreator = tabCreator;
    }
}