BooleanDecorator (Hyperic HQ Plugin API)
Keywords: org.hyperic.hq.ui.taglib.display.BooleanDecorator class

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hq.ui.taglib.display
Class BooleanDecorator

    java.lang.Object
      org.hyperic.hq.ui.taglib.display.Decorator
          org.hyperic.hq.ui.taglib.display.ColumnDecorator
              org.hyperic.hq.ui.taglib.display.BaseDecorator
                  org.hyperic.hq.ui.taglib.display.BooleanDecorator

All Implemented Interfaces:
  java.lang.Cloneable, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

    public class BooleanDecorator

extends BaseDecorator
implements java.lang.Cloneable

Lookup in the context messages for common boolean items for textual display or HTML tag building i.e. "Yes" - "No" "On" - "Off" "/image/icon_on.gif" - "/image/icon_off.gif" If you have a property return a Boolean, you can do In the properties file have these keys present: resource.application.inventory.service.ispresent.true=YES resource.application.inventory.service.ispresent.false=NO To Do: Make this work with boolean's as well as Booleans so you can have some more fun. For instance, the "flag" might be a method that has indexed bits i. e. in the example below getFlags() must might return java.util.BitSet whose first bit we're interested in In the properties file, have these keys present: application.properties.key.prefix.true=Yes application.properties.key.prefix.false=No

Field Summary

Fields inherited from interface javax.servlet.jsp.tagext.Tag
`EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE`

Constructor Summary
`BooleanDecorator()`

Method Summary
`java.lang.String` | `decorate(java.lang.Object columnValue)` The main method to override here.
`int` | `doStartTag()`
`void` | `release()`
`void` | `setFlagKey(java.lang.String theFlagKey)` Sets the message prefix that respresents a boolean result

Methods inherited from class org.hyperic.hq.ui.taglib.display.BaseDecorator
`doEndTag, generateErrorComment, getName, getParent, setName, setParent`

Methods inherited from class org.hyperic.hq.ui.taglib.display.Decorator
`finish, finishRow, getList, getListIndex, getObject, getPageContext, getViewIndex, init, initRow, setPageContext`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface javax.servlet.jsp.tagext.Tag
`setPageContext`

Constructor Detail

### BooleanDecorator

    public BooleanDecorator()

Method Detail

### setFlagKey

    public void setFlagKey(java.lang.String theFlagKey)

  Sets the message prefix that respresents a boolean result

  Parameters:
    `theFlagKey` - a String that will have "true" or "false" appended to it to look up in the application properties

### decorate

    public java.lang.String decorate(java.lang.Object columnValue)

  Description copied from class: `BaseDecorator`
  The main method to override here. This should look something like this: `String name = null; try { name = (String) evalAttr("name", this.name, String.class); } catch (NullAttributeException ne) { log.debug("bean " + this.name + " not found"); return ""; } catch (JspException je) { log.debug("can't evaluate name [" + this.name + "]: ", je); return ""; } StringBuffer buf = new StringBuffer(1024); buf.append(""); buf.append(obj.toString()); buf.append(""); return buf.toString()`

  Specified by:
    `decorate` in class `BaseDecorator`

### doStartTag

    public int doStartTag()
                   throws javax.servlet.jsp.JspTagException

  Specified by:
    `doStartTag` in interface `javax.servlet.jsp.tagext.Tag`
  Overrides:
    `doStartTag` in class `BaseDecorator`
  Throws:
    `javax.servlet.jsp.JspTagException`

### release

    public void release()

  Specified by:
    `release` in interface `javax.servlet.jsp.tagext.Tag`
  Overrides:
    `release` in class `BaseDecorator`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.