Class Icon

All Implemented Interfaces:
Serializable, DynamicAttributes, IterationTag, JspTag, Tag, DynamicActionAttributes

public class Icon
extends StylableTag
This tag is used to make it easier to display icons on a BASE web page.

Example:

   <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
   <base:icon image="required.png" />

Syntax:

   <base:icon
      id=...
      clazz=...
      style=...
      image=...
      tooltip=...
      visible=...
      tabindex=...
   >
Tag attributes
Attribute Default value Required Description
id - no The ID of the icon. The value of this attribute goes directly into the standard id attribute. This means that if you need a reference to the note object in your own JavaScript code, you may for example use the following code:

icon = document.getElementById('<id>');

clazz icon no The value if this attribute goes directly into the standard HTML class attribute. This allows you to apply different styles to different icons.
style - no The value if this attribute goes directly into the standard HTML style attribute. This allows you to apply different styles to different icons.
image yes The name of the image to display. The image must be in the /images directory. Only include the filename, not the path. This taglib will find the correct path from the current jsp page.
tooltip no A short explanation that will show up as a tooltip.
visible true no If the note should be visible or not.
tabindex 0 no Tab index value to control the focus order. Use -1 to disable tabbing to the icon.
Version:
2.0
Author:
Nicklas
See Also:
Serialized Form
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
      Constant Field Values
    • page

      private Page page
      The parent <base:page> tag.
    • image

      private String image
      The filename of the image.
    • tooltip

      private String tooltip
      An optional tooltip.
    • visible

      private boolean visible
      If the icon should be visible or not.
    • href

      private String href
      If present, the icon is enclosed with an <a> tag that opens the given url in a new window.
    • enabled

      private boolean enabled
      If the icon should be enabled or not (if an onclick has been set).
    • tabIndex

      private int tabIndex
  • Constructor Details

    • Icon

      public Icon()
  • Method Details

    • setImage

      public void setImage​(String image)
    • getImage

      public String getImage()
    • setVisible

      public void setVisible​(boolean visible)
    • isVisible

      public boolean isVisible()
    • setEnabled

      public void setEnabled​(boolean enabled)
    • isEnabled

      public boolean isEnabled()
    • setTooltip

      public void setTooltip​(String tooltip)
    • getTooltip

      public String getTooltip()
    • setHref

      public void setHref​(String href)
      Since:
      3.12
    • getHref

      public String getHref()
      Since:
      3.12
    • setTabindex

      public void setTabindex​(int tabIndex)
      Since:
      3.2
    • getTabindex

      public int getTabindex()
      Since:
      3.2
    • doStartTag

      public int doStartTag() throws JspException
      Specified by:
      doStartTag in interface Tag
      Overrides:
      doStartTag in class TagSupport
      Throws:
      JspException
    • doEndTag

      public int doEndTag() throws JspException
      Specified by:
      doEndTag in interface Tag
      Overrides:
      doEndTag in class TagSupport
      Throws:
      JspException