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
FieldsModifier and TypeFieldDescriptionstatic final CmsMessageContainerConstant for an empty message.protected Stringunique id. -
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor.A_CmsHtmlIconButton(String id, CmsMessageContainer name, CmsMessageContainer helpText, String iconPath, boolean enabled) Full Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdefaultButtonHtml(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 StringdefaultButtonHtml(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 StringdefaultHelpHtml(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.booleanReturns if enabled or disabled.booleanReturns if visible or not.voidsetEnabled(boolean enabled) Sets if enabled or disabled.voidsetHelpText(CmsMessageContainer helpText) Sets the help Text.voidsetIconPath(String iconPath) Sets the icon Path.voidsetName(CmsMessageContainer name) Sets the name.voidsetVisible(boolean visible) Sets if visible or not.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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_CmsHtmlIconButtonReturns the help text.- Specified by:
getHelpTextin interfaceI_CmsHtmlIconButton- Returns:
- the help text
- See Also:
-
getIconPath
Description copied from interface:I_CmsHtmlIconButtonReturns the path to the icon.- Specified by:
getIconPathin interfaceI_CmsHtmlIconButton- Returns:
- the path to the icon
- See Also:
-
getId
Description copied from interface:I_CmsHtmlIconButtonReturns the id of the html component.- Specified by:
getIdin interfaceI_CmsHtmlIconButton- Returns:
- the id
- See Also:
-
getName
Description copied from interface:I_CmsHtmlIconButtonReturns the display name.- Specified by:
getNamein interfaceI_CmsHtmlIconButton- Returns:
- the display name
- See Also:
-
isEnabled
Description copied from interface:I_CmsHtmlIconButtonReturns if enabled or disabled.- Specified by:
isEnabledin interfaceI_CmsHtmlIconButton- Returns:
- if enabled or disabled
- See Also:
-
isVisible
Description copied from interface:I_CmsHtmlIconButtonReturns if visible or not.- Specified by:
isVisiblein interfaceI_CmsHtmlIconButton- Returns:
- if visible or not
- See Also:
-
setEnabled
Description copied from interface:I_CmsHtmlIconButtonSets if enabled or disabled.- Specified by:
setEnabledin interfaceI_CmsHtmlIconButton- Parameters:
enabled- if enabled or disabled- See Also:
-
setHelpText
Description copied from interface:I_CmsHtmlIconButtonSets the help Text.- Specified by:
setHelpTextin interfaceI_CmsHtmlIconButton- Parameters:
helpText- the help Text to set- See Also:
-
setIconPath
Description copied from interface:I_CmsHtmlIconButtonSets the icon Path.- Specified by:
setIconPathin interfaceI_CmsHtmlIconButton- Parameters:
iconPath- the icon Path to set- See Also:
-
setName
Description copied from interface:I_CmsHtmlIconButtonSets the name.- Specified by:
setNamein interfaceI_CmsHtmlIconButton- Parameters:
name- the name to set- See Also:
-
setVisible
Description copied from interface:I_CmsHtmlIconButtonSets if visible or not.- Specified by:
setVisiblein interfaceI_CmsHtmlIconButton- Parameters:
visible- if visible or not- See Also:
-