public class RadioItem
extends org.eclipse.swt.widgets.Item
Note: Only one of the styles LEFT, RIGHT, and CENTER may be specified.
IMPORTANT: This class is not intended to be subclassed.
Constructor and Description |
---|
RadioItem(RadioGroup parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
RadioItem(RadioGroup parent,
int style,
int index)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance,
and the index at which to place it in the items maintained
by its parent.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
clear() |
(package private) void |
deselect() |
org.eclipse.swt.graphics.Color |
getBackground()
Returns the receiver's background color.
|
org.eclipse.swt.widgets.Button |
getButton() |
org.eclipse.swt.graphics.Font |
getFont()
Returns the font that the receiver will use to paint textual information.
|
org.eclipse.swt.graphics.Color |
getForeground()
Returns the foreground color that the receiver will use to draw.
|
org.eclipse.swt.graphics.Image |
getImage() |
RadioGroup |
getParent()
Returns the receiver's RadioGroup parent.
|
java.lang.String |
getText() |
boolean |
isSelected()
Returns
true if the receiver is selected,
and false otherwise. |
(package private) void |
select() |
void |
setBackground(org.eclipse.swt.graphics.Color background)
Sets the receiver's background color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setFont(org.eclipse.swt.graphics.Font font)
Sets the font that the receiver will use to paint textual information
to the font specified by the argument, or to the default font for that
kind of control if the argument is null.
|
void |
setForeground(org.eclipse.swt.graphics.Color foreground)
Sets the receiver's foreground color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setImage(org.eclipse.swt.graphics.Image image) |
void |
setText(java.lang.String string) |
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public RadioItem(RadioGroup parent, int style)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent
- a widget which will be the parent of the new instance (cannot be null)style
- the style of item to constructjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SWT
,
Widget.getStyle()
public RadioItem(RadioGroup parent, int style, int index)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent
- a widget which will be the parent of the new instance (cannot be null)style
- the style of item to constructindex
- the zero-relative index at which to store the receiver in its parentjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SWT
,
Widget.getStyle()
void clear()
void deselect()
public org.eclipse.swt.graphics.Color getBackground()
Note: This operation is a hint and may be overridden by the platform. For example, on some versions of Windows the background of a TabFolder, is a gradient rather than a solid color.
org.eclipse.swt.SWTException
- public org.eclipse.swt.widgets.Button getButton()
public org.eclipse.swt.graphics.Font getFont()
org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Color getForeground()
org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Image getImage()
getImage
in class org.eclipse.swt.widgets.Item
Item.getImage()
public RadioGroup getParent()
org.eclipse.swt.SWTException
- public java.lang.String getText()
getText
in class org.eclipse.swt.widgets.Item
Item.getText()
public boolean isSelected()
true
if the receiver is selected,
and false otherwise.
When the receiver is of type CHECK
or RADIO
,
it is selected when it is checked. When it is of type TOGGLE
,
it is selected when it is pushed in. If the receiver is of any other type,
this method returns false.
org.eclipse.swt.SWTException
- void select()
public void setBackground(org.eclipse.swt.graphics.Color background)
Note: This operation is a hint and may be overridden by the platform.
color
- the new color (or null)java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setFont(org.eclipse.swt.graphics.Font font)
font
- the new font (or null)java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setForeground(org.eclipse.swt.graphics.Color foreground)
Note: This operation is a hint and may be overridden by the platform.
color
- the new color (or null)java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setImage(org.eclipse.swt.graphics.Image image)
setImage
in class org.eclipse.swt.widgets.Item
Item.setImage(org.eclipse.swt.graphics.Image)
public void setText(java.lang.String string)
setText
in class org.eclipse.swt.widgets.Item
Item.setText(java.lang.String)