Package org.opencms.workplace.tools
Class A_CmsHtmlIconButton
java.lang.Object
org.opencms.workplace.tools.A_CmsHtmlIconButton
- All Implemented Interfaces:
I_CmsHtmlIconButton
Default skeleton for an html icon button.
- Since:
- 6.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CmsMessageContainer
Constant for an empty message.protected String
unique id. -
Constructor Summary
ConstructorDescriptionDefault Constructor.A_CmsHtmlIconButton
(String id, CmsMessageContainer name, CmsMessageContainer helpText, String iconPath, boolean enabled) Full Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
defaultButtonHtml
(CmsHtmlIconButtonStyleEnum style, String id, String name, String helpText, boolean enabled, String iconPath, String confirmationMessage, String onClick) Generates a default html code for icon buttons.static String
defaultButtonHtml
(CmsHtmlIconButtonStyleEnum style, String id, String helpId, String name, String helpText, boolean enabled, String iconPath, String confirmationMessage, String onClick, boolean singleHelp, String rightHtml) Generates a default html code where several buttons can have the same help text.static String
defaultHelpHtml
(String helpId, String helpText) Generates html for the helptext when having one helptext for several buttons.Returns the help text.Returns the path to the icon.getId()
Returns the id of the html component.getName()
Returns the display name.boolean
Returns if enabled or disabled.boolean
Returns if visible or not.void
setEnabled
(boolean enabled) Sets if enabled or disabled.void
setHelpText
(CmsMessageContainer helpText) Sets the help Text.void
setIconPath
(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 Details
-
EMPTY_MESSAGE
Constant for an empty message. -
m_id
unique id.
-
-
Constructor Details
-
A_CmsHtmlIconButton
Default Constructor.- Parameters:
id
- the id
-
A_CmsHtmlIconButton
public A_CmsHtmlIconButton(String id, CmsMessageContainer name, CmsMessageContainer helpText, String iconPath, boolean enabled) Full Constructor.- Parameters:
id
- the idname
- the namehelpText
- the help texticonPath
- the path to the iconenabled
- if enabled or not
-
-
Method Details
-
defaultButtonHtml
public static String defaultButtonHtml(CmsHtmlIconButtonStyleEnum style, String id, String name, String helpText, boolean enabled, String iconPath, String confirmationMessage, String onClick) Generates a default html code for icon buttons.- Parameters:
style
- the style of the buttonid
- the idname
- the namehelpText
- the help textenabled
- if enabled or noticonPath
- the path to the iconconfirmationMessage
- the optional confirmation messageonClick
- the js code to execute- Returns:
- html code
-
defaultButtonHtml
public static String defaultButtonHtml(CmsHtmlIconButtonStyleEnum style, String id, String helpId, String name, String helpText, boolean enabled, String iconPath, String confirmationMessage, String onClick, boolean singleHelp, String rightHtml) Generates a default html code where several buttons can have the same help text.- Parameters:
style
- the style of the buttonid
- the idhelpId
- the id of the helptext div tagname
- the name, if empty only the icon is displayedhelpText
- the help text, if empty no mouse events are generatedenabled
- if enabled or not, if not set be sure to take an according helptexticonPath
- the path to the icon, if empty only the name is displayedconfirmationMessage
- the confirmation messageonClick
- the js code to execute, if empty no link is generatedsingleHelp
- if set, no helptext is written, you have to use the defaultHelpHtml() method laterrightHtml
- optional html code that should come direct after the button- Returns:
- html code
-
defaultHelpHtml
Generates html for the helptext when having one helptext for several buttons.- Parameters:
helpId
- the id of the help texthelpText
- the help text- Returns:
- html code
-
getHelpText
Description copied from interface:I_CmsHtmlIconButton
Returns the help text.- Specified by:
getHelpText
in interfaceI_CmsHtmlIconButton
- Returns:
- the help text
- See Also:
-
getIconPath
Description copied from interface:I_CmsHtmlIconButton
Returns the path to the icon.- Specified by:
getIconPath
in interfaceI_CmsHtmlIconButton
- Returns:
- the path to the icon
- See Also:
-
getId
Description copied from interface:I_CmsHtmlIconButton
Returns the id of the html component.- Specified by:
getId
in interfaceI_CmsHtmlIconButton
- Returns:
- the id
- See Also:
-
getName
Description copied from interface:I_CmsHtmlIconButton
Returns the display name.- Specified by:
getName
in interfaceI_CmsHtmlIconButton
- Returns:
- the display name
- See Also:
-
isEnabled
Description copied from interface:I_CmsHtmlIconButton
Returns if enabled or disabled.- Specified by:
isEnabled
in interfaceI_CmsHtmlIconButton
- Returns:
- if enabled or disabled
- See Also:
-
isVisible
Description copied from interface:I_CmsHtmlIconButton
Returns if visible or not.- Specified by:
isVisible
in interfaceI_CmsHtmlIconButton
- Returns:
- if visible or not
- See Also:
-
setEnabled
Description copied from interface:I_CmsHtmlIconButton
Sets if enabled or disabled.- Specified by:
setEnabled
in interfaceI_CmsHtmlIconButton
- Parameters:
enabled
- if enabled or disabled- See Also:
-
setHelpText
Description copied from interface:I_CmsHtmlIconButton
Sets the help Text.- Specified by:
setHelpText
in interfaceI_CmsHtmlIconButton
- Parameters:
helpText
- the help Text to set- See Also:
-
setIconPath
Description copied from interface:I_CmsHtmlIconButton
Sets the icon Path.- Specified by:
setIconPath
in interfaceI_CmsHtmlIconButton
- Parameters:
iconPath
- the icon Path to set- See Also:
-
setName
Description copied from interface:I_CmsHtmlIconButton
Sets the name.- Specified by:
setName
in interfaceI_CmsHtmlIconButton
- Parameters:
name
- the name to set- See Also:
-
setVisible
Description copied from interface:I_CmsHtmlIconButton
Sets if visible or not.- Specified by:
setVisible
in interfaceI_CmsHtmlIconButton
- Parameters:
visible
- if visible or not- See Also:
-