org.zkoss.zul
Class Radiogroup

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Radiogroup
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HtmlBasedComponent, Component, Scope, ComponentCtrl, Radiogroup, XulElement

public class Radiogroup
extends XulElement
implements Radiogroup

A radio group.

Note: To support the versatile layout, a radio group accepts any kind of children, including Radio. On the other hand, the parent of a radio, if any, must be a radio group.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
HtmlBasedComponent.ExtraCtrl
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_height, _left, _top, _width, _zclass
 
Fields inherited from class org.zkoss.zk.ui.AbstractComponent
_visible
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
Constructor Summary
Radiogroup()
           
 
Method Summary
 Radio appendItem(java.lang.String label, java.lang.String value)
          Appends a radio button.
 Radio appendItemApi(java.lang.String label, java.lang.String value)
          Appends a radio button.
 java.lang.Object clone()
          Clones the component.
 Radio getItemAtIndex(int index)
          Returns the radio button at the specified index.
 Radio getItemAtIndexApi(int index)
          Returns the radio button at the specified index.
 int getItemCount()
          Returns the number of radio buttons in this group.
 java.lang.String getName()
          Returns the name of this group of radio buttons.
 java.lang.String getOrient()
          Returns the orient.
 int getSelectedIndex()
          Returns the index of the selected radio button (-1 if no one is selected).
 Radio getSelectedItem()
          Returns the selected radio button.
 Radio getSelectedItemApi()
          Returns the selected radio button.
 Radio removeItemAt(int index)
          Removes the child radio button in the list box at the given index.
 Radio removeItemAtApi(int index)
          Removes the child radio button in the list box at the given index.
protected  void renderProperties(ContentRenderer renderer)
          Renders the content of this component, excluding the enclosing tags and children.
 void setName(java.lang.String name)
          Sets the name of this group of radio buttons.
 void setOrient(java.lang.String orient)
          Sets the orient.
 void setSelectedIndex(int jsel)
          Deselects all of the currently selected radio button and selects the radio button with the given index.
 void setSelectedItem(Radio item)
          Deselects all of the currently selected radio buttons and selects the given radio button.
 void setSelectedItemApi(Radio itemApi)
          Deselects all of the currently selected radio buttons and selects the given radio button.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getDraggable, getDroppable, getHeight, getHflex, getLeft, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, newExtraCtrl, service, setClass, setDraggable, setDroppable, setFocus, setHeight, setHflex, setLeft, setSclass, setStyle, setTooltiptext, setTop, setVflex, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, containsVariable, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getClientEvents, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, newChildren, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, unsetVariable, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Constructor Detail

Radiogroup

public Radiogroup()
Method Detail

getOrient

public java.lang.String getOrient()
Returns the orient.

Default: "horizontal".

Specified by:
getOrient in interface Radiogroup

setOrient

public void setOrient(java.lang.String orient)
               throws WrongValueException
Sets the orient.

Specified by:
setOrient in interface Radiogroup
Parameters:
orient - either "horizontal" or "vertical".
Throws:
WrongValueException

getItemAtIndex

public Radio getItemAtIndex(int index)
Returns the radio button at the specified index.


getItemAtIndexApi

public Radio getItemAtIndexApi(int index)
Returns the radio button at the specified index.

Specified by:
getItemAtIndexApi in interface Radiogroup
Since:
3.5.2

getItemCount

public int getItemCount()
Returns the number of radio buttons in this group.

Specified by:
getItemCount in interface Radiogroup

getSelectedIndex

public int getSelectedIndex()
Returns the index of the selected radio button (-1 if no one is selected).

Specified by:
getSelectedIndex in interface Radiogroup

setSelectedIndex

public void setSelectedIndex(int jsel)
Deselects all of the currently selected radio button and selects the radio button with the given index.

Specified by:
setSelectedIndex in interface Radiogroup

getSelectedItem

public Radio getSelectedItem()
Returns the selected radio button.


getSelectedItemApi

public Radio getSelectedItemApi()
Returns the selected radio button.

Specified by:
getSelectedItemApi in interface Radiogroup
Since:
3.5.2

setSelectedItem

public void setSelectedItem(Radio item)
Deselects all of the currently selected radio buttons and selects the given radio button.


setSelectedItemApi

public void setSelectedItemApi(Radio itemApi)
Deselects all of the currently selected radio buttons and selects the given radio button.

Specified by:
setSelectedItemApi in interface Radiogroup
Parameters:
itemApi - assume as a Radio
Since:
3.5.2

appendItem

public Radio appendItem(java.lang.String label,
                        java.lang.String value)
Appends a radio button.


appendItemApi

public Radio appendItemApi(java.lang.String label,
                           java.lang.String value)
Appends a radio button.

Specified by:
appendItemApi in interface Radiogroup
Since:
3.5.2

removeItemAt

public Radio removeItemAt(int index)
Removes the child radio button in the list box at the given index.

Returns:
the removed radio button.

removeItemAtApi

public Radio removeItemAtApi(int index)
Removes the child radio button in the list box at the given index.

Specified by:
removeItemAtApi in interface Radiogroup
Returns:
the removed radio button.
Since:
3.5.2

getName

public java.lang.String getName()
Returns the name of this group of radio buttons. All child radio buttons shared the same name (Radio.getName()).

Default: automatically generated an unique name

Don't use this method if your application is purely based on ZK's event-driven model.

Specified by:
getName in interface Radiogroup

setName

public void setName(java.lang.String name)
Sets the name of this group of radio buttons. All child radio buttons shared the same name (Radio.getName()).

Don't use this method if your application is purely based on ZK's event-driven model.

Specified by:
setName in interface Radiogroup

renderProperties

protected void renderProperties(ContentRenderer renderer)
                         throws java.io.IOException
Description copied from class: HtmlBasedComponent
Renders the content of this component, excluding the enclosing tags and children.

See also Render Special Properties

Overrides:
renderProperties in class XulElement
Throws:
java.io.IOException

clone

public java.lang.Object clone()
Description copied from interface: Component
Clones the component. All of its children is cloned. Notice that the cloned component doesn't belong to any page, nor desktop. It doesn't have parent, either.

Specified by:
clone in interface Component
Overrides:
clone in class AbstractComponent


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo