001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (https://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: https://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: https://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.ade.containerpage.shared;
029
030import java.io.Serializable;
031import java.util.List;
032
033/**
034 * Option dialog data.<p>
035 */
036public class CmsDialogOptions implements Serializable {
037
038    /**
039     * Describes a dialog option.<p>
040     */
041    public static class Option implements Serializable {
042
043        /** The serial version id. */
044        private static final long serialVersionUID = -3919401021902116204L;
045
046        /** The description. */
047        private String m_description;
048
049        /** In case the option is disabled. */
050        private boolean m_disabled;
051
052        /** The option label. */
053        private String m_label;
054
055        /** The option value. */
056        private String m_value;
057
058        /**
059         * Constructor.<p>
060         *
061         * @param value the value
062         * @param label the label
063         * @param description the description
064         * @param disabled if disabled
065         */
066        public Option(String value, String label, String description, boolean disabled) {
067
068            m_value = value;
069            m_label = label;
070            m_description = description;
071            m_disabled = disabled;
072        }
073
074        /**
075         * Constructor used for serialization.<p>
076         */
077        protected Option() {
078
079            // nothing to do
080        }
081
082        /**
083         * Returns the description.<p>
084         *
085         * @return the description
086         */
087        public String getDescription() {
088
089            return m_description;
090        }
091
092        /**
093         * Returns the label.<p>
094         *
095         * @return the label
096         */
097        public String getLabel() {
098
099            return m_label;
100        }
101
102        /**
103         * Returns the value.<p>
104         *
105         * @return the value
106         */
107        public String getValue() {
108
109            return m_value;
110        }
111
112        /**
113         * Returns if the option is disabled.<p>
114         *
115         * @return if the option is disabled
116         */
117        public boolean isDisabled() {
118
119            return m_disabled;
120        }
121
122    }
123
124    /** Key to trigger a regular delete action. */
125    public static final String REGULAR_DELETE = "regular_delete";
126
127    /** The serial version id. */
128    private static final long serialVersionUID = 4758296036064643532L;
129
130    /** The dialog info text. */
131    private String m_info;
132
133    /** The dialog options. */
134    private List<Option> m_options;
135
136    /** The dialog title. */
137    private String m_title;
138
139    /**
140     * Constructor.<p>
141     *
142     * @param title the dialog title
143     * @param info the dialog info text
144     * @param options the options
145     */
146    public CmsDialogOptions(String title, String info, List<Option> options) {
147
148        m_title = title;
149        m_info = info;
150        m_options = options;
151    }
152
153    /**
154     * Constructor used for serialization.<p>
155     */
156    protected CmsDialogOptions() {
157
158        // nothing to do
159    }
160
161    /**
162     * Returns the info.<p>
163     *
164     * @return the info
165     */
166    public String getInfo() {
167
168        return m_info;
169    }
170
171    /**
172     * Returns the options.<p>
173     *
174     * @return the options
175     */
176    public List<Option> getOptions() {
177
178        return m_options;
179    }
180
181    /**
182     * Returns the dialog title.<p>
183     *
184     * @return the dialog title
185     */
186    public String getTitle() {
187
188        return m_title;
189    }
190
191}