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,int
Return the number of columns for the receiver.Get the Control for the receiver.int
getCreationIndex
(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, ornull
if 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 pathint
getVisualIndex
(int creationIndex) Translate the original column index to the actual one.protected boolean
scrollCellIntoView
(int columnIndex) Scrolls the cell at this index into viewvoid
setBackground
(int columnIndex, Color color) Set the background at the columnIndex.void
Set theFont
at the columnIndex.void
setForeground
(int columnIndex, Color color) Set the foreground at the columnIndex.void
Set the image at the columnIndexvoid
Set 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:ViewerRow
Get the bounds of the entry at the columnIndex, -
getBounds
Description copied from class:ViewerRow
Return the bounds for the whole item. -
getColumnCount
public int getColumnCount()Description copied from class:ViewerRow
Return the number of columns for the receiver.- Specified by:
getColumnCount
in classViewerRow
- Returns:
- the number of columns
-
getItem
Description copied from class:ViewerRow
Return the item for the receiver. -
getBackground
Description copied from class:ViewerRow
Get the background at the columnIndex,- Specified by:
getBackground
in classViewerRow
- Parameters:
columnIndex
- column index of interest- Returns:
Color
ornull
-
getFont
Description copied from class:ViewerRow
Get the font at the columnIndex. -
getForeground
Description copied from class:ViewerRow
Get the foreground at the columnIndex.- Specified by:
getForeground
in classViewerRow
- Parameters:
columnIndex
- column index of interest- Returns:
Color
ornull
-
getImage
Description copied from class:ViewerRow
Return the image at the columnIndex. -
getText
Description copied from class:ViewerRow
Get the text at the columnIndex. -
setBackground
Description copied from class:ViewerRow
Set the background at the columnIndex.- Specified by:
setBackground
in classViewerRow
- Parameters:
columnIndex
- column index to set color forcolor
- color to set
-
setFont
Description copied from class:ViewerRow
Set theFont
at the columnIndex. -
setForeground
Description copied from class:ViewerRow
Set the foreground at the columnIndex.- Specified by:
setForeground
in classViewerRow
- Parameters:
columnIndex
- column index to set color forcolor
- color to set
-
setImage
Description copied from class:ViewerRow
Set the image at the columnIndex -
setText
Description copied from class:ViewerRow
Set the text at the columnIndex -
getControl
Description copied from class:ViewerRow
Get the Control for the receiver.- Specified by:
getControl
in classViewerRow
- Returns:
Control
-
getNeighbor
Description copied from class:ViewerRow
Returns a neighboring row, ornull
if no neighbor exists in the given direction. IfsameLevel
istrue
, only sibling rows (under the same parent) will be considered.- Specified by:
getNeighbor
in classViewerRow
- Parameters:
direction
- the directionViewerRow.BELOW
orViewerRow.ABOVE
sameLevel
- iftrue
, search only within sibling rows- Returns:
- the row above/below, or
null
if not found
-
getTreePath
Description copied from class:ViewerRow
The tree path used to identify an element by the unique path- Specified by:
getTreePath
in classViewerRow
- Returns:
- the path
-
clone
-
getElement
- Specified by:
getElement
in classViewerRow
- Returns:
- the model element
-
getVisualIndex
public int getVisualIndex(int creationIndex) Description copied from class:ViewerRow
Translate the original column index to the actual one.Because of backwards API compatibility the default implementation returns the original index. Implementators of
ColumnViewer
should overwrite this method if their widget supports reordered columns- Overrides:
getVisualIndex
in 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:ViewerRow
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
ColumnViewer
should overwrite this method if their widget supports reordered columns- Overrides:
getCreationIndex
in classViewerRow
- Parameters:
visualIndex
- the current index (as shown in the UI)- Returns:
- the original index
-
getTextBounds
Description copied from class:ViewerRow
The location and bounds of the area where the text is drawn depends on various things (image displayed, control with SWT.CHECK)- Overrides:
getTextBounds
in classViewerRow
- Parameters:
index
- the column index- Returns:
- the bounds of the of the text area. May return
null
if the underlying widget implementation doesn't provide this information
-
getImageBounds
Description copied from class:ViewerRow
Returns the location and bounds of the area where the image is drawn.- Overrides:
getImageBounds
in classViewerRow
- Parameters:
index
- the column index- Returns:
- the bounds of the of the image area. May return
null
if the underlying widget implementation doesn't provide this information
-
scrollCellIntoView
protected boolean scrollCellIntoView(int columnIndex) Description copied from class:ViewerRow
Scrolls the cell at this index into viewBecause of backwards API compatibility the default implementation is a no-op. Implementators of
ColumnViewer
should overwrite this method if their widget supports reordered columns- Overrides:
scrollCellIntoView
in classViewerRow
- Parameters:
columnIndex
- the column index- Returns:
- return
true
when the cell is scrolled into view
-