Package org.eclipse.jface.viewers
Class TreeViewerRow
java.lang.Object
org.eclipse.jface.viewers.ViewerRow
org.eclipse.jface.viewers.TreeViewerRow
- All Implemented Interfaces:
Cloneable
TreeViewerRow is the Tree implementation of ViewerRow.
- Since:
- 3.3
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()getBackground(int columnIndex) Get the background at the columnIndex,Return the bounds for the whole item.getBounds(int columnIndex) Get the bounds of the entry at the columnIndex,intReturn the number of columns for the receiver.Get the Control for the receiver.intgetCreationIndex(int visualIndex) Translate the current column index (as shown in the UI) to the original one.getFont(int columnIndex) Get the font at the columnIndex.getForeground(int columnIndex) Get the foreground at the columnIndex.getImage(int columnIndex) Return the image at the columnIndex.getImageBounds(int index) Returns the location and bounds of the area where the image is drawn.getItem()Return the item for the receiver.getNeighbor(int direction, boolean sameLevel) Returns a neighboring row, ornullif no neighbor exists in the given direction.getText(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)The tree path used to identify an element by the unique pathintgetVisualIndex(int creationIndex) Translate the original column index to the actual one.protected booleanscrollCellIntoView(int columnIndex) Scrolls the cell at this index into viewvoidsetBackground(int columnIndex, Color color) Set the background at the columnIndex.voidSet theFontat the columnIndex.voidsetForeground(int columnIndex, Color color) Set the foreground at the columnIndex.voidSet the image at the columnIndexvoidSet the text at the columnIndexMethods inherited from class org.eclipse.jface.viewers.ViewerRow
equals, getCell, getCell, getColumnIndex, getStyleRanges, hashCode, isColumnVisible, setStyleRanges
-
Method Details
-
getBounds
Description copied from class:ViewerRowGet the bounds of the entry at the columnIndex, -
getBounds
Description copied from class:ViewerRowReturn the bounds for the whole item. -
getColumnCount
public int getColumnCount()Description copied from class:ViewerRowReturn the number of columns for the receiver.- Specified by:
getColumnCountin classViewerRow- Returns:
- the number of columns
-
getItem
Description copied from class:ViewerRowReturn the item for the receiver. -
getBackground
Description copied from class:ViewerRowGet the background at the columnIndex,- Specified by:
getBackgroundin classViewerRow- Parameters:
columnIndex- column index of interest- Returns:
Colorornull
-
getFont
Description copied from class:ViewerRowGet the font at the columnIndex. -
getForeground
Description copied from class:ViewerRowGet the foreground at the columnIndex.- Specified by:
getForegroundin classViewerRow- Parameters:
columnIndex- column index of interest- Returns:
Colorornull
-
getImage
Description copied from class:ViewerRowReturn the image at the columnIndex. -
getText
Description copied from class:ViewerRowGet the text at the columnIndex. -
setBackground
Description copied from class:ViewerRowSet the background at the columnIndex.- Specified by:
setBackgroundin classViewerRow- Parameters:
columnIndex- column index to set color forcolor- color to set
-
setFont
Description copied from class:ViewerRowSet theFontat the columnIndex. -
setForeground
Description copied from class:ViewerRowSet the foreground at the columnIndex.- Specified by:
setForegroundin classViewerRow- Parameters:
columnIndex- column index to set color forcolor- color to set
-
setImage
Description copied from class:ViewerRowSet the image at the columnIndex -
setText
Description copied from class:ViewerRowSet the text at the columnIndex -
getControl
Description copied from class:ViewerRowGet the Control for the receiver.- Specified by:
getControlin classViewerRow- Returns:
Control
-
getNeighbor
Description copied from class:ViewerRowReturns a neighboring row, ornullif no neighbor exists in the given direction. IfsameLevelistrue, only sibling rows (under the same parent) will be considered.- Specified by:
getNeighborin classViewerRow- Parameters:
direction- the directionViewerRow.BELOWorViewerRow.ABOVEsameLevel- iftrue, search only within sibling rows- Returns:
- the row above/below, or
nullif not found
-
getTreePath
Description copied from class:ViewerRowThe tree path used to identify an element by the unique path- Specified by:
getTreePathin classViewerRow- Returns:
- the path
-
clone
-
getElement
- Specified by:
getElementin classViewerRow- Returns:
- the model element
-
getVisualIndex
public int getVisualIndex(int creationIndex) Description copied from class:ViewerRowTranslate 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- Overrides:
getVisualIndexin classViewerRow- Parameters:
creationIndex- the original index- Returns:
- the current index (as shown in the UI)
-
getCreationIndex
public int getCreationIndex(int visualIndex) Description copied from class:ViewerRowTranslate 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- Overrides:
getCreationIndexin classViewerRow- Parameters:
visualIndex- the current index (as shown in the UI)- Returns:
- the original index
-
getTextBounds
Description copied from class:ViewerRowThe location and bounds of the area where the text is drawn depends on various things (image displayed, control with SWT.CHECK)- Overrides:
getTextBoundsin classViewerRow- 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
-
getImageBounds
Description copied from class:ViewerRowReturns the location and bounds of the area where the image is drawn.- Overrides:
getImageBoundsin classViewerRow- 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
-
scrollCellIntoView
protected boolean scrollCellIntoView(int columnIndex) Description copied from class:ViewerRowScrolls 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- Overrides:
scrollCellIntoViewin classViewerRow- Parameters:
columnIndex- the column index- Returns:
- return
truewhen the cell is scrolled into view
-