Here you can find the source of getBooleanValue(Element element, Object constant)
Parameter | Description |
---|---|
element | RTF-Element |
constant | Constant (e.g StyleConstants.Bold) |
public static Boolean getBooleanValue(Element element, Object constant)
//package com.java2s; //License from project: Open Source License import javax.swing.text.AttributeSet; import javax.swing.text.Element; public class Main { /**/*from w w w . jav a 2 s.com*/ * Checks whether an Element has a boolean property * * @todo Check if constant is of type boolean * @param element * RTF-Element * @param constant * Constant (e.g StyleConstants.Bold) * @return true if it applies, false otherwise * */ public static Boolean getBooleanValue(Element element, Object constant) { AttributeSet attributes = element.getAttributes(); return (attributes.getAttribute(constant) != null && ((Boolean) attributes.getAttribute(constant)).booleanValue()); } }