Eclipse Platform
Release 3.3

org.eclipse.jface.viewers
Class ViewerCell

java.lang.Object
  extended byorg.eclipse.jface.viewers.ViewerCell

public class ViewerCell
extends Object

The ViewerCell is the JFace representation of a cell entry in a ViewerRow.

Since:
3.3

Field Summary
static int ABOVE
          Constant denoting the cell above current one (value is 1).
static int BELOW
          Constant denoting the cell below current one (value is 2).
static int LEFT
          Constant denoting the cell to the left of the current one (value is 4).
static int RIGHT
          Constant denoting the cell to the right of the current one (value is 8).
 
Method Summary
 boolean equals(Object obj)
           
 Rectangle getBounds()
          Get the bounds of the cell.
 int getColumnIndex()
          Get the index of the cell.
 Control getControl()
          Get the control for this cell.
 Object getElement()
          Get the element this row represents.
 Image getImage()
          Return the Image for the cell.
 Widget getItem()
          Return the item for the receiver.
 ViewerCell getNeighbor(int directionMask, boolean sameLevel)
          Returns the specified neighbor of this cell, or null if no neighbor exists in the given direction.
 String getText()
          Return the text for the cell.
 ViewerRow getViewerRow()
           
 int hashCode()
           
 void setBackground(Color background)
          Set the background color of the cell.
 void setFont(Font font)
          Set the font of the cell.
 void setForeground(Color foreground)
          Set the foreground color of the cell.
 void setImage(Image image)
          Set the Image for the cell.
 void setText(String text)
          Set the text for the cell.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABOVE

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


BELOW

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


LEFT

public static int LEFT
Constant denoting the cell to the left of the current one (value is 4).


RIGHT

public static int RIGHT
Constant denoting the cell to the right of the current one (value is 8).

Method Detail

getColumnIndex

public int getColumnIndex()
Get the index of the cell.

Returns:
the index

getBounds

public Rectangle getBounds()
Get the bounds of the cell.

Returns:
Rectangle

getElement

public Object getElement()
Get the element this row represents.

Returns:
Object

getText

public String getText()
Return the text for the cell.

Returns:
String

getImage

public Image getImage()
Return the Image for the cell.

Returns:
Image or null

setBackground

public void setBackground(Color background)
Set the background color of the cell.

Parameters:
background -

setForeground

public void setForeground(Color foreground)
Set the foreground color of the cell.

Parameters:
foreground -

setFont

public void setFont(Font font)
Set the font of the cell.

Parameters:
font -

setText

public void setText(String text)
Set the text for the cell.

Parameters:
text -

setImage

public void setImage(Image image)
Set the Image for the cell.

Parameters:
image -

getItem

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

Returns:
Item

getControl

public Control getControl()
Get the control for this cell.

Returns:
Control

getNeighbor

public ViewerCell getNeighbor(int directionMask,
                              boolean sameLevel)
Returns the specified neighbor of this cell, or null if no neighbor exists in the given direction. Direction constants can be combined by bitwise OR; for example, this method will return the cell to the upper-left of the current cell by passing ABOVE | LEFT. If sameLevel is true, only cells in sibling rows (under the same parent) will be considered.

Parameters:
directionMask - the direction mask used to identify the requested neighbor cell
sameLevel - if true, only consider cells from sibling rows
Returns:
the requested neighbor cell, or null if not found

getViewerRow

public ViewerRow getViewerRow()
Returns:
the row

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.