001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (C) Alkacon Software (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 org.opencms.ade.containerpage.shared.CmsCntPageData.ElementDeleteMode;
031import org.opencms.gwt.shared.CmsListInfoBean;
032import org.opencms.util.CmsUUID;
033
034import com.google.gwt.user.client.rpc.IsSerializable;
035
036/**
037 * A bean used to store information about a container page element which was just removed.<p>
038 */
039public class CmsRemovedElementStatus implements IsSerializable {
040
041    /** The element delete mode. */
042    private ElementDeleteMode m_elementDeleteMode;
043
044    /** The list info bean to display. */
045    private CmsListInfoBean m_elementInfo;
046
047    /** True if this element is a possible deletion candidate. */
048    private boolean m_isDeletionCandidate;
049
050    /** The structure id of the removed element. */
051    private CmsUUID m_structureId;
052
053    /**
054     * Creates a new instance.<p>
055     *
056     * @param structureId the structure id of the removed element
057     * @param elementInfo the list info bean for the removed element
058     * @param deletable true if this is a possible deletion candidate
059     * @param elementDeleteMode the element delete mode
060     */
061    public CmsRemovedElementStatus(
062        CmsUUID structureId,
063        CmsListInfoBean elementInfo,
064        boolean deletable,
065        ElementDeleteMode elementDeleteMode) {
066
067        m_isDeletionCandidate = deletable;
068        m_elementInfo = elementInfo;
069        m_structureId = structureId;
070        m_elementDeleteMode = elementDeleteMode;
071    }
072
073    /**
074     * Default constructor for serialization.<p>
075     */
076    protected CmsRemovedElementStatus() {
077
078        // empty default constructor for serialization
079    }
080
081    /**
082     * Gets the element delete mode.<p>
083     *
084     * @return the element delete mode
085     */
086    public ElementDeleteMode getElementDeleteMode() {
087
088        return m_elementDeleteMode;
089    }
090
091    /**
092     * Gets the list info bean for the removed element.<p>
093     *
094     * @return the list info bean for the removed element
095     */
096    public CmsListInfoBean getElementInfo() {
097
098        return m_elementInfo;
099    }
100
101    /**
102     * Gets the structure id of the removed element.<p>
103     *
104     * @return the structure id of the removed element
105     */
106    public CmsUUID getStructureId() {
107
108        return m_structureId;
109    }
110
111    /**
112     * Returns true if the removed element is a possible candidate for deletion.<p>
113     *
114     * @return true if the removed element is a deletion candidate
115     */
116    public boolean isDeletionCandidate() {
117
118        return m_isDeletionCandidate;
119    }
120
121}