001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.configuration.preferences;
029
030import org.opencms.xml.content.CmsXmlContentProperty;
031
032/**
033 * Bean representing the configurable attributes for a preference.<p>
034 */
035public class CmsPreferenceData {
036
037    /** The pref name. */
038    private String m_name;
039
040    /** The pref default value. */
041    private String m_value;
042
043    /** The pref tab. */
044    private String m_tab;
045
046    /** The preference widget configuration. */
047    private CmsXmlContentProperty m_propDef;
048
049    /**
050     * Creates a new instance.<p>
051     *
052     * @param name the preference name
053     * @param value the preference value
054     * @param prop the preference configuration
055     * @param tab the tab on which to display the preference
056     */
057    public CmsPreferenceData(String name, String value, CmsXmlContentProperty prop, String tab) {
058
059        m_name = name;
060        m_value = value;
061        m_propDef = prop;
062        m_tab = tab;
063    }
064
065    /**
066     * Gets the default value for the preference.<p>
067     *
068     * @return the default value for the preference
069     */
070    public String getDefaultValue() {
071
072        return m_value;
073    }
074
075    /**
076     * Gets the name of the preference.<p>
077     *
078     * @return the preference name
079     */
080    public String getName() {
081
082        return m_name;
083    }
084
085    /**
086     * Gets the preference definition.<p>
087     *
088     * @return the preference definition
089     */
090    public CmsXmlContentProperty getPropertyDefinition() {
091
092        return m_propDef;
093    }
094
095    /**
096     * Gets the tab on which the preference should be displayed.<p>
097     *
098     * @return the tab on which the preference should be displayed
099     */
100    public String getTab() {
101
102        return m_tab;
103    }
104
105}