public class ViewerCell extends Object
Modifier and Type | Field and Description |
---|---|
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).
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Color |
getBackground()
Gets the background color of the cell.
|
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.
|
Font |
getFont()
Gets the font of the cell.
|
Color |
getForeground()
Gets the foreground color of the cell.
|
Image |
getImage()
Return the Image for the cell.
|
Rectangle |
getImageBounds()
Returns the location and bounds of the area where the image is drawn
|
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. |
StyleRange[] |
getStyleRanges()
Returns the style ranges to be applied on the text label or
null if no style ranges have been set. |
String |
getText()
Return the text for the cell.
|
Rectangle |
getTextBounds()
The location and bounds of the area where the text is drawn depends on
various things (image displayed, control with SWT.CHECK)
|
ViewerRow |
getViewerRow() |
int |
getVisualIndex()
Get the current index.
|
int |
hashCode() |
boolean |
scrollIntoView()
Scroll the cell into view
|
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 |
setStyleRanges(StyleRange[] styleRanges)
Set the style ranges to be applied on the text label Note: Requires
StyledCellLabelProvider with owner draw enabled. |
void |
setText(String text)
Set the text for the cell.
|
public static int ABOVE
public static int BELOW
public static int LEFT
public static int RIGHT
public int getColumnIndex()
public void setBackground(Color background)
background
- public void setForeground(Color foreground)
foreground
- public void setFont(Font font)
font
- public void setText(String text)
text
- public void setImage(Image image)
image
- public void setStyleRanges(StyleRange[] styleRanges)
StyledCellLabelProvider
with owner draw enabled.styleRanges
- the styled rangespublic StyleRange[] getStyleRanges()
null
if no style ranges have been set.public int getVisualIndex()
public ViewerCell getNeighbor(int directionMask, boolean sameLevel)
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.directionMask
- the direction mask used to identify the requested neighbor
cellsameLevel
- if true
, only consider cells from sibling rowsnull
if not foundpublic ViewerRow getViewerRow()
public Rectangle getTextBounds()
null
if the underlying widget implementation doesn't provide this
informationpublic Rectangle getImageBounds()
null
if the underlying widget implementation doesn't provide this
informationpublic Color getForeground()
null
for the default
foregroundpublic Color getBackground()
null
for the default
backgroundpublic Font getFont()
null
for the default fontpublic boolean scrollIntoView()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.