Package org.opencms.workplace.tools
Class A_CmsHtmlIconButton
- java.lang.Object
-
- org.opencms.workplace.tools.A_CmsHtmlIconButton
-
- All Implemented Interfaces:
I_CmsHtmlIconButton
public abstract class A_CmsHtmlIconButton extends java.lang.Object implements I_CmsHtmlIconButton
Default skeleton for an html icon button.- Since:
- 6.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static CmsMessageContainer
EMPTY_MESSAGE
Constant for an empty message.protected java.lang.String
m_id
unique id.
-
Constructor Summary
Constructors Constructor Description 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 idname
- the namehelpText
- the help texticonPath
- the path to the iconenabled
- 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 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 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 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
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 texthelpText
- the help text- Returns:
- html code
-
getHelpText
public CmsMessageContainer getHelpText()
Description copied from interface:I_CmsHtmlIconButton
Returns the help text.- Specified by:
getHelpText
in interfaceI_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 interfaceI_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 interfaceI_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 interfaceI_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 interfaceI_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 interfaceI_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 interfaceI_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 interfaceI_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 interfaceI_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 interfaceI_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 interfaceI_CmsHtmlIconButton
- Parameters:
visible
- if visible or not- See Also:
I_CmsHtmlIconButton.setVisible(boolean)
-
-