Class WCheckBoxSelect
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.WBeanComponent
-
- com.github.bordertech.wcomponents.AbstractInput
-
- com.github.bordertech.wcomponents.AbstractWSelectList
-
- com.github.bordertech.wcomponents.AbstractWMultiSelectList
-
- com.github.bordertech.wcomponents.WCheckBoxSelect
-
- All Implemented Interfaces:
AjaxTarget
,AjaxTrigger
,BeanAware
,BeanBound
,BeanProviderBound
,DataBound
,Diagnosable
,Disableable
,Input
,Labelable
,Mandatable
,MultiInputComponent
,SelectionToggleable
,SubordinateTarget
,SubordinateTrigger
,WComponent
,WebComponent
,Serializable
public class WCheckBoxSelect extends AbstractWMultiSelectList implements AjaxTrigger, AjaxTarget, SubordinateTrigger, SubordinateTarget, MultiInputComponent, SelectionToggleable
WCheckBoxSelect is a convenience class which presents a group of check boxes for the user to select one or more options from. Unlike
WCheckBox
, the check boxes inside a WCheckBoxSelect will automatically have text labels associated with them. The visual arrangement of the check boxes can be configured using thesetButtonLayout(Layout)
method.- Since:
- 1.0.0
- Author:
- Yiannis Paschalidis, Jonathan Austin
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WCheckBoxSelect.CheckBoxSelectModel
Holds the extrinsic state information of the component.static class
WCheckBoxSelect.Layout
An enumeration of button layouts.-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWMultiSelectList
AbstractWMultiSelectList.MultiSelectionModel
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWSelectList
AbstractWSelectList.SelectionModel
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractInput
AbstractInput.InputModel
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
Fields Modifier and Type Field Description static WCheckBoxSelect.Layout
LAYOUT_COLUMNS
A layout where buttons are placed in columns.static WCheckBoxSelect.Layout
LAYOUT_FLAT
A layout where buttons are placed horizontally.static WCheckBoxSelect.Layout
LAYOUT_STACKED
A layout where buttons are placed vertically.-
Fields inherited from class com.github.bordertech.wcomponents.AbstractWMultiSelectList
EMPTY, NO_SELECTION
-
Fields inherited from interface com.github.bordertech.wcomponents.WComponent
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
-
-
Constructor Summary
Constructors Constructor Description WCheckBoxSelect()
Creates an empty WCheckBoxSelect.WCheckBoxSelect(Object table)
Creates a WCheckBoxSelect with the options provided by the given table.WCheckBoxSelect(Object[] options)
Creates a WCheckBoxSelect with the specified options.WCheckBoxSelect(List options)
Creates a WCheckBoxSelect with the specified options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getButtonColumns()
WCheckBoxSelect.Layout
getButtonLayout()
protected WCheckBoxSelect.CheckBoxSelectModel
getComponentModel()
Returns the effective component model for this component.protected WCheckBoxSelect.CheckBoxSelectModel
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.boolean
isFrameless()
protected WCheckBoxSelect.CheckBoxSelectModel
newComponentModel()
Creates a new Component model.void
setButtonColumns(int numColumns)
Sets the layout to be a certain number of columns.void
setButtonLayout(WCheckBoxSelect.Layout layout)
Sets the layout.void
setFrameless(boolean frameless)
void
toggleSelection(boolean selected)
Sets the selections for this component.-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWMultiSelectList
doHandleInvalidOption, doHandleRequest, getData, getMaxSelect, getMinSelect, getNewSelections, getNotSelected, getRequestValue, getSelected, getSelectedOptionsAsArray, getValue, getValueAsString, isEmpty, preparePaintComponent, setData, setMaxSelect, setMinSelect, setSelected, setSelected, validateComponent
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWSelectList
getAjaxTarget, getCode, getDesc, getDescEncode, getListCacheKey, getLookupTable, getOptionIndex, getOptions, isAjax, isAllowNoSelection, isEditable, isPresent, isSelectionOrderable, isSubmitOnChange, optionToCode, optionToCode, optionToString, setAjaxTarget, setDescEncode, setEditable, setLookupTable, setOptions, setOptions, setSubmitOnChange
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractInput
addValidator, beforeHandleRequest, createMandatoryDiagnostic, doHandleChanged, getActionCommand, getActionObject, getActionOnChange, getDefaultSubmitButton, getDiagnostics, getValidators, handleRequest, isChangedInLastRequest, isCurrentAjaxTrigger, isDisabled, isMandatory, isReadOnly, setActionObject, setActionOnChange, setChangedInLastRequest, setDefaultSubmitButton, setDisabled, setMandatory, setMandatory, setReadOnly, showErrorIndicatorsForComponent, showIndicatorsForComponent, showWarningIndicatorsForComponent, toString
-
Methods inherited from class com.github.bordertech.wcomponents.WBeanComponent
addBeanToScratchMap, doUpdateBeanValue, getBean, getBeanFromScratchMap, getBeanId, getBeanProperty, getBeanProvider, getBeanScratchMap, getBeanValue, isBeanInScratchMap, isChanged, isSearchAncestors, isUseRequestScopeScratchMap, removeBeanFromScratchMap, resetData, setBean, setBeanId, setBeanProperty, setBeanProvider, setSearchAncestors, updateBeanValue
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWComponent
addHtmlClass, addHtmlClass, addNotify, afterPaint, assertAddSupported, beforePaint, createErrorDiagnostic, createErrorDiagnostic, forward, getAccessibleText, getAttribute, getBaseUrl, getDefaultModel, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, paintComponent, preparePaint, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContext, tidyUpUIContextForTree, validate, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.bordertech.wcomponents.BeanAware
getBean, getBeanProperty, getBeanValue, setBeanProperty
-
Methods inherited from interface com.github.bordertech.wcomponents.BeanBound
isSearchAncestors, setBean
-
Methods inherited from interface com.github.bordertech.wcomponents.BeanProviderBound
getBeanId, setBeanId, setBeanProvider
-
Methods inherited from interface com.github.bordertech.wcomponents.WComponent
addHtmlClass, addHtmlClass, forward, getAccessibleText, getAttribute, getBaseUrl, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, handleRequest, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContextForTree, validate
-
-
-
-
Field Detail
-
LAYOUT_FLAT
public static final WCheckBoxSelect.Layout LAYOUT_FLAT
A layout where buttons are placed horizontally. Convenience constant forWCheckBoxSelect.Layout.FLAT
.
-
LAYOUT_STACKED
public static final WCheckBoxSelect.Layout LAYOUT_STACKED
A layout where buttons are placed vertically. Convenience constant forWCheckBoxSelect.Layout.STACKED
.
-
LAYOUT_COLUMNS
public static final WCheckBoxSelect.Layout LAYOUT_COLUMNS
A layout where buttons are placed in columns. Convenience constant forWCheckBoxSelect.Layout.COLUMNS
.
-
-
Constructor Detail
-
WCheckBoxSelect
public WCheckBoxSelect()
Creates an empty WCheckBoxSelect.
-
WCheckBoxSelect
public WCheckBoxSelect(Object[] options)
Creates a WCheckBoxSelect with the specified options.- Parameters:
options
- the check box options.
-
WCheckBoxSelect
public WCheckBoxSelect(List options)
Creates a WCheckBoxSelect with the specified options.- Parameters:
options
- the check box options.
-
WCheckBoxSelect
public WCheckBoxSelect(Object table)
Creates a WCheckBoxSelect with the options provided by the given table.- Parameters:
table
- the table to obtain the options from.
-
-
Method Detail
-
setButtonLayout
public void setButtonLayout(WCheckBoxSelect.Layout layout)
Sets the layout.- Parameters:
layout
- the layout.
-
setButtonColumns
public void setButtonColumns(int numColumns)
Sets the layout to be a certain number of columns.- Parameters:
numColumns
- the number of columns.
-
getButtonColumns
public int getButtonColumns()
- Returns:
- the number of columns for layout. Only applies to LAYOUT_COLUMNS layout.
-
getButtonLayout
public WCheckBoxSelect.Layout getButtonLayout()
- Returns:
- the layout;
-
isFrameless
public boolean isFrameless()
- Returns:
- true if the frame should not be rendererd.
-
setFrameless
public void setFrameless(boolean frameless)
- Parameters:
frameless
- if true, the frame will not be rendered.
-
toggleSelection
public void toggleSelection(boolean selected)
Description copied from interface:SelectionToggleable
Sets the selections for this component.- Specified by:
toggleSelection
in interfaceSelectionToggleable
- Parameters:
selected
- if true, select everything. If false, deselect everything.
-
newComponentModel
protected WCheckBoxSelect.CheckBoxSelectModel newComponentModel()
Creates a new Component model.- Overrides:
newComponentModel
in classAbstractWMultiSelectList
- Returns:
- a new CheckBoxSelectModel.
-
getComponentModel
protected WCheckBoxSelect.CheckBoxSelectModel getComponentModel()
Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.- Overrides:
getComponentModel
in classAbstractWMultiSelectList
- Returns:
- the effective component model
-
getOrCreateComponentModel
protected WCheckBoxSelect.CheckBoxSelectModel getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.- Overrides:
getOrCreateComponentModel
in classAbstractWMultiSelectList
- Returns:
- the model for this component
-
-