Class ToolButtonTag
- 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.ActionControlTag
-
- net.sf.jguiraffe.gui.builder.action.tags.ToolButtonTag
-
- All Implemented Interfaces:
ActionData
,ConditionalTag
,IconSupport
,org.apache.commons.jelly.Tag
public class ToolButtonTag extends ActionControlTag
A specific tag handler class for creating toolbar buttons.
Tags represented by this class can appear in the body of a
<toolbar>
tag. They define a button to be added to the enclosing toolbar. A button can either be directly defined using attributes liketext
orresgrp
that are inherited from the base class. Alternatively a button can be associated with an action object; then theactionName
attribute must be provided.This tag does not define any attributes in addition to the ones inherited from its super classes.
- Version:
- $Id: ToolButtonTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description ToolButtonTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createActionControl(ActionManager manager, FormAction action, Object parent)
Creates a toolbar button that is associated with an action.protected ComponentHandler<?>
createElementHandler(ActionManager manager, ActionData data, Object parent)
Creates a toolbar button based on the given data object.protected ActionBuilder
getActionBuilder()
Returns a reference to the currentActionBuilder
instance.protected ActionManager
getActionManager()
Convenience method for obtaining a reference to the currentActionManager
.protected Class<?>
getContainerClass()
Returns the class of the container tag this tag must be nested inside.-
Methods inherited from class net.sf.jguiraffe.gui.builder.action.tags.ActionControlTag
getActionName, getTask, isChecked, process, setActionName, setChecked
-
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
-
getContainerClass
protected Class<?> getContainerClass()
Returns the class of the container tag this tag must be nested inside. This is a toolbar tag.- Specified by:
getContainerClass
in classActionControlTag
- Returns:
- the class of the nesting container
-
createActionControl
protected void createActionControl(ActionManager manager, FormAction action, Object parent) throws FormActionException
Creates a toolbar button that is associated with an action.- Specified by:
createActionControl
in classActionControlTag
- Parameters:
manager
- the action manageraction
- the actionparent
- the container component- Throws:
FormActionException
- if an error occurs
-
createElementHandler
protected ComponentHandler<?> createElementHandler(ActionManager manager, ActionData data, Object parent) throws FormActionException
Creates a toolbar button based on the given data object.- Specified by:
createElementHandler
in classActionControlTag
- Parameters:
manager
- the action managerdata
- the action data objectparent
- the parent container component- Returns:
- the component handler for the tool bar button
- Throws:
FormActionException
- if an error occurs
-
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
-
-