KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > editors > directedit > CmsDirectEditResourceInfo


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/editors/directedit/CmsDirectEditResourceInfo.java,v $
3  * Date : $Date: 2006/10/26 12:25:34 $
4  * Version: $Revision: 1.2 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (C) 2002 - 2005 Alkacon Software (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.workplace.editors.directedit;
33
34 import org.opencms.file.CmsResource;
35 import org.opencms.lock.CmsLock;
36
37 /**
38  * Contains information about a resource that is direct edited.<p>
39  *
40  * For example, the information in this class allows implementations
41  * of a {@link I_CmsDirectEditProvider} to render HTML
42  * with extended information about the resource displayed on the buttons.<p>
43  *
44  * @author Alexander Kandzior
45  *
46  * @version $Revision: 1.2 $
47  *
48  * @since 6.2.3
49  */

50 public class CmsDirectEditResourceInfo {
51
52     /** Constant for inactive permissions without further resource info. */
53     public static final CmsDirectEditResourceInfo INACTIVE = new CmsDirectEditResourceInfo(
54         CmsDirectEditPermissions.INACTIVE);
55
56     /** The lock on the direct edit resource. */
57     CmsLock m_lock;
58
59     /** The direct edit permissions of the resource. */
60     CmsDirectEditPermissions m_permissions;
61
62     /** The resource that is to be direct edited. */
63     CmsResource m_resource;
64
65     /**
66      * Creates a new direct edit resource info container without any
67      * specific information about the resource to be direct edited.<p>
68      *
69      * @param permissions the direct edit permissions of the resource
70      */

71     public CmsDirectEditResourceInfo(CmsDirectEditPermissions permissions) {
72
73         this(permissions, null, null);
74     }
75
76     /**
77      * Creates a new direct edit resource info container.<p>
78      *
79      * @param permissions the direct edit permissions of the resource
80      * @param resource the resource that is to be direct edited
81      * @param lock the lock on the direct edit resource
82      */

83     public CmsDirectEditResourceInfo(CmsDirectEditPermissions permissions, CmsResource resource, CmsLock lock) {
84
85         m_permissions = permissions;
86         m_resource = resource;
87         m_lock = lock;
88     }
89
90     /**
91      * Returns the lock on the direct edit resource.<p>
92      *
93      * This may be <code>null</code> in case the result is {@link #INACTIVE}.<p>
94      *
95      * @return the lock on the direct edit resource
96      */

97     public CmsLock getLock() {
98
99         return m_lock;
100     }
101
102     /**
103      * Returns the direct edit permissions of the resource.<p>
104      *
105      * The result is ensured not to be <code>null</code>.<p>
106      *
107      * @return the direct edit permissions of the resource
108      */

109     public CmsDirectEditPermissions getPermissions() {
110
111         return m_permissions;
112     }
113
114     /**
115      * Returns the resource that is to be direct edited.<p>
116      *
117      * This may be <code>null</code> in case the result is {@link #INACTIVE}.<p>
118      *
119      * @return the resource that is to be direct edited
120      */

121     public CmsResource getResource() {
122
123         return m_resource;
124     }
125 }
Popular Tags