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 inttruncationStyleTruncation 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 intgetAlignment()intgetColumn()intgetRow()org.eclipse.swt.graphics.RectanglegetTextBounds(GridItem item, boolean preferred)Returns the bounds of the text in the cell.intgetTruncationStyle()Get the truncation styleintgetVerticalAlignment()booleanisCellFocus()booleanisCellSelected()booleanisCheck()booleanisColumnHover()booleanisDragging()Gets the dragging state.booleanisRowFocus()booleanisRowHover()booleanisTree()booleanisWordWrap()voidsetAlignment(int alignment)voidsetCellFocus(boolean columnFocus)voidsetCellSelected(boolean cellSelected)voidsetCheck(boolean check)voidsetColumn(int column)voidsetColumnHover(boolean columnHover)voidsetDragging(boolean dragging)Sets the dragging state.voidsetRow(int row)voidsetRowFocus(boolean rowFocus)voidsetRowHover(boolean rowHover)voidsetTree(boolean tree)voidsetTruncationStyle(int truncationStyle)Set the truncation style to use when cell content is too large.voidsetVerticalAlignment(int verticalAlignment)voidsetWordWrap(boolean wordWrap)Methods inherited from class org.eclipse.nebula.widgets.grid.AbstractInternalWidget
getHoverDetail, setHoverDetailMethods 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, setSizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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. Ifnullis returned here, in-place tooltips will not be displayed. If thepreferredargument istruethen the returned bounds should be large enough to show the entire text. Ifpreferredisfalsethen 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
-