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.gwt.shared;
029
030import com.google.gwt.user.client.rpc.IsSerializable;
031
032/**
033 * Represents a single option (type) that can be selected in the list element creation dialog.
034 */
035public class CmsListElementCreationOption implements IsSerializable {
036
037    /** The list info bean describing the type. */
038    private CmsListInfoBean m_info;
039
040    /** The string used to create the new resource by the content editor. */
041    private String m_newLink;
042
043    /** The type name. */
044    private String m_type;
045
046    /**
047     * Creates a new instance.
048     *
049     * @param type the type name
050     * @param info the list info bean describing the type
051     * @param newLink the string used by the content editor to create the new resource
052     */
053    public CmsListElementCreationOption(String type, CmsListInfoBean info, String newLink) {
054
055        super();
056        m_type = type;
057        m_info = info;
058        m_newLink = newLink;
059    }
060
061    /**
062     * Hidden default constructor.
063     */
064    protected CmsListElementCreationOption() {}
065
066    /**
067     * Gets the list info bean representing the type.
068     *
069     * @return the list info bean for the type
070     */
071    public CmsListInfoBean getInfo() {
072
073        return m_info;
074    }
075
076    /**
077     * Gets the string used by the content editor to create the new resource.
078     *
079     * @return the string used by the content editor to create the new resource
080     */
081    public String getNewLink() {
082
083        return m_newLink;
084    }
085
086    /**
087     * Gets the resource type name.
088     *
089     * @return the type name
090     */
091    public String getType() {
092
093        return m_type;
094    }
095
096}