001: /*
002: * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/tools/CmsToolRootHandler.java,v $
003: * Date : $Date: 2008-02-27 12:05:31 $
004: * Version: $Revision: 1.4 $
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 GmbH, 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.tools;
033:
034: import org.opencms.file.CmsObject;
035:
036: /**
037: * Admin tool handler for tool roots.<p>
038: *
039: * @author Michael Moossen
040: *
041: * @version $Revision: 1.4 $
042: *
043: * @since 6.0.0
044: */
045: public class CmsToolRootHandler extends A_CmsToolHandler {
046:
047: /** The key to access this tool root. */
048: private String m_key;
049: /** The uri where to look for the tools for this root. */
050: private String m_uri;
051:
052: /**
053: * Returns the key.<p>
054: *
055: * @return the key
056: */
057: public String getKey() {
058:
059: return m_key;
060: }
061:
062: /**
063: * Returns the uri.<p>
064: *
065: * @return the uri
066: */
067: public String getUri() {
068:
069: return m_uri;
070: }
071:
072: /**
073: * @see org.opencms.workplace.tools.A_CmsToolHandler#isEnabled(org.opencms.file.CmsObject)
074: */
075: public boolean isEnabled(CmsObject cms) {
076:
077: return true;
078: }
079:
080: /**
081: * @see org.opencms.workplace.tools.A_CmsToolHandler#isVisible(org.opencms.file.CmsObject)
082: */
083: public boolean isVisible(CmsObject cms) {
084:
085: return true;
086: }
087:
088: /**
089: * Sets the key.<p>
090: *
091: * @param key the key to set
092: */
093: public void setKey(String key) {
094:
095: m_key = key;
096: }
097:
098: /**
099: * @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,
102: String resourcePath) {
103:
104: setDisabledHelpText(getHelpText());
105: setIconPath("admin/images/deficon.png");
106: setSmallIconPath(getIconPath());
107: setPath("/");
108: setGroup("");
109: setPosition(1);
110: setLink(cms, resourcePath);
111: return true;
112: }
113:
114: /**
115: * Sets the uri.<p>
116: *
117: * @param uri the uri to set
118: */
119: public void setUri(String uri) {
120:
121: m_uri = uri;
122: }
123: }
|