org.opencms.workplace.tools
Class CmsTool

java.lang.Object
  extended by org.opencms.workplace.tools.CmsTool

public class CmsTool
extends java.lang.Object

Implementation of an administration tool.

An admin tool can be a link to itself through the buttonHtml(CmsWorkplace) method, as also a group of CmsToolGroups through the groupHtml(CmsWorkplace) method.

Since:
6.0.0
Version:
$Revision: 1.31 $
Author:
Michael Moossen

Constructor Summary
CmsTool(java.lang.String id, I_CmsToolHandler handler)
          Default Constructor.
 
Method Summary
 void addToolGroup(CmsToolGroup group)
          Adds a group.
 void addToolGroup(CmsToolGroup group, float position)
          Adds a group at the given position.
 java.lang.String buttonHtml(CmsWorkplace wp)
          Returns the necessary html code for a link to this tool.
 boolean equals(java.lang.Object obj)
          Compares two tools by name.
 I_CmsToolHandler getHandler()
          Returns the handler.
 java.lang.String getId()
          Returns the dhtml unique id.
 CmsToolGroup getToolGroup(java.lang.String name)
          Returns the requested group.
 java.util.List getToolGroups()
          Retuns a list of groups.
 java.lang.String groupHtml(CmsWorkplace wp)
          Returns the necessary html code for the tool subgroups.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsTool

public CmsTool(java.lang.String id,
               I_CmsToolHandler handler)
Default Constructor.

Parameters:
id - a unique id
handler - the handler that represents this tool
Method Detail

addToolGroup

public void addToolGroup(CmsToolGroup group)
Adds a group.

Parameters:
group - the group
See Also:
CmsIdentifiableObjectContainer.addIdentifiableObject(String, Object)

addToolGroup

public void addToolGroup(CmsToolGroup group,
                         float position)
Adds a group at the given position.

Parameters:
group - the group
position - the position
See Also:
CmsIdentifiableObjectContainer.addIdentifiableObject(String, Object, float)

buttonHtml

public java.lang.String buttonHtml(CmsWorkplace wp)
Returns the necessary html code for a link to this tool.

Parameters:
wp - the jsp page to write the code to
Returns:
html code

equals

public boolean equals(java.lang.Object obj)
Compares two tools by name.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the other tool
Returns:
true if the tools have the same name

getHandler

public I_CmsToolHandler getHandler()
Returns the handler.

Returns:
the handler

getId

public java.lang.String getId()
Returns the dhtml unique id.

Returns:
the dhtml unique id

getToolGroup

public CmsToolGroup getToolGroup(java.lang.String name)
Returns the requested group.

Parameters:
name - the name of the group
Returns:
the group
See Also:
CmsIdentifiableObjectContainer.getObject(String)

getToolGroups

public java.util.List getToolGroups()
Retuns a list of groups.

Returns:
a list of CmsToolGroup

groupHtml

public java.lang.String groupHtml(CmsWorkplace wp)
Returns the necessary html code for the tool subgroups.

Parameters:
wp - the jsp page to write the code to
Returns:
html code

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()