Class WTableColumn
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.AbstractContainer
-
- com.github.bordertech.wcomponents.WTableColumn
-
- All Implemented Interfaces:
Container
,WComponent
,WebComponent
,Serializable
public final class WTableColumn extends AbstractContainer
WTableColumn represents a column in aWDataTable
. It only holds configuration and state information relating to the UI, and does not know about the data model.- Since:
- 1.0.0
- Author:
- Yiannis Paschalidis
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WTableColumn.Alignment
An enumeration of possible values for horizontal alignment of table column content.static class
WTableColumn.WTableColumnModel
The component model that holds the column's state.-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
-
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 WTableColumn(WDecoratedLabel label, WComponent renderer)
Creates a WTableColumn.WTableColumn(WDecoratedLabel label, WComponent renderer, WComponent footerRender)
Creates a WTableColumn.WTableColumn(WDecoratedLabel label, Class<? extends WComponent> rendererClass)
Creates a WTableColumn.WTableColumn(WDecoratedLabel label, Class<? extends WComponent> rendererClass, WComponent footerRender)
Creates a WTableColumn.WTableColumn(String heading, WComponent renderer)
Creates a WTableColumn.WTableColumn(String heading, WComponent renderer, WComponent footerRender)
Creates a WTableColumn.WTableColumn(String heading, Class<? extends WComponent> rendererClass)
Creates a WTableColumn.WTableColumn(String heading, Class<? extends WComponent> rendererClass, WComponent footerRender)
Creates a WTableColumn.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WTableColumn.Alignment
getAlign()
Retrieves the column alignment.WDecoratedLabel
getColumnLabel()
protected WTableColumn.WTableColumnModel
getComponentModel()
Returns the effective component model for this component.WComponent
getFooterRender()
String
getHeadingText()
Returns the heading text for this column, in the case that the heading does not contain complex content.protected WTableColumn.WTableColumnModel
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.WComponent
getRenderer()
Class<? extends WComponent>
getRendererClass()
int
getWidth()
Retrieves the column width, if set.protected WTableColumn.WTableColumnModel
newComponentModel()
Creates a new Component model appropriate for this component.void
setAlign(WTableColumn.Alignment align)
Sets the column alignment.void
setWidth(int width)
Sets the column width.String
toString()
Creates a String representation of this component; usually for debugging purposes.-
Methods inherited from class com.github.bordertech.wcomponents.AbstractContainer
getChildAt, getChildCount, getChildren, getIndexOfChild
-
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, handleRequest, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, paintComponent, preparePaint, preparePaintComponent, 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, showErrorIndicatorsForComponent, showWarningIndicators, showWarningIndicatorsForComponent, tidyUpUIContext, tidyUpUIContextForTree, validate, validateComponent, 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.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
-
-
-
-
Constructor Detail
-
WTableColumn
public WTableColumn(String heading, Class<? extends WComponent> rendererClass)
Creates a WTableColumn.- Parameters:
heading
- the column heading text.rendererClass
- the renderer class for rendering row data.
-
WTableColumn
public WTableColumn(WDecoratedLabel label, Class<? extends WComponent> rendererClass)
Creates a WTableColumn.- Parameters:
label
- the column heading.rendererClass
- the renderer class for rendering row data.
-
WTableColumn
public WTableColumn(String heading, WComponent renderer)
Creates a WTableColumn.- Parameters:
heading
- the column heading text.renderer
- the component for rendering row data.
-
WTableColumn
public WTableColumn(WDecoratedLabel label, WComponent renderer)
Creates a WTableColumn.- Parameters:
label
- the column heading.renderer
- the component for rendering row data.
-
WTableColumn
public WTableColumn(String heading, Class<? extends WComponent> rendererClass, WComponent footerRender)
Creates a WTableColumn.- Parameters:
heading
- the column heading text.rendererClass
- the renderer class for rendering row data.footerRender
- the footer renderer or null for no footer
-
WTableColumn
public WTableColumn(WDecoratedLabel label, Class<? extends WComponent> rendererClass, WComponent footerRender)
Creates a WTableColumn.- Parameters:
label
- the column heading.rendererClass
- the renderer class for rendering row data.footerRender
- the footer renderer or null for no footer
-
WTableColumn
public WTableColumn(String heading, WComponent renderer, WComponent footerRender)
Creates a WTableColumn.- Parameters:
heading
- the column heading text.renderer
- the component for rendering row data.footerRender
- the footer renderer or null for no footer
-
WTableColumn
public WTableColumn(WDecoratedLabel label, WComponent renderer, WComponent footerRender)
Creates a WTableColumn.- Parameters:
label
- the column heading.renderer
- the component for rendering row data.footerRender
- the footer renderer or null for no footer
-
-
Method Detail
-
getRendererClass
public Class<? extends WComponent> getRendererClass()
- Returns:
- the renderer class that will be used to render row data for this column.
-
getRenderer
public WComponent getRenderer()
- Returns:
- the renderer that will be used to render row data for this column.
-
getFooterRender
public WComponent getFooterRender()
- Returns:
- the footer renderer or null
-
getHeadingText
public String getHeadingText()
Returns the heading text for this column, in the case that the heading does not contain complex content.- Returns:
- the heading text, if available, otherwise null.
- See Also:
WDecoratedLabel.getText()
-
getWidth
public int getWidth()
Retrieves the column width, if set.- Returns:
- the column width
-
setWidth
public void setWidth(int width)
Sets the column width.- Parameters:
width
- the column width as a percentage, or <= 0 for default width.
-
getAlign
public WTableColumn.Alignment getAlign()
Retrieves the column alignment.- Returns:
- the column alignment
-
setAlign
public void setAlign(WTableColumn.Alignment align)
Sets the column alignment.- Parameters:
align
- the column alignment.
-
getColumnLabel
public WDecoratedLabel getColumnLabel()
- Returns:
- the label for this column
-
toString
public String toString()
Description copied from class:AbstractWComponent
Creates a String representation of this component; usually for debugging purposes.- Overrides:
toString
in classAbstractWComponent
- Returns:
- a String representation of this component, for debugging purposes.
-
newComponentModel
protected WTableColumn.WTableColumnModel newComponentModel()
Creates a new Component model appropriate for this component.- Overrides:
newComponentModel
in classAbstractWComponent
- Returns:
- a new WTableColumnModel.
-
getOrCreateComponentModel
protected WTableColumn.WTableColumnModel 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 classAbstractWComponent
- Returns:
- the model for this component
-
getComponentModel
protected WTableColumn.WTableColumnModel 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 classAbstractWComponent
- Returns:
- the effective component model
-
-