Package org.eclipse.nebula.widgets.grid
Class GridItem
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Item
org.eclipse.nebula.widgets.grid.GridItem
- All Implemented Interfaces:
Adaptable
Instances of this class represent a selectable user interface object that
represents an item in a grid.
- Styles:
- (none)
- Events:
- (none)
-
Constructor Summary
ConstructorDescriptionCreates a new instance of this class as a child node of the given GridItem and places the item at the end of the parents items.Creates a new instance of this class as a child node of the given Grid and places the item at the given index in the parent items list.Creates a new instance of this class and places the item at the end of the grid.Creates a new instance of this class and places the item in the grid at the given index. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes of the operating system resources associated with the receiver and all its descendents.void
fireCheckEvent
(int column) Fires the appropriate events in response to a user checking/unchecking an item.void
fireEvent
(int eventId) Fires the given event type on the parent Grid instance.<T> T
getAdapter
(Class<T> adapter) Implementation of theAdaptable
interface.Returns the receiver's background color.getBackground
(int index) Returns the background color at the given column index in the receiver.getBounds
(int columnIndex) Returns a rectangle describing the receiver's size and location relative to its parent at a column in the table.protected Point
getCellSize
(int index) boolean
getCheckable
(int index) Returns the checkable state at the given column index in the receiver.boolean
Returns the checked state at the first column in the receiver.boolean
getChecked
(int index) Returns the checked state at the given column index in the receiver.int
getColumnSpan
(int index) Returns the column span for the given column index in the receiver.getFont()
Returns the font that the receiver will use to paint textual information for this item.getFont
(int index) Returns the font that the receiver will use to paint textual information for the specified cell in this item.Returns the foreground color that the receiver will use to draw.getForeground
(int index) Returns the foreground color at the given column index in the receiver.boolean
Returnstrue
if the first column in the receiver is grayed, and false otherwise.boolean
getGrayed
(int index) Returnstrue
if the column at the given index in the receiver is grayed, and false otherwise.Returns the receiver's row header background colorReturns the receiver's row header fontReturns the receiver's row header foreground colorReturns the receiver's row header image.Returns the receiver's row header text.int
Returns the height of thisGridItem
.getImage()
Returns the receiver's image if it has one, or null if it does not.getImage
(int index) Returns the image stored at the given column index in the receiver, or null if the image has not been set or if the column does not exist.getItem
(int index) Returns the item at the given, zero-relative index in the receiver.int
Returns the number of items contained in the receiver that are direct item children of the receiver.GridItem[]
getItems()
Returns a (possibly empty) array ofGridItem
s which are the direct item children of the receiver.int
getLevel()
Returns the level of this item in the tree.Returns the receiver's parent, which must be aGrid
.Returns the receiver's parent item, which must be aGridItem
or null when the receiver is a root.getText()
Returns the receiver's text, which will be an empty string if it has never been set.getText
(int index) Returns the text stored at the given column index in the receiver, or empty string if the text has not been set.getToolTipText
(int index) Returns the tooltip for the given cell.boolean
Returns true if this item has children.int
Searches the receiver's list starting at the first item (index 0) until an item is found that is equal to the argument, and returns the index of that item.boolean
Returnstrue
if the receiver is expanded, and false otherwise.boolean
void
pack()
Sets thisGridItem
to its preferred height.void
setBackground
(int index, Color background) Sets the background color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.void
setBackground
(Color background) Sets the receiver's background color to the color specified by the argument, or to the default system color for the item if the argument is null.void
setCheckable
(int index, boolean checked) Sets the checkable state at the given column index in the receiver.void
setChecked
(boolean checked) Sets the checked state at the first column in the receiver.void
setChecked
(int index, boolean checked) Sets the checked state at the given column index in the receiver.void
setColumnSpan
(int index, int span) Sets the column spanning for the column at the given index to span the given number of subsequent columns.void
setExpanded
(boolean expanded) Sets the expanded state of the receiver.void
Sets the font that the receiver will use to paint textual information for the specified cell in this item to the font specified by the argument, or to the default font for that kind of control if the argument is null.void
Sets the font that the receiver will use to paint textual information for this item to the font specified by the argument, or to the default font for that kind of control if the argument is null.void
setForeground
(int index, Color foreground) Sets the foreground color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.void
setForeground
(Color foreground) Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the item if the argument is null.void
setGrayed
(boolean grayed) Sets the grayed state of the checkbox for the first column.void
setGrayed
(int index, boolean grayed) Sets the grayed state of the checkbox for the given column index.void
setHeaderBackground
(Color headerBackground) Set the new header backgroundvoid
setHeaderFont
(Font headerFont) Set the new header fontvoid
setHeaderForeground
(Color headerForeground) Set the new header foregroundvoid
setHeaderImage
(Image image) Sets the receiver's row header image.void
setHeaderText
(String text) Sets the receiver's row header text.void
setHeight
(int height) Sets the height of thisGridItem
.void
Sets the receiver's image at a column.void
Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.void
Sets the receiver's text at a column.void
Sets the receiver's text.void
setToolTipText
(int index, String tooltip) Sets the tooltip for the given column index.Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkSubclass, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
Constructor Details
-
GridItem
Creates a new instance of this class and places the item at the end of the grid.- Parameters:
parent
- parent gridstyle
- item style- Throws:
IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException
-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
-
GridItem
Creates a new instance of this class and places the item in the grid at the given index.- Parameters:
parent
- parent gridstyle
- item styleindex
- index where to insert item- Throws:
IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException
-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
-
GridItem
Creates a new instance of this class as a child node of the given GridItem and places the item at the end of the parents items.- Parameters:
parent
- parent itemstyle
- item style- Throws:
IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException
-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
-
GridItem
Creates a new instance of this class as a child node of the given Grid and places the item at the given index in the parent items list.- Parameters:
parent
- parent itemstyle
- item styleindex
- index to place item- Throws:
IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException
-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
-
-
Method Details
-
dispose
public void dispose()Disposes of the operating system resources associated with the receiver and all its descendents. After this method has been invoked, the receiver and all descendents will answertrue
when sent the messageisDisposed()
. Any internal connections between the widgets in the tree will have been removed to facilitate garbage collection.NOTE: This method is not called recursively on the descendents of the receiver. This means that, widget implementers can not detect when a widget is being disposed of by re-implementing this method, but should instead listen for the
Dispose
event. -
fireEvent
public void fireEvent(int eventId) Fires the given event type on the parent Grid instance. This method should only be called from within a cell renderer. Any other use is not intended.- Parameters:
eventId
- SWT event constant- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
fireCheckEvent
public void fireCheckEvent(int column) Fires the appropriate events in response to a user checking/unchecking an item. Checking an item fires both a selection event (with event.detail of SWT.CHECK) if the checkbox is in the first column and the seperate check listener (all columns). This method manages that behavior. This method should only be called from within a cell renderer. Any other use is not intended.- Parameters:
column
- the column where the checkbox resides- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getParent
Returns the receiver's parent, which must be aGrid
.- Returns:
- the receiver's parent
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getParentItem
Returns the receiver's parent item, which must be aGridItem
or null when the receiver is a root.- Returns:
- the receiver's parent item
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getItemCount
public int getItemCount()Returns the number of items contained in the receiver that are direct item children of the receiver.- Returns:
- the number of items
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getItems
Returns a (possibly empty) array ofGridItem
s which are the direct item children of the receiver.Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
- Returns:
- the receiver's items
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getItem
Returns the item at the given, zero-relative index in the receiver. Throws an exception if the index is out of range.- Parameters:
index
- the index of the item to return- Returns:
- the item at the given index
- Throws:
IllegalArgumentException
-- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
indexOf
Searches the receiver's list starting at the first item (index 0) until an item is found that is equal to the argument, and returns the index of that item. If no item is found, returns -1.- Parameters:
item
- the search item- Returns:
- the index of the item
- Throws:
IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the item is null
- ERROR_INVALID_ARGUMENT - if the item has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
hasChildren
public boolean hasChildren()Returns true if this item has children.- Returns:
- true if this item has children
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
isExpanded
public boolean isExpanded()Returnstrue
if the receiver is expanded, and false otherwise.- Returns:
- the expanded state
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setExpanded
public void setExpanded(boolean expanded) Sets the expanded state of the receiver.- Parameters:
expanded
- the new expanded state- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getLevel
public int getLevel()Returns the level of this item in the tree.- Returns:
- the level of the item in the tree
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setFont
Sets the font that the receiver will use to paint textual information for this item to the font specified by the argument, or to the default font for that kind of control if the argument is null.- Parameters:
font
- the new font (or null)- Throws:
IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getFont
Returns the font that the receiver will use to paint textual information for this item.- Returns:
- the receiver's font
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setFont
Sets the font that the receiver will use to paint textual information for the specified cell in this item to the font specified by the argument, or to the default font for that kind of control if the argument is null.- Parameters:
index
- the column indexfont
- the new font (or null)- Throws:
IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getFont
Returns the font that the receiver will use to paint textual information for the specified cell in this item.- Parameters:
index
- the column index- Returns:
- the receiver's font
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setBackground
Sets the receiver's background color to the color specified by the argument, or to the default system color for the item if the argument is null.- Parameters:
background
- the new color (or null)- Throws:
IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getBackground
Returns the receiver's background color.- Returns:
- the background color
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setBackground
Sets the background color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.- Parameters:
index
- the column indexbackground
- the new color (or null)- Throws:
IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getBackground
Returns the background color at the given column index in the receiver.- Parameters:
index
- the column index- Returns:
- the background color
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setForeground
Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the item if the argument is null.- Parameters:
foreground
- the new color (or null)- Throws:
IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getForeground
Returns the foreground color that the receiver will use to draw.- Returns:
- the receiver's foreground color
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setForeground
Sets the foreground color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.- Parameters:
index
- the column indexforeground
- the new color (or null)- Throws:
IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getForeground
Returns the foreground color at the given column index in the receiver.- Parameters:
index
- the column index- Returns:
- the foreground color
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setText
Sets the receiver's text. -
getText
Returns the receiver's text, which will be an empty string if it has never been set. -
setText
Sets the receiver's text at a column.- Parameters:
index
- the column indextext
- the new text- Throws:
IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the text is null
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getText
Returns the text stored at the given column index in the receiver, or empty string if the text has not been set.- Parameters:
index
- the column index- Returns:
- the text stored at the given column index in the receiver
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setToolTipText
Sets the tooltip for the given column index.- Parameters:
index
- the column indextooltip
- the tooltip text- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getToolTipText
Returns the tooltip for the given cell.- Parameters:
index
- the column index- Returns:
- the tooltip
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setImage
Sets the receiver's image to the argument, which may be null indicating that no image should be displayed. -
getImage
Returns the receiver's image if it has one, or null if it does not. -
setImage
Sets the receiver's image at a column.- Parameters:
index
- the column indeximage
- the new image- Throws:
IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the image has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getImage
Returns the image stored at the given column index in the receiver, or null if the image has not been set or if the column does not exist.- Parameters:
index
- the column index- Returns:
- the image stored at the given column index in the receiver
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setChecked
public void setChecked(boolean checked) Sets the checked state at the first column in the receiver.- Parameters:
checked
- the new checked state- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getChecked
public boolean getChecked()Returns the checked state at the first column in the receiver.- Returns:
- the checked state
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setChecked
public void setChecked(int index, boolean checked) Sets the checked state at the given column index in the receiver.- Parameters:
index
- the column indexchecked
- the new checked state- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getChecked
public boolean getChecked(int index) Returns the checked state at the given column index in the receiver.- Parameters:
index
- the column index- Returns:
- the checked state
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setGrayed
public void setGrayed(boolean grayed) Sets the grayed state of the checkbox for the first column. This state change only applies if the GridColumn was created with the SWT.CHECK style.- Parameters:
grayed
- the new grayed state of the checkbox;- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getGrayed
public boolean getGrayed()Returnstrue
if the first column in the receiver is grayed, and false otherwise. When the GridColumn does not have theCHECK
style, return false.- Returns:
- the grayed state of the checkbox
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setGrayed
public void setGrayed(int index, boolean grayed) Sets the grayed state of the checkbox for the given column index. This state change only applies if the GridColumn was created with the SWT.CHECK style.- Parameters:
index
- the column indexgrayed
- the new grayed state of the checkbox;- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getGrayed
public boolean getGrayed(int index) Returnstrue
if the column at the given index in the receiver is grayed, and false otherwise. When the GridColumn does not have theCHECK
style, return false.- Parameters:
index
- the column index- Returns:
- the grayed state of the checkbox
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setCheckable
public void setCheckable(int index, boolean checked) Sets the checkable state at the given column index in the receiver. A checkbox which is uncheckable will not be modifiable by the user but still make be modified programmatically. If the column at the given index is not checkable then individual cell will not be checkable regardless.- Parameters:
index
- the column indexchecked
- the new checked state- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getCheckable
public boolean getCheckable(int index) Returns the checkable state at the given column index in the receiver. If the column at the given index is not checkable then this will return false regardless of the individual cell's checkable state.- Parameters:
index
- the column index- Returns:
- the checked state
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setColumnSpan
public void setColumnSpan(int index, int span) Sets the column spanning for the column at the given index to span the given number of subsequent columns.- Parameters:
index
- column index that should spanspan
- number of subsequent columns to span- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.1
-
getColumnSpan
public int getColumnSpan(int index) Returns the column span for the given column index in the receiver.- Parameters:
index
- the column index- Returns:
- the number of columns spanned (0 equals no columns spanned)
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.1
-
setHeight
public void setHeight(int height) Sets the height of thisGridItem
.- Parameters:
height
- new height in pixels- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getHeight
public int getHeight()Returns the height of thisGridItem
.- Returns:
- height of this
GridItem
-
setHeaderText
Sets the receiver's row header text. If the text isnull
the row header will display the row number.- Parameters:
text
- the new text- Throws:
IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the text is null
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
getHeaderText
Returns the receiver's row header text. If the text isnull
the row header will display the row number.- Returns:
- the text stored for the row header or code
null
if the default has to be displayed - Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
setHeaderImage
Sets the receiver's row header image. If the image isnull
none is shown in the header- Parameters:
image
- the new image- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
getHeaderImage
Returns the receiver's row header image.- Returns:
- the image stored for the header or
null
if none has to be displayed - Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
setHeaderBackground
Set the new header background- Parameters:
headerBackground
- the color ornull
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
getHeaderBackground
Returns the receiver's row header background color- Returns:
- the color or
null
if none - Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
setHeaderForeground
Set the new header foreground- Parameters:
headerForeground
- the color ornull
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
getHeaderForeground
Returns the receiver's row header foreground color- Returns:
- the color or
null
if none - Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
setHeaderFont
Set the new header font- Parameters:
headerFont
- the font ornull
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
getHeaderFont
Returns the receiver's row header font- Returns:
- the font or
null
if none - Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.14
-
pack
public void pack()Sets thisGridItem
to its preferred height.- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getBounds
Returns a rectangle describing the receiver's size and location relative to its parent at a column in the table.- Parameters:
columnIndex
- the index that specifies the column- Returns:
- the receiver's bounding column rectangle
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getAdapter
Description copied from class:Widget
Implementation of theAdaptable
interface.IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code.
- Specified by:
getAdapter
in interfaceAdaptable
- Overrides:
getAdapter
in classWidget
- Parameters:
adapter
- the lookup class- Returns:
- an object that can be cast to the given class or
null
if there is no adapter associated with the given class.
-
isVisible
public boolean isVisible() -
getCellSize
-