001/*
002 * File   : $Source$
003 * Date   : $Date$
004 * Version: $Revision$
005 *
006 * This library is part of OpenCms -
007 * the Open Source Content Management System
008 *
009 * Copyright (C) 2002 - 2011 Alkacon Software (http://www.alkacon.com)
010 *
011 * This library is free software; you can redistribute it and/or
012 * modify it under the terms of the GNU Lesser General Public
013 * License as published by the Free Software Foundation; either
014 * version 2.1 of the License, or (at your option) any later version.
015 *
016 * This library is distributed in the hope that it will be useful,
017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019 * Lesser General Public License for more details.
020 *
021 * For further information about Alkacon Software, please see the
022 * company website: http://www.alkacon.com
023 *
024 * For further information about OpenCms, please see the
025 * project website: http://www.opencms.org
026 *
027 * You should have received a copy of the GNU Lesser General Public
028 * License along with this library; if not, write to the Free Software
029 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
030 */
031
032package org.opencms.ade.containerpage.shared;
033
034import com.google.gwt.user.client.rpc.IsSerializable;
035
036/**
037 * A class whose instances are added to container element beans to provide information about container inheritance.<p>
038 *
039 */
040public class CmsInheritanceInfo implements IsSerializable {
041
042    /** The elements client id. */
043    private String m_clientId;
044
045    /** True if this is a new element. */
046    private boolean m_isNew;
047
048    /** The key identifying the inherited container element. */
049    private String m_key;
050
051    /** True if the parent is visible. */
052    private boolean m_parentVisible;
053
054    /** The path from which the element has been inherited. */
055    private String m_path;
056
057    /** The element's own visibility. */
058    private boolean m_visibility;
059
060    /** True if the visibility has been inherited. */
061    private boolean m_visibilityInherited;
062
063    /**
064     * Creates a new instance.<p>
065     */
066    public CmsInheritanceInfo() {
067
068    }
069
070    /**
071     * Creates a new instance.<p>
072     *
073     * @param key the key identifying the container element
074     * @param visibility the visibility of the container element
075     * @param isNew if true, the element is new
076     */
077    public CmsInheritanceInfo(String key, boolean visibility, boolean isNew) {
078
079        m_key = key;
080        m_visibility = visibility;
081        m_isNew = isNew;
082    }
083
084    /**
085     * Returns the elements client id.<p>
086     *
087     * @return the elements client id
088     */
089    public String getClientId() {
090
091        return m_clientId;
092    }
093
094    /**
095     * Returns the key identifying the container element.<p>
096     *
097     * @return the key
098     */
099    public String getKey() {
100
101        return m_key;
102    }
103
104    /**
105     * Gets the path from which this element was inherited.<p>
106     *
107     * @return the path from which this element was inherited
108     */
109    public String getPath() {
110
111        return m_path;
112    }
113
114    /**
115     * Returns true if this container element is new.<p>
116     *
117     * @return true if the container element is new
118     */
119    public boolean isNew() {
120
121        return m_isNew;
122    }
123
124    /**
125     * Returns the parent configuration's visibility.<p>
126     *
127     * @return the parent visibility
128     */
129    public boolean isParentVisible() {
130
131        return m_parentVisible;
132    }
133
134    /**
135     * Returns the visibilityInherited.<p>
136     *
137     * @return the visibilityInherited
138     */
139    public boolean isVisibilityInherited() {
140
141        return m_visibilityInherited;
142    }
143
144    /**
145     * Gets the container element's visibility.<p>
146     *
147     * @return the container element's visibility
148     */
149    public boolean isVisible() {
150
151        return m_visibility;
152    }
153
154    /**
155     * Sets the elements client id.<p>
156     *
157     * @param clientId the elements client id to set
158     */
159    public void setClientId(String clientId) {
160
161        m_clientId = clientId;
162    }
163
164    /**
165     * Sets the 'new' field.<p>
166     *
167     * @param isNew the new value for the 'new' field
168     */
169    public void setIsNew(boolean isNew) {
170
171        m_isNew = isNew;
172    }
173
174    /**
175     * Sets the key identifying this container element.<p>
176     *
177     * @param key the key identifying the container element
178     */
179    public void setKey(String key) {
180
181        m_key = key;
182    }
183
184    /**
185     * Sets the parent visibility.<p>
186     *
187     * @param parentVisible the new value for the parent visibility
188     */
189    public void setParentVisible(boolean parentVisible) {
190
191        m_parentVisible = parentVisible;
192    }
193
194    /**
195     * Sets the path.<p>
196     *
197     * @param path the new value for the path
198     */
199    public void setPath(String path) {
200
201        m_path = path;
202    }
203
204    /**
205     * Sets the 'visibilityInherited' attribute.<p>
206     *
207     * @param visibilityInherited the new value of the 'visibilityInherited' attribute
208     */
209    public void setVisibilityInherited(boolean visibilityInherited) {
210
211        m_visibilityInherited = visibilityInherited;
212    }
213
214    /**
215     * Sets the new visibility.<p>
216     *
217     * @param visibility the new value of the visibility
218     */
219    public void setVisible(boolean visibility) {
220
221        m_visibility = visibility;
222    }
223
224}