|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cocoon.forms.formmodel.AbstractWidget
org.apache.cocoon.forms.formmodel.ImageMap
public class ImageMap
A server-side map widget. An ImageMap widget can cause a ImageMapEvent to be triggered
on the server side, which will be handled by either the event handlers defined in the
form definition, and/or by the FormHandler
registered with the form, if any. An ImageMap widget is basically an Action widget
displayed as an image and with mouse coordinates stored upon clicking.
The image's URI can be set or get, or bind via the binding framework, mouse coordinates
can be either retrieved from the ImageMapEvent triggered or from the widget itself.
| Field Summary | |
|---|---|
static String |
COMMAND_AT
|
static String |
IMAGEMAP_EL
|
static String |
ONACTION_EL
|
static String |
VALUE_EL
|
| Fields inherited from class org.apache.cocoon.forms.formmodel.AbstractWidget |
|---|
wasValid |
| Fields inherited from interface org.apache.cocoon.forms.formmodel.Widget |
|---|
PATH_SEPARATOR |
| Constructor Summary | |
|---|---|
ImageMap(ImageMapDefinition definition)
|
|
| Method Summary | |
|---|---|
void |
addActionListener(ActionListener listener)
Adds an ActionListener to this widget instance. |
void |
broadcastEvent(WidgetEvent event)
Broadcast an event previously queued by this widget to its event listeners. |
WidgetDefinition |
getDefinition()
Concrete subclasses should allow access to their underlaying Definition through this method. |
String |
getImageURI()
|
Object |
getValue()
Get the value of a widget. |
int |
getX()
|
AttributesImpl |
getXMLElementAttributes()
Adds the @imageuri attribute to the XML element |
String |
getXMLElementName()
The XML element name used in AbstractWidget.generateSaxFragment(ContentHandler, Locale)
to produce the wrapping element for all the XML-instance-content of this Widget. |
int |
getY()
|
protected void |
handleActivate()
Handle the fact that this action was activated. |
void |
readFromRequest(FormContext formContext)
Lets this widget read its data from a request. |
void |
removeActionListener(ActionListener listener)
|
void |
setImageURI(String newImgURI)
|
void |
setValue(Object newImgURI)
Sets the value of this widget. |
boolean |
validate()
Always return true (an action has no validation) |
| Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractWidget |
|---|
addValidator, generateDisplayData, generateItemSaxFragment, generateLabel, generateSaxFragment, getAttribute, getChild, getCombinedState, getForm, getFullName, getId, getLocation, getName, getParent, getRequestParameterName, getState, getWidget, initialize, isRequired, isValid, lookupWidget, removeAttribute, removeValidator, setAttribute, setParent, setState, toString, widgetNameChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String COMMAND_AT
public static final String VALUE_EL
public static final String ONACTION_EL
public static final String IMAGEMAP_EL
| Constructor Detail |
|---|
public ImageMap(ImageMapDefinition definition)
| Method Detail |
|---|
public WidgetDefinition getDefinition()
AbstractWidgetnull they should also organize
own implementations of AbstractWidget.getId(), AbstractWidget.getLocation(),
AbstractWidget.validate(), AbstractWidget.generateLabel(ContentHandler) and
AbstractWidget.generateDisplayData(ContentHandler) to avoid NPE's.
getDefinition in interface WidgetgetDefinition in class AbstractWidgetWidgetDefinition.createInstance())public int getX()
public int getY()
public String getImageURI()
public void setImageURI(String newImgURI)
public void setValue(Object newImgURI)
Widget
Not all widgets do have a value (notably ContainerWidgets,
but this method is provided here as a convenience to ease writing and avoiding casts.
setValue in interface WidgetsetValue in class AbstractWidgetnewImgURI - the new widget's value.public Object getValue()
Widget
Not all widgets do have a value (notably ContainerWidgets,
but this method is provided here as a convenience to ease writing and avoiding casts.
getValue in interface WidgetgetValue in class AbstractWidgetpublic void readFromRequest(FormContext formContext)
Widget
readFromRequest in interface Widgetpublic AttributesImpl getXMLElementAttributes()
getXMLElementAttributes in class AbstractWidgetprotected void handleActivate()
public boolean validate()
true (an action has no validation)
validate in interface Widgetvalidate in class AbstractWidgettrue to indicate all validations were ok,
false otherwiseWidget.validate()public String getXMLElementName()
AbstractWidgetAbstractWidget.generateSaxFragment(ContentHandler, Locale)
to produce the wrapping element for all the XML-instance-content of this Widget.
getXMLElementName in class AbstractWidgetpublic void addActionListener(ActionListener listener)
addActionListener in interface ActionListenerEnabledpublic void removeActionListener(ActionListener listener)
removeActionListener in interface ActionListenerEnabledpublic void broadcastEvent(WidgetEvent event)
AbstractWidgetUnsupportedOperationException.
Concrete subclass widgets need to override when supporting event broadcasting.
broadcastEvent in interface WidgetbroadcastEvent in class AbstractWidget
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||