jruby/docs BETA
org.eclipse.swt.widgets 61
C Button
C Canvas
C Caret
C ColorDialog
C Combo
C Composite
C Control
C CoolBar
C CoolItem
C DateTime
C Decorations
C Dialog
C DirectoryDialog
C Display
C Event
C ExpandBar
C ExpandItem
C FileDialog
C FontDialog
C Group
C IME
C Item
C Label
C Layout
C Link
C List
I Listener
C Menu
C MenuItem
C MessageBox
C Monitor
C ProgressBar
C Sash
C Scale
C ScrollBar
C Scrollable
C Shell
C Slider
C Spinner
C Synchronizer
C TabFolder
C TabItem
C Table
C TableColumn
C TableItem
C TaskBar
C TaskItem
C Text
C ToolBar
C ToolItem
C ToolTip
C Touch
C TouchSource
C Tracker
C Tray
C TrayItem
C Tree
C TreeColumn
C TreeItem
C TypedListener
C Widget
ColorDialog — members 7+
C new(parent)
C new(parent, style)
M open() RGB
M rg_bs() RGB[]
C rg_bs=(rgbs)
M rgb() RGB
C rgb=(rgb)
from Dialog
M parent() Shell
M style() int
M text() String
C text=(string)

org.eclipse.swt.widgets.ColorDialog

class extends Dialog 7 members

Instances of this class allow the user to select a color from a predefined set of available colors.

Styles:
(none)
Events:
(none)

IMPORTANT: This class is not intended to be subclassed.

Constructors

new

new ( Shell parent )
Java: <init>(org.eclipse.swt.widgets.Shell parent)

Constructs a new instance of this class given only its parent.

nametypedescription
parentorg.eclipse.swt.widgets.Shella composite control which will be the parent of the new instance

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

new

new ( Shell parent, int style )
Java: <init>(org.eclipse.swt.widgets.Shell parent, int style)

Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

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.

nametypedescription
parentorg.eclipse.swt.widgets.Shella composite control which will be the parent of the new instance (cannot be null)
styleintthe style of control to construct

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

Instance Methods

open

RGB open ( )
Java: open()

Makes the receiver visible and brings it to the front of the display.

Returns: the selected color, or null if the dialog was cancelled, no color was selected, or an error occurred

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

rg_bs

RGB[] rg_bs ( )
Java: getRGBs() · also: get_rg_bs

Returns an array of RGBs which are the list of custom colors selected by the user in the receiver, or null if no custom colors were selected.

Returns: the array of RGBs, which may be null

rg_bs=

rg_bs= ( RGB[] rgbs )
Java: setRGBs(org.eclipse.swt.graphics.RGB[] rgbs) · also: set_rg_bs

Sets the receiver's list of custom colors to be the given array of RGBs, which may be null to let the platform select a default when open() is called.

nametypedescription
rgbsorg.eclipse.swt.graphics.RGB[]the array of RGBs, which may be null

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if an RGB in the rgbs array is null

rgb

RGB rgb ( )
Java: getRGB() · also: get_rgb

Returns the currently selected color in the receiver.

Returns: the RGB value for the selected color, may be null

rgb=

rgb= ( RGB rgb )
Java: setRGB(org.eclipse.swt.graphics.RGB rgb) · also: set_rgb

Sets the receiver's selected color to be the argument.

nametypedescription
rgborg.eclipse.swt.graphics.RGBthe new RGB value for the selected color, may be null to let the platform select a default when open() is called

Inherited

from Dialog

parent

Shell parent ( )
Java: getParent() · also: get_parent

Returns the receiver's parent, which must be a Shell or null.

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

style

int style ( )
Java: getStyle() · also: get_style

Returns the receiver's style information.

Note that, the value which is returned by this method may not match the value which was provided to the constructor when the receiver was created.

Returns: the style bits

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

text

String text ( )
Java: getText() · also: get_text

Returns the receiver's text, which is the string that the window manager will typically display as the receiver's title. If the text has not previously been set, returns an empty string.

Returns: the 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

text=

text= ( String string )
Java: setText(String string) · also: set_text

Sets the receiver's text, which is the string that the window manager will typically display as the receiver's title, to the argument, which must not be null.

nametypedescription
stringStringthe 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