Package org.eclipse.jface.viewers
Class TableViewerRow
- java.lang.Object
-
- org.eclipse.jface.viewers.ViewerRow
-
- org.eclipse.jface.viewers.TableViewerRow
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Color
getBackground(int columnIndex)
Get the background at the columnIndex,Rectangle
getBounds()
Return the bounds for the whole item.Rectangle
getBounds(int columnIndex)
Get the bounds of the entry at the columnIndex,int
getColumnCount()
Return the number of columns for the receiver.Control
getControl()
Get the Control for the receiver.int
getCreationIndex(int visualIndex)
Translate the current column index (as shown in the UI) to the original one.Object
getElement()
Font
getFont(int columnIndex)
Get the font at the columnIndex.Color
getForeground(int columnIndex)
Get the foreground at the columnIndex.Image
getImage(int columnIndex)
Return the image at the columnIndex.Rectangle
getImageBounds(int index)
Returns the location and bounds of the area where the image is drawn.Widget
getItem()
Return the item for the receiver.ViewerRow
getNeighbor(int direction, boolean sameLevel)
Returns a neighboring row, ornull
if no neighbor exists in the given direction.String
getText(int columnIndex)
Get the text at the columnIndex.Rectangle
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)TreePath
getTreePath()
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
setFont(int columnIndex, Font font)
Set theFont
at the columnIndex.void
setForeground(int columnIndex, Color color)
Set the foreground at the columnIndex.void
setImage(int columnIndex, Image image)
Set the image at the columnIndexvoid
setText(int columnIndex, String text)
Set the text at the columnIndex-
Methods inherited from class org.eclipse.jface.viewers.ViewerRow
equals, getCell, getCell, getColumnIndex, getStyleRanges, hashCode, isColumnVisible, setStyleRanges
-
-
-
-
Method Detail
-
getBounds
public Rectangle getBounds(int columnIndex)
Description copied from class:ViewerRow
Get the bounds of the entry at the columnIndex,
-
getBounds
public Rectangle getBounds()
Description copied from class:ViewerRow
Return the bounds for the whole item.
-
getItem
public Widget getItem()
Description copied from class:ViewerRow
Return the item for the receiver.
-
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
-
getBackground
public Color getBackground(int columnIndex)
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
public Font getFont(int columnIndex)
Description copied from class:ViewerRow
Get the font at the columnIndex.
-
getForeground
public Color getForeground(int columnIndex)
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
public Image getImage(int columnIndex)
Description copied from class:ViewerRow
Return the image at the columnIndex.
-
getText
public String getText(int columnIndex)
Description copied from class:ViewerRow
Get the text at the columnIndex.
-
setBackground
public void setBackground(int columnIndex, Color color)
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
public void setFont(int columnIndex, Font font)
Description copied from class:ViewerRow
Set theFont
at the columnIndex.
-
setForeground
public void setForeground(int columnIndex, Color color)
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
public void setImage(int columnIndex, Image image)
Description copied from class:ViewerRow
Set the image at the columnIndex
-
setText
public void setText(int columnIndex, String text)
Description copied from class:ViewerRow
Set the text at the columnIndex
-
getControl
public Control getControl()
Description copied from class:ViewerRow
Get the Control for the receiver.- Specified by:
getControl
in classViewerRow
- Returns:
Control
-
getNeighbor
public ViewerRow getNeighbor(int direction, boolean sameLevel)
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
public TreePath 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
-
getElement
public Object 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
public Rectangle getTextBounds(int index)
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
public Rectangle getImageBounds(int index)
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
-
-