001: /*
002: * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/editors/directedit/CmsDirectEditResourceInfo.java,v $
003: * Date : $Date: 2008-02-27 12:05:54 $
004: * Version: $Revision: 1.5 $
005: *
006: * This library is part of OpenCms -
007: * the Open Source Content Management System
008: *
009: * Copyright (c) 2002 - 2008 Alkacon Software GmbH (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:
032: package org.opencms.workplace.editors.directedit;
033:
034: import org.opencms.file.CmsResource;
035: import org.opencms.lock.CmsLock;
036:
037: /**
038: * Contains information about a resource that is direct edited.<p>
039: *
040: * For example, the information in this class allows implementations
041: * of a {@link I_CmsDirectEditProvider} to render HTML
042: * with extended information about the resource displayed on the buttons.<p>
043: *
044: * @author Alexander Kandzior
045: *
046: * @version $Revision: 1.5 $
047: *
048: * @since 6.2.3
049: */
050: public class CmsDirectEditResourceInfo {
051:
052: /** Constant for inactive permissions without further resource info. */
053: public static final CmsDirectEditResourceInfo INACTIVE = new CmsDirectEditResourceInfo(
054: CmsDirectEditPermissions.INACTIVE);
055:
056: /** The lock on the direct edit resource. */
057: CmsLock m_lock;
058:
059: /** The direct edit permissions of the resource. */
060: CmsDirectEditPermissions m_permissions;
061:
062: /** The resource that is to be direct edited. */
063: CmsResource m_resource;
064:
065: /**
066: * Creates a new direct edit resource info container without any
067: * specific information about the resource to be direct edited.<p>
068: *
069: * @param permissions the direct edit permissions of the resource
070: */
071: public CmsDirectEditResourceInfo(
072: CmsDirectEditPermissions permissions) {
073:
074: this (permissions, null, null);
075: }
076:
077: /**
078: * Creates a new direct edit resource info container.<p>
079: *
080: * @param permissions the direct edit permissions of the resource
081: * @param resource the resource that is to be direct edited
082: * @param lock the lock on the direct edit resource
083: */
084: public CmsDirectEditResourceInfo(
085: CmsDirectEditPermissions permissions, CmsResource resource,
086: CmsLock lock) {
087:
088: m_permissions = permissions;
089: m_resource = resource;
090: m_lock = lock;
091: }
092:
093: /**
094: * Returns the lock on the direct edit resource.<p>
095: *
096: * This may be <code>null</code> in case the result is {@link #INACTIVE}.<p>
097: *
098: * @return the lock on the direct edit resource
099: */
100: public CmsLock getLock() {
101:
102: return m_lock;
103: }
104:
105: /**
106: * Returns the direct edit permissions of the resource.<p>
107: *
108: * The result is ensured not to be <code>null</code>.<p>
109: *
110: * @return the direct edit permissions of the resource
111: */
112: public CmsDirectEditPermissions getPermissions() {
113:
114: return m_permissions;
115: }
116:
117: /**
118: * Returns the resource that is to be direct edited.<p>
119: *
120: * This may be <code>null</code> in case the result is {@link #INACTIVE}.<p>
121: *
122: * @return the resource that is to be direct edited
123: */
124: public CmsResource getResource() {
125:
126: return m_resource;
127: }
128: }
|