|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.jelly.TagSupport
net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
net.sf.jguiraffe.gui.builder.action.tags.ActionDataTag
net.sf.jguiraffe.gui.builder.action.tags.ActionControlTag
public abstract class ActionControlTag
Definition of an abstract base class for tag handler classes that create controls, which can be associated with actions.
This class provides basic functionality for defining an action aware control. Concrete sub classes will deal with specific controls like menu items or toolbar buttons.
This tag handler class supports two different ways of defining a control:
ActionDataTag.In addition of the attributes defined by the base class the following attributes are supported by this tag handler class:
| Attribute | Description | Optional |
|---|---|---|
| actionName | If this attribute is set, an action with this name will be looked up, and this control will be associated with this action. In this case the values of other attributes defining action related properties will be ignored because these properties are directly obtained from the specified action. | depends |
| checked | A boolean flag that determines whether the control to create should have checked semantics. This will be evaluated by concrete sub classes, which can then create specific control instances, e.g. checkbox menu items or toggle buttons. | yes |
| Field Summary |
|---|
| Fields inherited from class org.apache.commons.jelly.TagSupport |
|---|
body, context, hasTrimmed, parent, shouldTrim |
| Constructor Summary | |
|---|---|
ActionControlTag()
|
|
| Method Summary | |
|---|---|
protected abstract void |
createActionControl(ActionManager manager,
FormAction action,
java.lang.Object parent)
Creates a control and associates it with the given action. |
protected abstract ComponentHandler<?> |
createElementHandler(ActionManager manager,
ActionData data,
java.lang.Object parent)
Creates a control based on the given action data object. |
protected ActionBuilder |
getActionBuilder()
Returns a reference to the current ActionBuilder instance. |
protected ActionManager |
getActionManager()
Convenience method for obtaining a reference to the current ActionManager. |
java.lang.String |
getActionName()
Returns the name of the associated action. |
protected abstract java.lang.Class<?> |
getContainerClass()
Returns the class of the nesting container tag. |
java.lang.Object |
getTask()
Dummy implementation of this interface method. |
boolean |
isChecked()
Returns the value of the checked flag. |
protected void |
process()
Executes this tag. |
void |
setActionName(java.lang.String actionName)
Setter method for the actionName attribute. |
void |
setChecked(boolean checked)
Setter method for the checked attribute. |
| Methods inherited from class net.sf.jguiraffe.gui.builder.action.tags.ActionDataTag |
|---|
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, 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 |
| 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 |
|---|
public ActionControlTag()
| Method Detail |
|---|
public java.lang.String getActionName()
public void setActionName(java.lang.String actionName)
actionName - the attribute valuepublic boolean isChecked()
public void setChecked(boolean checked)
checked - the attribute value
protected void process()
throws org.apache.commons.jelly.JellyTagException,
FormBuilderException
createActionControl() or
createElementHandler() to create the concrete control.
process in class FormBaseTagorg.apache.commons.jelly.JellyTagException - if this tag is used in an invalid way
FormBuilderException - if an error occurspublic java.lang.Object getTask()
protected abstract java.lang.Class<?> getContainerClass()
process() method to find the tag handler class this
tag must be nested inside (e.g. a menu item tag must be placed in the
body of a menu tag). The class returned here must also implement the
ActionContainer interface.
protected abstract void createActionControl(ActionManager manager,
FormAction action,
java.lang.Object parent)
throws FormActionException
actionName attribute is defined. It must be
implemented in a concrete sub class to perform the necessary steps to
create the control based on the properties of the given action.
manager - the action manageraction - the action this control should be associated withparent - the parent container to which the new control should be
added
FormActionException - if an error occurs
protected abstract ComponentHandler<?> createElementHandler(ActionManager manager,
ActionData data,
java.lang.Object parent)
throws FormActionException
actionName attribute is not defined. A
concrete sub class must implement it to perform all necessary steps for
creating the control based on the given properties. The return value is a
component handler instance that will be stored in the current builder
data object. From there it can be accessed, e.g. for registering event
handlers.
manager - the action managerdata - the action data objectparent - the parent container to which the new control should be
added
FormActionException - if an error occursprotected ActionBuilder getActionBuilder()
ActionBuilder instance.
This instance is expected to be placed in the Jelly context.
protected ActionManager getActionManager()
ActionManager.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||