Constructor and Description |
---|
GridItem(Grid parent,
int style)
Creates a new instance of this class and places the item at the end of
the grid.
|
GridItem(Grid parent,
int style,
int index)
Creates a new instance of this class and places the item in the grid at
the given index.
|
GridItem(GridItem parent,
int style)
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.
|
GridItem(GridItem parent,
int style,
int index)
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.
|
Modifier and Type | Method and Description |
---|---|
void |
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(java.lang.Class<T> adapter)
Implementation of the
Adaptable interface. |
Color |
getBackground()
Returns the receiver's background color.
|
Color |
getBackground(int index)
Returns the background color at the given column index in the receiver.
|
Rectangle |
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 |
getChecked()
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.
|
Font |
getFont()
Returns the font that the receiver will use to paint textual information
for this item.
|
Font |
getFont(int index)
Returns the font that the receiver will use to paint textual information
for the specified cell in this item.
|
Color |
getForeground()
Returns the foreground color that the receiver will use to draw.
|
Color |
getForeground(int index)
Returns the foreground color at the given column index in the receiver.
|
boolean |
getGrayed()
Returns
true if the first column in the receiver is grayed,
and false otherwise. |
boolean |
getGrayed(int index)
Returns
true if the column at the given index in the
receiver is grayed, and false otherwise. |
Color |
getHeaderBackground()
Returns the receiver's row header background color
|
Font |
getHeaderFont()
Returns the receiver's row header font
|
Color |
getHeaderForeground()
Returns the receiver's row header foreground color
|
Image |
getHeaderImage()
Returns the receiver's row header image.
|
java.lang.String |
getHeaderText()
Returns the receiver's row header text.
|
int |
getHeight()
Returns the height of this
GridItem . |
Image |
getImage()
Returns the receiver's image if it has one, or null
if it does not.
|
Image |
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.
|
GridItem |
getItem(int index)
Returns the item at the given, zero-relative index in the receiver.
|
int |
getItemCount()
Returns the number of items contained in the receiver that are direct
item children of the receiver.
|
GridItem[] |
getItems()
Returns a (possibly empty) array of
GridItem s which are the
direct item children of the receiver. |
int |
getLevel()
Returns the level of this item in the tree.
|
Grid |
getParent()
Returns the receiver's parent, which must be a
Grid . |
GridItem |
getParentItem()
Returns the receiver's parent item, which must be a
GridItem
or null when the receiver is a root. |
java.lang.String |
getText()
Returns the receiver's text, which will be an empty
string if it has never been set.
|
java.lang.String |
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.
|
java.lang.String |
getToolTipText(int index)
Returns the tooltip for the given cell.
|
boolean |
hasChildren()
Returns true if this item has children.
|
int |
indexOf(GridItem item)
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 |
isExpanded()
Returns
true if the receiver is expanded, and false
otherwise. |
boolean |
isVisible() |
void |
pack()
Sets this
GridItem to its preferred height. |
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 |
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 |
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 |
setFont(Font font)
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 |
setFont(int index,
Font font)
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 |
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 |
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 |
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 background
|
void |
setHeaderFont(Font headerFont)
Set the new header font
|
void |
setHeaderForeground(Color headerForeground)
Set the new header foreground
|
void |
setHeaderImage(Image image)
Sets the receiver's row header image.
|
void |
setHeaderText(java.lang.String text)
Sets the receiver's row header text.
|
void |
setHeight(int height)
Sets the height of this
GridItem . |
void |
setImage(Image image)
Sets the receiver's image to the argument, which may be
null indicating that no image should be displayed.
|
void |
setImage(int index,
Image image)
Sets the receiver's image at a column.
|
void |
setText(int index,
java.lang.String text)
Sets the receiver's text at a column.
|
void |
setText(java.lang.String string)
Sets the receiver's text.
|
void |
setToolTipText(int index,
java.lang.String tooltip)
Sets the tooltip for the given column index.
|
addDisposeListener, addListener, checkSubclass, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public GridItem(Grid parent, int style)
parent
- parent gridstyle
- item stylejava.lang.IllegalArgumentException
- SWTException
- public GridItem(Grid parent, int style, int index)
parent
- parent gridstyle
- item styleindex
- index where to insert itemjava.lang.IllegalArgumentException
- SWTException
- public GridItem(GridItem parent, int style)
parent
- parent itemstyle
- item stylejava.lang.IllegalArgumentException
- SWTException
- public GridItem(GridItem parent, int style, int index)
parent
- parent itemstyle
- item styleindex
- index to place itemjava.lang.IllegalArgumentException
- SWTException
- public void dispose()
true
when sent the message isDisposed()
.
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.
public void fireEvent(int eventId)
eventId
- SWT event constantSWTException
- public void fireCheckEvent(int column)
column
- the column where the checkbox residesSWTException
- public Grid getParent()
Grid
.SWTException
- public GridItem getParentItem()
GridItem
or null when the receiver is a root.SWTException
- public int getItemCount()
SWTException
- public GridItem[] getItems()
GridItem
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.
SWTException
- public GridItem getItem(int index)
index
- the index of the item to returnjava.lang.IllegalArgumentException
- SWTException
- public int indexOf(GridItem item)
item
- the search itemjava.lang.IllegalArgumentException
- SWTException
- public boolean hasChildren()
SWTException
- public boolean isExpanded()
true
if the receiver is expanded, and false
otherwise.
SWTException
- public void setExpanded(boolean expanded)
expanded
- the new expanded stateSWTException
- public int getLevel()
SWTException
- public void setFont(Font font)
font
- the new font (or null)java.lang.IllegalArgumentException
- SWTException
- public Font getFont()
SWTException
- public void setFont(int index, Font font)
index
- the column indexfont
- the new font (or null)java.lang.IllegalArgumentException
- SWTException
- public Font getFont(int index)
index
- the column indexSWTException
- public void setBackground(Color background)
background
- the new color (or null)java.lang.IllegalArgumentException
- SWTException
- public Color getBackground()
SWTException
- public void setBackground(int index, Color background)
index
- the column indexbackground
- the new color (or null)java.lang.IllegalArgumentException
- SWTException
- public Color getBackground(int index)
index
- the column indexSWTException
- public void setForeground(Color foreground)
foreground
- the new color (or null)java.lang.IllegalArgumentException
- SWTException
- public Color getForeground()
SWTException
- public void setForeground(int index, Color foreground)
index
- the column indexforeground
- the new color (or null)java.lang.IllegalArgumentException
- SWTException
- public Color getForeground(int index)
index
- the column indexSWTException
- public void setText(java.lang.String string)
public java.lang.String getText()
public void setText(int index, java.lang.String text)
index
- the column indextext
- the new textjava.lang.IllegalArgumentException
- SWTException
- public java.lang.String getText(int index)
index
- the column indexSWTException
- public void setToolTipText(int index, java.lang.String tooltip)
index
- the column indextooltip
- the tooltip textSWTException
- public java.lang.String getToolTipText(int index)
index
- the column indexSWTException
- public void setImage(Image image)
public Image getImage()
public void setImage(int index, Image image)
index
- the column indeximage
- the new imagejava.lang.IllegalArgumentException
- SWTException
- public Image getImage(int index)
index
- the column indexSWTException
- public void setChecked(boolean checked)
checked
- the new checked stateSWTException
- public boolean getChecked()
SWTException
- public void setChecked(int index, boolean checked)
index
- the column indexchecked
- the new checked stateSWTException
- public boolean getChecked(int index)
index
- the column indexSWTException
- public void setGrayed(boolean grayed)
grayed
- the new grayed state of the checkbox;SWTException
- public boolean getGrayed()
true
if the first column in the receiver is grayed,
and false otherwise. When the GridColumn does not have the
CHECK
style, return false.SWTException
- public void setGrayed(int index, boolean grayed)
index
- the column indexgrayed
- the new grayed state of the checkbox;SWTException
- public boolean getGrayed(int index)
true
if the column at the given index in the
receiver is grayed, and false otherwise. When the GridColumn does not
have the CHECK
style, return false.index
- the column indexSWTException
- public void setCheckable(int index, boolean checked)
index
- the column indexchecked
- the new checked stateSWTException
- public boolean getCheckable(int index)
index
- the column indexSWTException
- public void setColumnSpan(int index, int span)
index
- column index that should spanspan
- number of subsequent columns to spanSWTException
- public int getColumnSpan(int index)
index
- the column indexSWTException
- public void setHeight(int height)
GridItem
.height
- new height in pixelsSWTException
- public int getHeight()
GridItem
.GridItem
public void setHeaderText(java.lang.String text)
null
the
row header will display the row number.text
- the new textjava.lang.IllegalArgumentException
- SWTException
- public java.lang.String getHeaderText()
null
the row header will display the row number.null
if
the default has to be displayedSWTException
- public void setHeaderImage(Image image)
null
none is shown in the headerimage
- the new imageSWTException
- public Image getHeaderImage()
null
if none has
to be displayedSWTException
- public void setHeaderBackground(Color headerBackground)
headerBackground
- the color or null
SWTException
- public Color getHeaderBackground()
null
if noneSWTException
- public void setHeaderForeground(Color headerForeground)
headerForeground
- the color or null
SWTException
- public Color getHeaderForeground()
null
if noneSWTException
- public void setHeaderFont(Font headerFont)
headerFont
- the font or null
SWTException
- public Font getHeaderFont()
null
if noneSWTException
- public void pack()
GridItem
to its preferred height.SWTException
- public Rectangle getBounds(int columnIndex)
columnIndex
- the index that specifies the columnSWTException
- public <T> T getAdapter(java.lang.Class<T> adapter)
Widget
Adaptable
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.
getAdapter
in interface Adaptable
getAdapter
in class Widget
adapter
- the lookup classnull
if
there is no adapter associated with the given class.public boolean isVisible()
protected Point getCellSize(int index)
Copyright (c) EclipseSource and others 2002, 2020.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0