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

java.lang.Object
  |
  +--org.apache.commons.jelly.TagSupport
        |
        +--org.apache.commons.jelly.tags.swt.OnEventTag
All Implemented Interfaces:
org.eclipse.swt.widgets.Listener, org.apache.commons.jelly.Tag

public class OnEventTag
extends org.apache.commons.jelly.TagSupport
implements org.eclipse.swt.widgets.Listener

A tag which implements a Listener to allow events to be processed by Jelly scripts

Version:
1.1
Author:
James Strachan

Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
OnEventTag()
           
 
Method Summary
 void doTag(org.apache.commons.jelly.XMLOutput output)
           
protected  int getEventType(java.lang.String type)
          Parses the given event type String and returns the SWT event type code
 org.eclipse.swt.widgets.Widget getParentWidget()
           
 java.lang.String getType()
          Returns the type.
 void handleEvent(org.eclipse.swt.widgets.Event event)
           
 void setType(java.lang.String type)
          Sets the type of the event listener to listen for.
 void setVar(java.lang.String var)
          Sets the name of the variable to use to expose the event object when it is fired.
 
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
 

Constructor Detail

OnEventTag

public OnEventTag()
Method Detail

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.MissingAttributeException,
                  org.apache.commons.jelly.JellyTagException
Overrides:
doTag in class org.apache.commons.jelly.TagSupport
See Also:
Tag.doTag(org.apache.commons.jelly.XMLOutput)

handleEvent

public void handleEvent(org.eclipse.swt.widgets.Event event)
Specified by:
handleEvent in interface org.eclipse.swt.widgets.Listener
See Also:
Listener.handleEvent(org.eclipse.swt.widgets.Event)

getParentWidget

public org.eclipse.swt.widgets.Widget getParentWidget()
Returns:
the parent widget which this widget will be added to.

setVar

public void setVar(java.lang.String var)
Sets the name of the variable to use to expose the event object when it is fired. If not specified this defaults to "event"

getType

public java.lang.String getType()
Returns the type.
Returns:
String

setType

public void setType(java.lang.String type)
Sets the type of the event listener to listen for.
Parameters:
type - The type of the event to listen for

getEventType

protected int getEventType(java.lang.String type)
                    throws org.apache.commons.jelly.JellyTagException
Parses the given event type String and returns the SWT event type code
Parameters:
type - is the String event type
Returns:
the SWT integer event type


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