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 Objectclone()ColorgetBackground(int columnIndex)Get the background at the columnIndex,RectanglegetBounds()Return the bounds for the whole item.RectanglegetBounds(int columnIndex)Get the bounds of the entry at the columnIndex,intgetColumnCount()Return the number of columns for the receiver.ControlgetControl()Get the Control for the receiver.intgetCreationIndex(int visualIndex)Translate the current column index (as shown in the UI) to the original one.ObjectgetElement()FontgetFont(int columnIndex)Get the font at the columnIndex.ColorgetForeground(int columnIndex)Get the foreground at the columnIndex.ImagegetImage(int columnIndex)Return the image at the columnIndex.RectanglegetImageBounds(int index)Returns the location and bounds of the area where the image is drawn.WidgetgetItem()Return the item for the receiver.ViewerRowgetNeighbor(int direction, boolean sameLevel)Returns a neighboring row, ornullif no neighbor exists in the given direction.StringgetText(int columnIndex)Get the text at the columnIndex.RectanglegetTextBounds(int index)The location and bounds of the area where the text is drawn depends on various things (image displayed, control with SWT.CHECK)TreePathgetTreePath()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.voidsetFont(int columnIndex, Font font)Set theFontat the columnIndex.voidsetForeground(int columnIndex, Color color)Set the foreground at the columnIndex.voidsetImage(int columnIndex, Image image)Set the image at the columnIndexvoidsetText(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:ViewerRowGet the bounds of the entry at the columnIndex,
-
getBounds
public Rectangle getBounds()
Description copied from class:ViewerRowReturn the bounds for the whole item.
-
getItem
public Widget getItem()
Description copied from class:ViewerRowReturn the item for the receiver.
-
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
-
getBackground
public Color getBackground(int columnIndex)
Description copied from class:ViewerRowGet the background at the columnIndex,- Specified by:
getBackgroundin classViewerRow- Returns:
Colorornull
-
getFont
public Font getFont(int columnIndex)
Description copied from class:ViewerRowGet the font at the columnIndex.
-
getForeground
public Color getForeground(int columnIndex)
Description copied from class:ViewerRowGet the foreground at the columnIndex.- Specified by:
getForegroundin classViewerRow- Returns:
Colorornull
-
getImage
public Image getImage(int columnIndex)
Description copied from class:ViewerRowReturn the image at the columnIndex.
-
getText
public String getText(int columnIndex)
Description copied from class:ViewerRowGet the text at the columnIndex.
-
setBackground
public void setBackground(int columnIndex, Color color)Description copied from class:ViewerRowSet the background at the columnIndex.- Specified by:
setBackgroundin classViewerRow
-
setFont
public void setFont(int columnIndex, Font font)Description copied from class:ViewerRowSet theFontat the columnIndex.
-
setForeground
public void setForeground(int columnIndex, Color color)Description copied from class:ViewerRowSet the foreground at the columnIndex.- Specified by:
setForegroundin classViewerRow
-
setImage
public void setImage(int columnIndex, Image image)Description copied from class:ViewerRowSet the image at the columnIndex
-
setText
public void setText(int columnIndex, String text)Description copied from class:ViewerRowSet the text at the columnIndex
-
getControl
public Control getControl()
Description copied from class:ViewerRowGet the Control for the receiver.- Specified by:
getControlin classViewerRow- Returns:
Control
-
getNeighbor
public ViewerRow getNeighbor(int direction, boolean sameLevel)
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
public TreePath getTreePath()
Description copied from class:ViewerRowThe tree path used to identify an element by the unique path- Specified by:
getTreePathin classViewerRow- Returns:
- the path
-
getElement
public Object 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
public Rectangle getTextBounds(int index)
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
public Rectangle getImageBounds(int index)
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
-
-