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.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 m_value = value; 068 m_label = label; 069 m_description = description; 070 m_disabled = disabled; 071 } 072 073 /** 074 * Constructor used for serialization.<p> 075 */ 076 protected Option() { 077 // nothing to do 078 } 079 080 /** 081 * Returns the description.<p> 082 * 083 * @return the description 084 */ 085 public String getDescription() { 086 087 return m_description; 088 } 089 090 /** 091 * Returns the label.<p> 092 * 093 * @return the label 094 */ 095 public String getLabel() { 096 097 return m_label; 098 } 099 100 /** 101 * Returns the value.<p> 102 * 103 * @return the value 104 */ 105 public String getValue() { 106 107 return m_value; 108 } 109 110 /** 111 * Returns if the option is disabled.<p> 112 * 113 * @return if the option is disabled 114 */ 115 public boolean isDisabled() { 116 117 return m_disabled; 118 } 119 120 } 121 122 /** Key to trigger a regular delete action. */ 123 public static final String REGULAR_DELETE = "regular_delete"; 124 125 /** The serial version id. */ 126 private static final long serialVersionUID = 4758296036064643532L; 127 128 /** The dialog info text. */ 129 private String m_info; 130 131 /** The dialog options. */ 132 private List<Option> m_options; 133 134 /** The dialog title. */ 135 private String m_title; 136 137 /** 138 * Constructor.<p> 139 * 140 * @param title the dialog title 141 * @param info the dialog info text 142 * @param options the options 143 */ 144 public CmsDialogOptions(String title, String info, List<Option> options) { 145 m_title = title; 146 m_info = info; 147 m_options = options; 148 } 149 150 /** 151 * Constructor used for serialization.<p> 152 */ 153 protected CmsDialogOptions() { 154 // nothing to do 155 } 156 157 /** 158 * Returns the info.<p> 159 * 160 * @return the info 161 */ 162 public String getInfo() { 163 164 return m_info; 165 } 166 167 /** 168 * Returns the options.<p> 169 * 170 * @return the options 171 */ 172 public List<Option> getOptions() { 173 174 return m_options; 175 } 176 177 /** 178 * Returns the dialog title.<p> 179 * 180 * @return the dialog title 181 */ 182 public String getTitle() { 183 184 return m_title; 185 } 186 187}