Class Column<T,C>
java.lang.Object
com.google.gwt.user.cellview.client.Column<T,C>
- Type Parameters:
T
- the row typeC
- the column type
- All Implemented Interfaces:
HasCell<T,
,C> HasAlignment
,HasHorizontalAlignment
,HasVerticalAlignment
- Direct Known Subclasses:
IdentityColumn
,TextColumn
A representation of a column in a table.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment
HasVerticalAlignment.VerticalAlignmentConstant
-
Field Summary
Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT
Fields inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment
ALIGN_BOTTOM, ALIGN_MIDDLE, ALIGN_TOP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCell()
Returns theCell
responsible for rendering items in the column.getCellStyleNames
(Cell.Context context, T object) Get extra style names that should be applied to a cell in this column.Returns theFieldUpdater
used for updating values in the column.Gets the horizontal alignment.abstract C
Returns the column value from within the underlying data object.Gets the vertical alignment.boolean
Check if the default sort order of the column is ascending or descending.boolean
Check if the column is sortable.void
onBrowserEvent
(Cell.Context context, Element elem, T object, NativeEvent event) Handle a browser event that took place within the column.void
render
(Cell.Context context, T object, SafeHtmlBuilder sb) Render the object into the cell.void
setCellStyleNames
(String styleNames) Set extra style names that should be applied to every cell.void
setDataStoreName
(String name) Sets a string that identifies this column in a data query.void
setDefaultSortAscending
(boolean isAscending) Set whether or not the default sort order is ascending.void
setFieldUpdater
(FieldUpdater<T, C> fieldUpdater) Set theFieldUpdater
used for updating values in the column.void
Sets the horizontal alignment.void
setSortable
(boolean sortable) Set whether or not the column can be sorted.void
Sets the vertical alignment.
-
Constructor Details
-
Column
Construct a new Column with a givenCell
.- Parameters:
cell
- the Cell used by this Column
-
-
Method Details
-
getCell
Returns theCell
responsible for rendering items in the column. -
getCellStyleNames
Get extra style names that should be applied to a cell in this column.- Parameters:
context
- the cell contextobject
- the base object to be updated, or null if the row is empty- Returns:
- the extra styles of the given row in a space-separated list, or
null
if there are no extra styles for the cells in this column
-
getDataStoreName
- Returns:
- the database name of the column, or null if it's never been set
-
getFieldUpdater
Returns theFieldUpdater
used for updating values in the column.- Specified by:
getFieldUpdater
in interfaceHasCell<T,
C> - Returns:
- an instance of FieldUpdaterinvalid input: '<'T, C>
- See Also:
-
getHorizontalAlignment
Description copied from interface:HasHorizontalAlignment
Gets the horizontal alignment.- Specified by:
getHorizontalAlignment
in interfaceHasHorizontalAlignment
- Returns:
- the current horizontal alignment (
HasHorizontalAlignment.ALIGN_LEFT
,HasHorizontalAlignment.ALIGN_CENTER
,HasHorizontalAlignment.ALIGN_RIGHT
,HasHorizontalAlignment.ALIGN_JUSTIFY
, or null).
-
getValue
Returns the column value from within the underlying data object. -
getVerticalAlignment
Description copied from interface:HasVerticalAlignment
Gets the vertical alignment.- Specified by:
getVerticalAlignment
in interfaceHasVerticalAlignment
- Returns:
- the current vertical alignment.
-
isDefaultSortAscending
public boolean isDefaultSortAscending()Check if the default sort order of the column is ascending or descending.- Returns:
- true if default sort is ascending, false if not
-
isSortable
public boolean isSortable()Check if the column is sortable.- Returns:
- true if sortable, false if not
-
onBrowserEvent
Handle a browser event that took place within the column.- Parameters:
context
- the cell contextelem
- the parent Elementobject
- the base object to be updatedevent
- the native browser event
-
setCellStyleNames
Set extra style names that should be applied to every cell.If you want to apply style names based on the row or cell value, override
getCellStyleNames(Context, Object)
directly.- Parameters:
styleNames
- the extra style names to apply in a space-separated list, ornull
if there are no extra styles for this cell
-
setDataStoreName
Sets a string that identifies this column in a data query.- Parameters:
name
- name of the column from the data store's perspective
-
setDefaultSortAscending
public void setDefaultSortAscending(boolean isAscending) Set whether or not the default sort order is ascending.- Parameters:
isAscending
- true to set the default order to ascending, false for descending
-
setFieldUpdater
Set theFieldUpdater
used for updating values in the column.- Parameters:
fieldUpdater
- the field updater- See Also:
-
setHorizontalAlignment
Sets the horizontal alignment.Use
null
to clear horizontal alignment, allowing it to be determined by the standard HTML mechanisms such as inheritance and CSS rules.The new horizontal alignment will apply the next time the table is rendered.
- Specified by:
setHorizontalAlignment
in interfaceHasHorizontalAlignment
- Parameters:
align
- the horizontal alignment (HasHorizontalAlignment.ALIGN_LEFT
,HasHorizontalAlignment.ALIGN_CENTER
,HasHorizontalAlignment.ALIGN_RIGHT
,HasHorizontalAlignment.ALIGN_JUSTIFY
,HasHorizontalAlignment.ALIGN_LOCALE_START
, orHasHorizontalAlignment.ALIGN_LOCALE_END
).
-
setSortable
public void setSortable(boolean sortable) Set whether or not the column can be sorted. The change will take effect the next time the table is redrawn.- Parameters:
sortable
- true to make sortable, false to make unsortable
-
setVerticalAlignment
Sets the vertical alignment.The new vertical alignment will apply the next time the table is rendered.
- Specified by:
setVerticalAlignment
in interfaceHasVerticalAlignment
- Parameters:
align
- the vertical alignment (HasVerticalAlignment.ALIGN_TOP
,HasVerticalAlignment.ALIGN_MIDDLE
, orHasVerticalAlignment.ALIGN_BOTTOM
).
-