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.HorizontalAlignmentConstantNested 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_RIGHTFields inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment
ALIGN_BOTTOM, ALIGN_MIDDLE, ALIGN_TOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCell()Returns theCellresponsible 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 theFieldUpdaterused for updating values in the column.Gets the horizontal alignment.abstract CReturns the column value from within the underlying data object.Gets the vertical alignment.booleanCheck if the default sort order of the column is ascending or descending.booleanCheck if the column is sortable.voidonBrowserEvent(Cell.Context context, Element elem, T object, NativeEvent event) Handle a browser event that took place within the column.voidrender(Cell.Context context, T object, SafeHtmlBuilder sb) Render the object into the cell.voidsetCellStyleNames(String styleNames) Set extra style names that should be applied to every cell.voidsetDataStoreName(String name) Sets a string that identifies this column in a data query.voidsetDefaultSortAscending(boolean isAscending) Set whether or not the default sort order is ascending.voidsetFieldUpdater(FieldUpdater<T, C> fieldUpdater) Set theFieldUpdaterused for updating values in the column.voidSets the horizontal alignment.voidsetSortable(boolean sortable) Set whether or not the column can be sorted.voidSets 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 theCellresponsible 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
nullif 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 theFieldUpdaterused for updating values in the column.- Specified by:
getFieldUpdaterin interfaceHasCell<T,C> - Returns:
- an instance of FieldUpdaterinvalid input: '<'T, C>
- See Also:
-
getHorizontalAlignment
Description copied from interface:HasHorizontalAlignmentGets the horizontal alignment.- Specified by:
getHorizontalAlignmentin 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:HasVerticalAlignmentGets the vertical alignment.- Specified by:
getVerticalAlignmentin 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, ornullif 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 theFieldUpdaterused for updating values in the column.- Parameters:
fieldUpdater- the field updater- See Also:
-
setHorizontalAlignment
Sets the horizontal alignment.Use
nullto 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:
setHorizontalAlignmentin 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:
setVerticalAlignmentin interfaceHasVerticalAlignment- Parameters:
align- the vertical alignment (HasVerticalAlignment.ALIGN_TOP,HasVerticalAlignment.ALIGN_MIDDLE, orHasVerticalAlignment.ALIGN_BOTTOM).
-