KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > tools > CmsToolRootHandler


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/tools/CmsToolRootHandler.java,v $
3  * Date : $Date: 2006/03/27 14:52:51 $
4  * Version: $Revision: 1.2 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (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 GmbH, 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.tools;
33
34 import org.opencms.file.CmsObject;
35
36 /**
37  * Admin tool handler for tool roots.<p>
38  *
39  * @author Michael Moossen
40  *
41  * @version $Revision: 1.2 $
42  *
43  * @since 6.0.0
44  */

45 public class CmsToolRootHandler extends A_CmsToolHandler {
46
47     /** The key to access this tool root. */
48     private String JavaDoc m_key;
49     /** The uri where to look for the tools for this root. */
50     private String JavaDoc m_uri;
51
52     /**
53      * Returns the key.<p>
54      *
55      * @return the key
56      */

57     public String JavaDoc getKey() {
58
59         return m_key;
60     }
61
62     /**
63      * Returns the uri.<p>
64      *
65      * @return the uri
66      */

67     public String JavaDoc getUri() {
68
69         return m_uri;
70     }
71
72     /**
73      * @see org.opencms.workplace.tools.A_CmsToolHandler#isEnabled(org.opencms.file.CmsObject)
74      */

75     public boolean isEnabled(CmsObject cms) {
76
77         return true;
78     }
79
80     /**
81      * @see org.opencms.workplace.tools.A_CmsToolHandler#isVisible(org.opencms.file.CmsObject)
82      */

83     public boolean isVisible(CmsObject cms) {
84
85         return true;
86     }
87
88     /**
89      * Sets the key.<p>
90      *
91      * @param key the key to set
92      */

93     public void setKey(String JavaDoc key) {
94
95         m_key = key;
96     }
97
98     /**
99      * @see org.opencms.workplace.tools.A_CmsToolHandler#setup(org.opencms.file.CmsObject, org.opencms.workplace.tools.CmsToolRootHandler, java.lang.String)
100      */

101     public boolean setup(CmsObject cms, CmsToolRootHandler root, String JavaDoc resourcePath) {
102
103         setDisabledHelpText(getHelpText());
104         setIconPath("admin/images/deficon.png");
105         setSmallIconPath(getIconPath());
106         setPath("/");
107         setGroup("");
108         setPosition(1);
109         setLink(cms, resourcePath);
110         return true;
111     }
112
113     /**
114      * Sets the uri.<p>
115      *
116      * @param uri the uri to set
117      */

118     public void setUri(String JavaDoc uri) {
119
120         m_uri = uri;
121     }
122 }
123
Popular Tags