Eclipse Platform
Release 3.3

org.eclipse.jface.viewers
Class ViewerRow

java.lang.Object
  extended byorg.eclipse.jface.viewers.ViewerRow
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
TableViewerRow, TreeViewerRow

public abstract class ViewerRow
extends Object
implements Cloneable

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 Summary
static int ABOVE
          Constant denoting the row above the current one (value is 1).
static int BELOW
          Constant denoting the row below the current one (value is 2).
 
Constructor Summary
ViewerRow()
           
 
Method Summary
abstract  Object clone()
           
 boolean equals(Object obj)
           
abstract  Color getBackground(int columnIndex)
          Get the background at the columnIndex,
abstract  Rectangle getBounds()
          Return the bounds for the whole item.
abstract  Rectangle getBounds(int columnIndex)
          Get the bounds of the entry at the columnIndex,
 ViewerCell getCell(int column)
          Get a ViewerCell for the column at index.
 ViewerCell getCell(Point point)
          Get the ViewerCell at point.
abstract  int getColumnCount()
          Return the number of columns for the receiver.
 int getColumnIndex(Point point)
          Get the columnIndex of the point.
abstract  Control getControl()
          Get the Control for the receiver.
abstract  Object getElement()
           
abstract  Font getFont(int columnIndex)
          Get the font at the columnIndex.
abstract  Color getForeground(int columnIndex)
          Get the foreground at the columnIndex.
abstract  Image getImage(int columnIndex)
          Return the image at the columnIndex.
abstract  Widget getItem()
          Return the item for the receiver.
abstract  ViewerRow getNeighbor(int direction, boolean sameLevel)
          Returns a neighboring row, or null if no neighbor exists in the given direction.
abstract  String getText(int columnIndex)
          Get the text at the columnIndex.
abstract  TreePath getTreePath()
          The tree path used to identify an element by the unique path
 int hashCode()
           
abstract  void setBackground(int columnIndex, Color color)
          Set the background at the columnIndex.
abstract  void setFont(int columnIndex, Font font)
          Set the Font at the columnIndex.
abstract  void setForeground(int columnIndex, Color color)
          Set the foreground at the columnIndex.
abstract  void setImage(int columnIndex, Image image)
          Set the image at the columnIndex
abstract  void setText(int columnIndex, String text)
          Set the text at the columnIndex
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABOVE

public static final int ABOVE
Constant denoting the row above the current one (value is 1).

See Also:
getNeighbor(int, boolean), Constant Field Values

BELOW

public static final int BELOW
Constant denoting the row below the current one (value is 2).

See Also:
getNeighbor(int, boolean), Constant Field Values
Constructor Detail

ViewerRow

public ViewerRow()
Method Detail

getBounds

public abstract Rectangle getBounds(int columnIndex)
Get the bounds of the entry at the columnIndex,

Parameters:
columnIndex -
Returns:
Rectangle

getBounds

public abstract Rectangle getBounds()
Return the bounds for the whole item.

Returns:
Rectangle

getItem

public abstract Widget getItem()
Return the item for the receiver.

Returns:
Widget

getColumnCount

public abstract int getColumnCount()
Return the number of columns for the receiver.

Returns:
the number of columns

getImage

public abstract Image getImage(int columnIndex)
Return the image at the columnIndex.

Parameters:
columnIndex -
Returns:
Image or null

setImage

public abstract void setImage(int columnIndex,
                              Image image)
Set the image at the columnIndex

Parameters:
columnIndex -
image -

getText

public abstract String getText(int columnIndex)
Get the text at the columnIndex.

Parameters:
columnIndex -
Returns:
String

setText

public abstract void setText(int columnIndex,
                             String text)
Set the text at the columnIndex

Parameters:
columnIndex -
text -

getBackground

public abstract Color getBackground(int columnIndex)
Get the background at the columnIndex,

Parameters:
columnIndex -
Returns:
Color or null

setBackground

public abstract void setBackground(int columnIndex,
                                   Color color)
Set the background at the columnIndex.

Parameters:
columnIndex -
color -

getForeground

public abstract Color getForeground(int columnIndex)
Get the foreground at the columnIndex.

Parameters:
columnIndex -
Returns:
Color or null

setForeground

public abstract void setForeground(int columnIndex,
                                   Color color)
Set the foreground at the columnIndex.

Parameters:
columnIndex -
color -

getFont

public abstract Font getFont(int columnIndex)
Get the font at the columnIndex.

Parameters:
columnIndex -
Returns:
Font or null

setFont

public abstract void setFont(int columnIndex,
                             Font font)
Set the Font at the columnIndex.

Parameters:
columnIndex -
font -

getCell

public ViewerCell getCell(Point point)
Get the ViewerCell at point.

Parameters:
point -
Returns:
ViewerCell

getColumnIndex

public int getColumnIndex(Point point)
Get the columnIndex of the point.

Parameters:
point -
Returns:
int or -1 if it cannot be found.

getCell

public ViewerCell getCell(int column)
Get a ViewerCell for the column at index.

Parameters:
column -
Returns:
ViewerCell or null if the index is negative.

getControl

public abstract Control getControl()
Get the Control for the receiver.

Returns:
Control

getNeighbor

public abstract ViewerRow getNeighbor(int direction,
                                      boolean sameLevel)
Returns a neighboring row, or null if no neighbor exists in the given direction. If sameLevel is true, only sibling rows (under the same parent) will be considered.

Parameters:
direction - the direction BELOW or ABOVE
sameLevel - if true, search only within sibling rows
Returns:
the row above/below, or null if not found

getTreePath

public abstract TreePath getTreePath()
The tree path used to identify an element by the unique path

Returns:
the path

clone

public abstract Object clone()

getElement

public abstract Object getElement()
Returns:
the model element

hashCode

public int hashCode()

equals

public boolean equals(Object obj)

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.