Package org.eclipse.nebula.widgets.grid
Class GridCellRenderer
java.lang.Object
org.eclipse.nebula.widgets.grid.AbstractRenderer
org.eclipse.nebula.widgets.grid.AbstractInternalWidget
org.eclipse.nebula.widgets.grid.GridCellRenderer
- All Implemented Interfaces:
IInternalWidget
,IRenderer
- Direct Known Subclasses:
DefaultCellRenderer
,DefaultEmptyCellRenderer
public abstract class GridCellRenderer extends AbstractInternalWidget
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT. THIS IS A PRE-RELEASE ALPHA VERSION. USERS SHOULD EXPECT API CHANGES IN FUTURE VERSIONS.
The super class for all grid cell renderers. Contains the properties specific to a grid cell.-
Field Summary
Fields Modifier and Type Field Description protected int
truncationStyle
Truncation styleFields inherited from interface org.eclipse.nebula.widgets.grid.IInternalWidget
LeftMouseButtonDown, MouseMove
-
Constructor Summary
Constructors Constructor Description GridCellRenderer()
-
Method Summary
Modifier and Type Method Description int
getAlignment()
int
getColumn()
int
getRow()
org.eclipse.swt.graphics.Rectangle
getTextBounds(GridItem item, boolean preferred)
Returns the bounds of the text in the cell.int
getTruncationStyle()
Get the truncation styleint
getVerticalAlignment()
boolean
isCellFocus()
boolean
isCellSelected()
boolean
isCheck()
boolean
isColumnHover()
boolean
isDragging()
Gets the dragging state.boolean
isRowFocus()
boolean
isRowHover()
boolean
isTree()
boolean
isWordWrap()
void
setAlignment(int alignment)
void
setCellFocus(boolean columnFocus)
void
setCellSelected(boolean cellSelected)
void
setCheck(boolean check)
void
setColumn(int column)
void
setColumnHover(boolean columnHover)
void
setDragging(boolean dragging)
Sets the dragging state.void
setRow(int row)
void
setRowFocus(boolean rowFocus)
void
setRowHover(boolean rowHover)
void
setTree(boolean tree)
void
setTruncationStyle(int truncationStyle)
Set the truncation style to use when cell content is too large.void
setVerticalAlignment(int verticalAlignment)
void
setWordWrap(boolean wordWrap)
Methods inherited from class org.eclipse.nebula.widgets.grid.AbstractInternalWidget
getHoverDetail, setHoverDetail
Methods inherited from class org.eclipse.nebula.widgets.grid.AbstractRenderer
getBounds, getDisplay, getSize, isExpanded, isFocus, isHover, isMouseDown, isSelected, setBounds, setBounds, setDisplay, setExpanded, setFocus, setHover, setLocation, setLocation, setMouseDown, setSelected, setSize, setSize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.nebula.widgets.grid.IRenderer
computeSize, paint, setBounds, setBounds, setDisplay, setExpanded, setFocus, setHover, setLocation, setLocation, setMouseDown, setSelected, setSize, setSize
-
Field Details
-
truncationStyle
protected int truncationStyleTruncation style
-
-
Constructor Details
-
GridCellRenderer
public GridCellRenderer()
-
-
Method Details
-
getRow
public int getRow()- Returns:
- Returns the row.
-
setRow
public void setRow(int row)- Parameters:
row
- The row to set.
-
getAlignment
public int getAlignment()- Returns:
- Returns the alignment.
-
setAlignment
public void setAlignment(int alignment)- Parameters:
alignment
- The alignment to set.
-
getVerticalAlignment
public int getVerticalAlignment()- Returns:
- Returns the vertical alignment.
-
setVerticalAlignment
public void setVerticalAlignment(int verticalAlignment)- Parameters:
verticalAlignment
- The vertical alignment to set.
-
isCheck
public boolean isCheck()- Returns:
- Returns the check.
-
setCheck
public void setCheck(boolean check)- Parameters:
check
- The check to set.
-
isTree
public boolean isTree()- Returns:
- Returns the tree.
-
setTree
public void setTree(boolean tree)- Parameters:
tree
- The tree to set.
-
getColumn
public int getColumn()- Returns:
- Returns the column.
-
setColumn
public void setColumn(int column)- Parameters:
column
- The column to set.
-
isColumnHover
public boolean isColumnHover()- Returns:
- Returns the columnHover.
-
setColumnHover
public void setColumnHover(boolean columnHover)- Parameters:
columnHover
- The columnHover to set.
-
isRowHover
public boolean isRowHover()- Returns:
- Returns the rowHover.
-
setRowHover
public void setRowHover(boolean rowHover)- Parameters:
rowHover
- The rowHover to set.
-
isCellFocus
public boolean isCellFocus()- Returns:
- Returns the columnFocus.
-
setCellFocus
public void setCellFocus(boolean columnFocus)- Parameters:
columnFocus
- The columnFocus to set.
-
isRowFocus
public boolean isRowFocus()- Returns:
- Returns the rowFocus.
-
setRowFocus
public void setRowFocus(boolean rowFocus)- Parameters:
rowFocus
- The rowFocus to set.
-
isCellSelected
public boolean isCellSelected()- Returns:
- the cellSelected
-
setCellSelected
public void setCellSelected(boolean cellSelected)- Parameters:
cellSelected
- the cellSelected to set
-
getTextBounds
Returns the bounds of the text in the cell. This is used when displaying in-place tooltips. Ifnull
is returned here, in-place tooltips will not be displayed. If thepreferred
argument istrue
then the returned bounds should be large enough to show the entire text. Ifpreferred
isfalse
then the returned bounds should be be relative to the current bounds.- Parameters:
item
- item to calculate text bounds.preferred
- true if the preferred width of the text should be returned.- Returns:
- bounds of the text.
-
isWordWrap
public boolean isWordWrap()- Returns:
- the wordWrap
-
setWordWrap
public void setWordWrap(boolean wordWrap)- Parameters:
wordWrap
- the wordWrap to set
-
isDragging
public boolean isDragging()Gets the dragging state.- Returns:
- Returns the dragging state.
-
setDragging
public void setDragging(boolean dragging)Sets the dragging state.- Parameters:
dragging
- The state to set.
-
getTruncationStyle
public int getTruncationStyle()Get the truncation style- Returns:
- the truncation style.
-
setTruncationStyle
public void setTruncationStyle(int truncationStyle)Set the truncation style to use when cell content is too large.- Parameters:
truncationStyle
-- See Also:
SWT.LEFT
,SWT.CENTER
,SWT.RIGHT
-