org.opencms.workplace.tools
Class A_CmsHtmlIconButton

java.lang.Object
  extended by org.opencms.workplace.tools.A_CmsHtmlIconButton
All Implemented Interfaces:
I_CmsHtmlIconButton
Direct Known Subclasses:
A_CmsListAction

public abstract class A_CmsHtmlIconButton
extends java.lang.Object
implements I_CmsHtmlIconButton

Default skeleton for an html icon button.

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

Field Summary
static CmsMessageContainer EMPTY_MESSAGE
          Constant for an empty message.
protected  java.lang.String m_id
          unique id.
 
Constructor Summary
A_CmsHtmlIconButton(java.lang.String id)
          Default Constructor.
A_CmsHtmlIconButton(java.lang.String id, CmsMessageContainer name, CmsMessageContainer helpText, java.lang.String iconPath, boolean enabled)
          Full Constructor.
 
Method Summary
static java.lang.String defaultButtonHtml(CmsHtmlIconButtonStyleEnum style, java.lang.String id, java.lang.String name, java.lang.String helpText, boolean enabled, java.lang.String iconPath, java.lang.String confirmationMessage, java.lang.String onClick)
          Generates a default html code for icon buttons.
static java.lang.String defaultButtonHtml(CmsHtmlIconButtonStyleEnum style, java.lang.String id, java.lang.String helpId, java.lang.String name, java.lang.String helpText, boolean enabled, java.lang.String iconPath, java.lang.String confirmationMessage, java.lang.String onClick, boolean singleHelp, java.lang.String rightHtml)
          Generates a default html code where several buttons can have the same help text.
static java.lang.String defaultHelpHtml(java.lang.String helpId, java.lang.String helpText)
          Generates html for the helptext when having one helptext for several buttons.
 CmsMessageContainer getHelpText()
          Returns the help text.
 java.lang.String getIconPath()
          Returns the path to the icon.
 java.lang.String getId()
          Returns the id of the html component.
 CmsMessageContainer getName()
          Returns the display name.
 boolean isEnabled()
          Returns if enabled or disabled.
 boolean isVisible()
          Returns if visible or not.
 void setEnabled(boolean enabled)
          Sets if enabled or disabled.
 void setHelpText(CmsMessageContainer helpText)
          Sets the help Text.
 void setIconPath(java.lang.String iconPath)
          Sets the icon Path.
 void setName(CmsMessageContainer name)
          Sets the name.
 void setVisible(boolean visible)
          Sets if visible or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opencms.workplace.tools.I_CmsHtmlIconButton
buttonHtml
 

Field Detail

EMPTY_MESSAGE

public static final CmsMessageContainer EMPTY_MESSAGE
Constant for an empty message.


m_id

protected java.lang.String m_id
unique id.

Constructor Detail

A_CmsHtmlIconButton

public A_CmsHtmlIconButton(java.lang.String id)
Default Constructor.

Parameters:
id - the id

A_CmsHtmlIconButton

public A_CmsHtmlIconButton(java.lang.String id,
                           CmsMessageContainer name,
                           CmsMessageContainer helpText,
                           java.lang.String iconPath,
                           boolean enabled)
Full Constructor.

Parameters:
id - the id
name - the name
helpText - the help text
iconPath - the path to the icon
enabled - if enabled or not
Method Detail

defaultButtonHtml

public static java.lang.String defaultButtonHtml(CmsHtmlIconButtonStyleEnum style,
                                                 java.lang.String id,
                                                 java.lang.String name,
                                                 java.lang.String helpText,
                                                 boolean enabled,
                                                 java.lang.String iconPath,
                                                 java.lang.String confirmationMessage,
                                                 java.lang.String onClick)
Generates a default html code for icon buttons.

Parameters:
style - the style of the button
id - the id
name - the name
helpText - the help text
enabled - if enabled or not
iconPath - the path to the icon
confirmationMessage - the optional confirmation message
onClick - the js code to execute
Returns:
html code

defaultButtonHtml

public static java.lang.String defaultButtonHtml(CmsHtmlIconButtonStyleEnum style,
                                                 java.lang.String id,
                                                 java.lang.String helpId,
                                                 java.lang.String name,
                                                 java.lang.String helpText,
                                                 boolean enabled,
                                                 java.lang.String iconPath,
                                                 java.lang.String confirmationMessage,
                                                 java.lang.String onClick,
                                                 boolean singleHelp,
                                                 java.lang.String rightHtml)
