Package org.eclipse.jface.viewers
Class ViewerRow
java.lang.Object
org.eclipse.jface.viewers.ViewerRow
- All Implemented Interfaces:
- Cloneable
- Direct Known Subclasses:
- TableViewerRow,- TreeViewerRow
ViewerRow is the abstract superclass of the part that represents items in a
 Table or Tree. Implementors of 
ColumnViewer have to provide a
 concrete implementation for the underlying widget- Since:
- 3.3
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract Objectclone()booleanabstract ColorgetBackground(int columnIndex) Get the background at the columnIndex,abstract RectangleReturn the bounds for the whole item.abstract RectanglegetBounds(int columnIndex) Get the bounds of the entry at the columnIndex,getCell(int column) Get a ViewerCell for the column at index.Get the ViewerCell at point.abstract intReturn the number of columns for the receiver.intgetColumnIndex(Point point) Get the columnIndex of the point.abstract ControlGet the Control for the receiver.protected intgetCreationIndex(int visualIndex) Translate the current column index (as shown in the UI) to the original one.abstract Objectabstract FontgetFont(int columnIndex) Get the font at the columnIndex.abstract ColorgetForeground(int columnIndex) Get the foreground at the columnIndex.abstract ImagegetImage(int columnIndex) Return the image at the columnIndex.getImageBounds(int index) Returns the location and bounds of the area where the image is drawn.abstract WidgetgetItem()Return the item for the receiver.abstract ViewerRowgetNeighbor(int direction, boolean sameLevel) Returns a neighboring row, ornullif no neighbor exists in the given direction.getStyleRanges(int columnIndex) Returns the style ranges to be applied on the text label at the column index ornullif no style ranges have been set.abstract StringgetText(int columnIndex) Get the text at the columnIndex.getTextBounds(int index) The location and bounds of the area where the text is drawn depends on various things (image displayed, control with SWT.CHECK)abstract TreePathThe tree path used to identify an element by the unique pathprotected intgetVisualIndex(int creationIndex) Translate the original column index to the actual one.inthashCode()protected booleanisColumnVisible(int columnIndex) Returnstrueif the column with the given index is visibleprotected booleanscrollCellIntoView(int columnIndex) Scrolls the cell at this index into viewabstract voidsetBackground(int columnIndex, Color color) Set the background at the columnIndex.abstract voidSet theFontat the columnIndex.abstract voidsetForeground(int columnIndex, Color color) Set the foreground at the columnIndex.abstract voidSet the image at the columnIndexvoidsetStyleRanges(int columnIndex, StyleRange[] styleRanges) Set the style ranges to be applied on the text label at the column index Note: RequiresStyledCellLabelProviderwith owner draw enabled.abstract voidSet the text at the columnIndex
- 
Field Details- 
ABOVEpublic static final int ABOVEConstant denoting the row above the current one (value is 1).
- 
BELOWpublic static final int BELOWConstant denoting the row below the current one (value is 2).
 
- 
- 
Constructor Details- 
ViewerRowpublic ViewerRow()
 
- 
- 
Method Details- 
getBoundsGet the bounds of the entry at the columnIndex,- Parameters:
- columnIndex- column index of interest
- Returns:
- Rectangle
 
- 
getBoundsReturn the bounds for the whole item.- Returns:
- Rectangle
 
- 
getItemReturn the item for the receiver.- Returns:
- Widget
 
- 
getColumnCountpublic abstract int getColumnCount()Return the number of columns for the receiver.- Returns:
- the number of columns
 
- 
getImageReturn the image at the columnIndex.- Parameters:
- columnIndex- column index of interest
- Returns:
- Imageor- null
 
- 
setImageSet the image at the columnIndex- Parameters:
- columnIndex- column index to set image for
- image- image to set
 
- 
getTextGet the text at the columnIndex.- Parameters:
- columnIndex- column index of interest
- Returns:
- String
 
- 
setTextSet the text at the columnIndex- Parameters:
- columnIndex- column index to set text for
- text- text to set
 
- 
getBackgroundGet the background at the columnIndex,- Parameters:
- columnIndex- column index of interest
- Returns:
- Coloror- null
 
