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.gwt.shared;
029
030import com.google.gwt.user.client.rpc.IsSerializable;
031
032/**
033 * Bean representing an entry in the quick launch menu.<p>
034 */
035public class CmsQuickLaunchData implements IsSerializable {
036
037    /** Default URL (may be null). */
038    private String m_defaultUrl;
039
040    /** Content for error alert box. */
041    private String m_errorMessage;
042
043    /** Title for error alert box. */
044    private String m_errorTitle;
045
046    /** The icon URL. */
047    private String m_iconUrl;
048
049    /** True if this is a legacy tool (necessary because the icons for legacy tools are smaller). */
050    private boolean m_legacy;
051
052    /** Flag to force page reload. */
053    private boolean m_reload;
054
055    /** User readable title of the quick launch item. */
056    private String m_title;
057
058    /** Additional button style classes. */
059    private String m_buttonStyle;
060
061    /**
062     * Creates a new instance.<p>
063     *
064     * @param defaultUrl the default URL
065     * @param title the title
066     * @param iconUrl the icon URL
067     * @param buttonStyle the additional button style classes
068     * @param errorTitle the title for the error alert box
069     * @param errorMessage the content for the error alert box
070     * @param legacy true if this is a legacy dialog
071     * @param reload true if the page should just be reloaded when this is selected
072     */
073    public CmsQuickLaunchData(
074
075        String defaultUrl,
076        String title,
077        String iconUrl,
078        String buttonStyle,
079        String errorTitle,
080        String errorMessage,
081        boolean legacy,
082        boolean reload) {
083
084        m_title = title;
085        m_defaultUrl = defaultUrl;
086        m_iconUrl = iconUrl;
087        m_buttonStyle = buttonStyle;
088        m_legacy = legacy;
089        m_reload = reload;
090        m_errorTitle = errorTitle;
091        m_errorMessage = errorMessage;
092
093    }
094
095    /**
096     * Default constructor for serialization.<p>
097     */
098    protected CmsQuickLaunchData() {
099
100        // Default constructor for serialization
101    }
102
103    /**
104     * Returns the additional button style classes.<p>
105     *
106     * @return the additional button style classes
107     */
108    public String getButtonStyle() {
109
110        return m_buttonStyle;
111    }
112
113    /**
114     * Returns the defaultUrl.<p>
115     *
116     * @return the defaultUrl
117     */
118    public String getDefaultUrl() {
119
120        return m_defaultUrl;
121    }
122
123    /**
124     * Gets the error message.<p>
125     *
126     * @return the error message
127     */
128    public String getErrorMessage() {
129
130        return m_errorMessage;
131    }
132
133    /**
134     * Gets the title for the error alert box.<p>
135     *
136     * @return the title for the error alert box
137     */
138    public String getErrorTitle() {
139
140        return m_errorTitle;
141    }
142
143    /**
144     * Returns the iconUrl.<p>
145     *
146     * @return the iconUrl
147     */
148    public String getIconUrl() {
149
150        return m_iconUrl;
151    }
152
153    /**
154     * Returns the title.<p>
155     *
156     * @return the title
157     */
158    public String getTitle() {
159
160        return m_title;
161    }
162
163    /**
164     * Returns true if this item opens a legacy dialog.<p>
165     *
166     * @return true if this item opens a legacy dialog
167     */
168    public boolean isLegacy() {
169
170        return m_legacy;
171    }
172
173    /**
174     * Return true if the page should be reloaded when this is selected.<p>
175     *
176     * @return true if the page should be reloaded
177     */
178    public boolean isReload() {
179
180        return m_reload;
181    }
182
183    /**
184     * Sets the 'reload' flag.<p>
185     *
186     * @param reload the new value for the 'reload' flag
187     */
188    public void setReload(boolean reload) {
189
190        m_reload = reload;
191    }
192
193}