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 private intalignmentprivate booleancellFocusprivate booleancellSelectedprivate booleancheckprivate intcolumnprivate booleancolumnHoverprivate booleandraggingprivate introwprivate booleanrowFocusprivate booleanrowHoverprivate booleantreeprotected inttruncationStyleTruncation styleprivate intverticalAlignmentprivate booleanwordWrap-
Fields inherited from class org.eclipse.nebula.widgets.grid.AbstractInternalWidget
hoverDetail
-
Fields inherited from interface org.eclipse.nebula.widgets.grid.IInternalWidget
LeftMouseButtonDown, MouseMove
-
-
Constructor Summary
Constructors Constructor Description GridCellRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods 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, 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.IInternalWidget
notify
-
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 Detail
-
row
private int row
-
column
private int column
-
alignment
private int alignment
-
verticalAlignment
private int verticalAlignment
-
tree
private boolean tree
-
check
private boolean check
-
rowHover
private boolean rowHover
-
columnHover
private boolean columnHover
-
rowFocus
private boolean rowFocus
-
cellFocus
private boolean cellFocus
-
cellSelected
private boolean cellSelected
-
wordWrap
private boolean wordWrap
-
dragging
private boolean dragging
-
truncationStyle
protected int truncationStyle
Truncation style
-
-
Method Detail
-
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
public org.eclipse.swt.graphics.Rectangle getTextBounds(GridItem item, boolean preferred)
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
-
-