- 
setBackgroundSet the background at the columnIndex.- Parameters:
- columnIndex- column index to set color for
- color- color to set
 
- 
getForegroundGet the foreground at the columnIndex.- Parameters:
- columnIndex- column index of interest
- Returns:
- Coloror- null
 
- 
setForegroundSet the foreground at the columnIndex.- Parameters:
- columnIndex- column index to set color for
- color- color to set
 
- 
getFontGet the font at the columnIndex.- Parameters:
- columnIndex- column index of interest
- Returns:
- Fontor- null
 
- 
setFontSet theFontat the columnIndex.- Parameters:
- columnIndex- column index to set font for
- font- font to set
 
- 
getCellGet the ViewerCell at point.- Parameters:
- point- position to get cell for
- Returns:
- ViewerCellor- nullif the point is not in the bounds of a cell
 
- 
getColumnIndexGet the columnIndex of the point.- Parameters:
- point- position to get column index for
- Returns:
- int or -1 if it cannot be found.
 
- 
getCellGet a ViewerCell for the column at index.- Parameters:
- column- column index of interest
- Returns:
- ViewerCellor- nullif the index is negative.
 
- 
getControlGet the Control for the receiver.- Returns:
- Control
 
- 
getNeighborReturns a neighboring row, ornullif no neighbor exists in the given direction. IfsameLevelistrue, only sibling rows (under the same parent) will be considered.
- 
getTreePathThe tree path used to identify an element by the unique path- Returns:
- the path
 
- 
clone
- 
getElement- Returns:
- the model element
 
- 
hashCodepublic int hashCode()
- 
equals
- 
getVisualIndexprotected int getVisualIndex(int creationIndex) Translate the original column index to the actual one.Because of backwards API compatibility the default implementation returns the original index. Implementators of ColumnViewershould overwrite this method if their widget supports reordered columns- Parameters:
- creationIndex- the original index
- Returns:
- the current index (as shown in the UI)
- Since:
- 3.4
 
- 
getCreationIndexprotected int getCreationIndex(int visualIndex) Translate the current column index (as shown in the UI) to the original one.Because of backwards API compatibility the default implementation returns the original index. Implementators of ColumnViewershould overwrite this method if their widget supports reordered columns- Parameters:
- visualIndex- the current index (as shown in the UI)
- Returns:
- the original index
- Since:
- 3.4
 
- 
getTextBoundsThe location and bounds of the area where the text is drawn depends on various things (image displayed, control with SWT.CHECK)- Parameters:
- index- the column index
- Returns:
- the bounds of the of the text area. May return nullif the underlying widget implementation doesn't provide this information
- Since:
- 3.4
 
- 
getImageBoundsReturns the location and bounds of the area where the image is drawn.- Parameters:
- index- the column index
- Returns:
- the bounds of the of the image area. May return nullif the underlying widget implementation doesn't provide this information
- Since:
- 3.4
 
- 
setStyleRangesSet the style ranges to be applied on the text label at the column index Note: RequiresStyledCellLabelProviderwith owner draw enabled.- Parameters:
- columnIndex- the index of the column
- styleRanges- the styled ranges
- Since:
- 3.4
 
- 
getStyleRangesReturns the style ranges to be applied on the text label at the column index ornullif no style ranges have been set.- Parameters:
- columnIndex- the index of the column
- Returns:
- styleRanges the styled ranges
- Since:
- 3.4
 
- 
scrollCellIntoViewprotected boolean scrollCellIntoView(int columnIndex) Scrolls the cell at this index into viewBecause of backwards API compatibility the default implementation is a no-op. Implementators of ColumnViewershould overwrite this method if their widget supports reordered columns- Parameters:
- columnIndex- the column index
- Returns:
- return truewhen the cell is scrolled into view
- Since:
- 3.5
 
- 
isColumnVisibleprotected boolean isColumnVisible(int columnIndex) Returnstrueif the column with the given index is visible- Parameters:
- columnIndex- the column index
- Returns:
- trueif the column is visible
- Since:
- 3.5
 
 
-