Package org.opennms.web.category
Class CategoryUtil
- java.lang.Object
-
- org.opennms.web.category.CategoryUtil
-
public class CategoryUtil extends Object
Provides look and feel utilities for the JSPs presenting category (real time console) information.- Version:
- $Id: $
- Author:
- Lawrence Karnowski , OpenNMS , Lawrence Karnowski , OpenNMS
-
-
Field Summary
Fields Modifier and Type Field Description static DecimalFormatvalueFormatSpecifies how the category values should look.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringformatValue(double value)Format an RTC value the way we want it.static StringgetCategoryClass(double normal, double warning, double value)Determine the CSS class to use for a given value and thresholds.static StringgetCategoryClass(Category category)Determine the CSS class to use for a given category value and thresholds.static StringgetCategoryClass(Category category, double value)Determine the CSS color to use for a given value and the given category's thresholds.
-
-
-
Field Detail
-
valueFormat
public static final DecimalFormat valueFormat
Specifies how the category values should look.Note this value is currently public, but consider this temporary. To hide the implementation (so we can change it later), please call
formatValueinstead.
-
-
Method Detail
-
formatValue
public static String formatValue(double value)
Format an RTC value the way we want it.- Parameters:
value- a double.- Returns:
- a
Stringobject.
-
getCategoryClass
public static String getCategoryClass(Category category) throws IOException
Determine the CSS class to use for a given category value and thresholds.- Parameters:
category- aCategoryobject.- Returns:
- a
Stringobject. - Throws:
IOException- if any.
-
getCategoryClass
public static String getCategoryClass(Category category, double value) throws IOException
Determine the CSS color to use for a given value and the given category's thresholds.- Parameters:
category- aCategoryobject.value- a double.- Returns:
- a
Stringobject. - Throws:
IOException- if any.
-
-