org.apache.commons.jelly.tags.swt
Class SwtHelper

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.DynaTagSupport
          extended byorg.apache.commons.jelly.MapTagSupport
              extended byorg.apache.commons.jelly.tags.core.UseBeanTag
                  extended byorg.apache.commons.jelly.tags.swt.SwtHelper
All Implemented Interfaces:
org.apache.commons.jelly.impl.BeanSource, org.apache.commons.jelly.DynaTag, org.apache.commons.jelly.Tag

public class SwtHelper
extends org.apache.commons.jelly.tags.core.UseBeanTag

A helper class for working with SWT.

Version:
1.1
Author:
James Strachan

Field Summary
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
SwtHelper()
           
 
Method Summary
static int getStyleCode(java.lang.Class constantClass, java.lang.String text)
           
static int parseStyle(java.lang.Class constantClass, java.lang.String text)
          Parses the comma delimited String of style codes which are or'd together.
static int parseStyle(java.lang.Class constantClass, java.lang.String text, boolean toUpperCase)
          Parses the comma delimited String of style codes which are or'd together.
 
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
addIgnoreProperty, convertToClass, doTag, getBean, getDefaultClass, getIgnorePropertySet, isIgnoreUnknownProperties, loadClass, newInstance, processBean, setBean, setBeanProperties, setIgnoreUnknownProperties, validateBeanProperties
 
Methods inherited from class org.apache.commons.jelly.MapTagSupport
createAttributes, getAttributes, setAttribute
 
Methods inherited from class org.apache.commons.jelly.DynaTagSupport
getAttributeType
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Constructor Detail

SwtHelper

public SwtHelper()
Method Detail

parseStyle

public static int parseStyle(java.lang.Class constantClass,
                             java.lang.String text)
                      throws org.apache.commons.jelly.JellyTagException
Parses the comma delimited String of style codes which are or'd together. The given class describes the integer static constants

Parameters:
constantClass - is the type to look for static fields
text - is a comma delimited text value such as "border, resize"
Returns:
the int code
Throws:
org.apache.commons.jelly.JellyTagException

parseStyle

public static int parseStyle(java.lang.Class constantClass,
                             java.lang.String text,
                             boolean toUpperCase)
                      throws org.apache.commons.jelly.JellyTagException
Parses the comma delimited String of style codes which are or'd together. The given class describes the integer static constants

Parameters:
constantClass - is the type to look for static fields
text - is a comma delimited text value such as "border, resize"
toUpperCase - is whether the text should be converted to upper case before its compared against the reflection fields
Returns:
the int code
Throws:
org.apache.commons.jelly.JellyTagException

getStyleCode

public static int getStyleCode(java.lang.Class constantClass,
                               java.lang.String text)
                        throws org.apache.commons.jelly.JellyTagException
Returns:
the code for the given word or zero if the word doesn't match a valid style
Throws:
org.apache.commons.jelly.JellyTagException


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.