public abstract class ViewerRow extends Object implements Cloneable
ColumnViewer
have to provide a
concrete implementation for the underlying widgetModifier and Type | Field and Description |
---|---|
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 and Description |
---|
ViewerRow() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected int |
getCreationIndex(int visualIndex)
Translate the current column index (as shown in the UI) to the original
one.
|
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.
|
Rectangle |
getImageBounds(int index)
Returns the location and bounds of the area where the image is drawn.
|
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. |
StyleRange[] |
getStyleRanges(int columnIndex)
Returns the style ranges to be applied on the text label at the column
index or
null if no style ranges have been set. |
abstract 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)
|
abstract TreePath |
getTreePath()
The tree path used to identify an element by the unique path
|
protected int |
getVisualIndex(int creationIndex)
Translate the original column index to the actual one.
|
int |
hashCode() |
protected boolean |
isColumnVisible(int columnIndex)
Returns
true if the column with the given index is visible |
protected boolean |
scrollCellIntoView(int columnIndex)
Scrolls the cell at this index into view
Because of backwards API compatibility the default implementation is a
no-op.
|
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
|
void |
setStyleRanges(int columnIndex,
StyleRange[] styleRanges)
Set the style ranges to be applied on the text label at the column index
Note: Requires
StyledCellLabelProvider with owner draw enabled. |
abstract void |
setText(int columnIndex,
String text)
Set the text at the columnIndex
|
public static final int ABOVE
getNeighbor(int, boolean)
,
Constant Field Valuespublic static final int BELOW
getNeighbor(int, boolean)
,
Constant Field Valuespublic abstract Rectangle getBounds(int columnIndex)
columnIndex
- Rectangle
public abstract Rectangle getBounds()
Rectangle
public abstract int getColumnCount()
public abstract Image getImage(int columnIndex)
columnIndex
- Image
or null
public abstract void setImage(int columnIndex, Image image)
columnIndex
- image
- public abstract String getText(int columnIndex)
columnIndex
- String
public abstract void setText(int columnIndex, String text)
columnIndex
- text
- public abstract Color getBackground(int columnIndex)
columnIndex
- Color
or null
public abstract void setBackground(int columnIndex, Color color)
columnIndex
- color
- public abstract Color getForeground(int columnIndex)
columnIndex
- Color
or null
public abstract void setForeground(int columnIndex, Color color)
columnIndex
- color
- public abstract Font getFont(int columnIndex)
columnIndex
- Font
or null
public abstract void setFont(int columnIndex, Font font)
Font
at the columnIndex.columnIndex
- font
- public ViewerCell getCell(Point point)
point
- ViewerCell
or null
if the point is
not in the bounds of a cellpublic int getColumnIndex(Point point)
point
- public ViewerCell getCell(int column)
column
- ViewerCell
or null
if the index is negative.public abstract ViewerRow getNeighbor(int direction, boolean sameLevel)
null
if no neighbor exists in
the given direction. If sameLevel
is true
, only
sibling rows (under the same parent) will be considered.public abstract TreePath getTreePath()
public abstract Object getElement()
protected int getVisualIndex(int creationIndex)
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
creationIndex
- the original indexprotected int getCreationIndex(int visualIndex)
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
visualIndex
- the current index (as shown in the UI)public Rectangle getTextBounds(int index)
index
- the column indexnull
if the underlying widget implementation doesn't provide this
informationpublic Rectangle getImageBounds(int index)
index
- the column indexnull
if the underlying widget implementation doesn't provide this
informationpublic void setStyleRanges(int columnIndex, StyleRange[] styleRanges)
StyledCellLabelProvider
with owner draw enabled.columnIndex
- the index of the columnstyleRanges
- the styled rangespublic StyleRange[] getStyleRanges(int columnIndex)
null
if no style ranges have been set.columnIndex
- the index of the columnprotected boolean scrollCellIntoView(int columnIndex)
Because of backwards API compatibility the default implementation is a
no-op. Implementators of ColumnViewer
should overwrite this
method if their widget supports reordered columns
columnIndex
- the column indextrue
when the cell is scrolled into viewprotected boolean isColumnVisible(int columnIndex)
true
if the column with the given index is visiblecolumnIndex
- the column indextrue
if the column is visible
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.