Class ActionDataTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.action.tags.AbstractActionDataTag
-
- net.sf.jguiraffe.gui.builder.action.tags.ActionDataTag
-
- All Implemented Interfaces:
ActionData
,ConditionalTag
,IconSupport
,org.apache.commons.jelly.Tag
public class ActionDataTag extends AbstractActionDataTag
A simple tag for creating objects of type
ActionData
.This class can be used if only properties of actions are to be defined, but no complete action objects. The properties can later be used by other components (e.g. handlers for popup menus) in order to define real actions or other graphical components with similar properties.
The major part of the functionality provided by this tag is already implemented by the super class. What this class does is to store a reference to itself (which is actually an
ActionData
implementation) in the Jelly context where it can be retrieved later on. For this purpose the mandatoryvar
attribute must be specified. Of course, all other attributes defined by the super class are available, too. A usage example for this tag could look as follows:<a:actionData textres="ACT_FILE_OPEN_TXT" mnemonicres="ACT_FILE_OPEN_MNEMO" tooltipres="ACT_FILE_OPEN_TIP"> <f:icon resource="icon.gif"/> </a:actionData>
- Version:
- $Id: ActionDataTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description ActionDataTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ActionBuilder
getActionBuilder()
Returns a reference to the currentActionBuilder
instance.protected ActionManager
getActionManager()
Convenience method for obtaining a reference to the currentActionManager
.Object
getTask()
Returns the task for the represented action.String
getVar()
Returns the name of the variable where to store the data object created by this tag.protected void
process()
Executes this tag.void
setVar(String var)
Set method of thevar
attribute.-
Methods inherited from class net.sf.jguiraffe.gui.builder.action.tags.AbstractActionDataTag
checkAttributes, getAccelerator, getAcceleratorDef, getAcceleratorRef, getIcon, getMnemonicKey, getName, getText, getToolTip, processBeforeBody, setAccelerator, setAcceleratorDef, setAcceleratorRef, setIcon, setMnemonic, setMnemonicres, setName, setResgrp, setText, setTextres, setTooltip, setTooltipres
-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
canProcess, canProcess, convertToClass, convertToNumberWithUnit, convertToNumberWithUnit, doTag, findContainer, getBuilderData, getBuilderData, getIfName, getResourceText, getResourceText, getUnlessName, setIfName, setUnlessName
-
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
-
-
-
-
Method Detail
-
getVar
public String getVar()
Returns the name of the variable where to store the data object created by this tag.- Returns:
- the name of the target variable
-
setVar
public void setVar(String var)
Set method of thevar
attribute.- Parameters:
var
- the attribute's value
-
process
protected void process() throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Executes this tag. This implementation stores anActionData
object in the current context under the name specified by thevar
attribute. If the attribute is missing, an exception is thrown.- Specified by:
process
in classFormBaseTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is used incorrectlyFormBuilderException
- if an error occurs
-
getTask
public Object getTask()
Returns the task for the represented action. Tasks are not supported by this tag, so this method always returns null.- Returns:
- the task of this action
-
getActionBuilder
protected ActionBuilder getActionBuilder()
Returns a reference to the currentActionBuilder
instance. This instance is expected to be placed in the Jelly context.- Returns:
- the current action builder
-
getActionManager
protected ActionManager getActionManager()
Convenience method for obtaining a reference to the currentActionManager
.- Returns:
- the current action manager
-
-