Generates a default html code where several buttons can have the same help text.

Parameters:
style - the style of the button
id - the id
helpId - the id of the helptext div tag
name - the name, if empty only the icon is displayed
helpText - the help text, if empty no mouse events are generated
enabled - if enabled or not, if not set be sure to take an according helptext
iconPath - the path to the icon, if empty only the name is displayed
confirmationMessage - the confirmation message
onClick - the js code to execute, if empty no link is generated
singleHelp - if set, no helptext is written, you have to use the defaultHelpHtml() method later
rightHtml - optional html code that should come direct after the button
Returns:
html code

defaultHelpHtml

public static java.lang.String defaultHelpHtml(java.lang.String helpId,
                                               java.lang.String helpText)
Generates html for the helptext when having one helptext for several buttons.

Parameters:
helpId - the id of the help text
helpText - the help text
Returns:
html code

getHelpText

public CmsMessageContainer getHelpText()
Description copied from interface: I_CmsHtmlIconButton
Returns the help text.

Specified by:
getHelpText in interface I_CmsHtmlIconButton
Returns:
the help text
See Also:
I_CmsHtmlIconButton.getHelpText()

getIconPath

public java.lang.String getIconPath()
Description copied from interface: I_CmsHtmlIconButton
Returns the path to the icon.

Specified by:
getIconPath in interface I_CmsHtmlIconButton
Returns:
the path to the icon
See Also:
I_CmsHtmlIconButton.getIconPath()

getId

public java.lang.String getId()
Description copied from interface: I_CmsHtmlIconButton
Returns the id of the html component.

Specified by:
getId in interface I_CmsHtmlIconButton
Returns:
the id
See Also:
I_CmsHtmlIconButton.getId()

getName

public CmsMessageContainer getName()
Description copied from interface: I_CmsHtmlIconButton
Returns the display name.

Specified by:
getName in interface I_CmsHtmlIconButton
Returns:
the display name
See Also:
I_CmsHtmlIconButton.getName()

isEnabled

public boolean isEnabled()
Description copied from interface: I_CmsHtmlIconButton
Returns if enabled or disabled.

Specified by:
isEnabled in interface I_CmsHtmlIconButton
Returns:
if enabled or disabled
See Also:
I_CmsHtmlIconButton.isEnabled()

isVisible

public boolean isVisible()
Description copied from interface: I_CmsHtmlIconButton
Returns if visible or not.

Specified by:
isVisible in interface I_CmsHtmlIconButton
Returns:
if visible or not
See Also:
I_CmsHtmlIconButton.isVisible()

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: I_CmsHtmlIconButton
Sets if enabled or disabled.

Specified by:
setEnabled in interface I_CmsHtmlIconButton
Parameters:
enabled - if enabled or disabled
See Also:
I_CmsHtmlIconButton.setEnabled(boolean)

setHelpText

public void setHelpText(CmsMessageContainer helpText)
Description copied from interface: I_CmsHtmlIconButton
Sets the help Text.

Specified by:
setHelpText in interface I_CmsHtmlIconButton
Parameters:
helpText - the help Text to set
See Also:
I_CmsHtmlIconButton.setHelpText(org.opencms.i18n.CmsMessageContainer)

setIconPath

public void setIconPath(java.lang.String iconPath)
Description copied from interface: I_CmsHtmlIconButton
Sets the icon Path.

Specified by:
setIconPath in interface I_CmsHtmlIconButton
Parameters:
iconPath - the icon Path to set
See Also:
I_CmsHtmlIconButton.setIconPath(java.lang.String)

setName

public void setName(CmsMessageContainer name)
Description copied from interface: I_CmsHtmlIconButton
Sets the name.

Specified by:
setName in interface I_CmsHtmlIconButton
Parameters:
name - the name to set
See Also:
I_CmsHtmlIconButton.setName(org.opencms.i18n.CmsMessageContainer)

setVisible

public void setVisible(boolean visible)
Description copied from interface: I_CmsHtmlIconButton
Sets if visible or not.

Specified by:
setVisible in interface I_CmsHtmlIconButton
Parameters:
visible - if visible or not
See Also:
I_CmsHtmlIconButton.setVisible(boolean)