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
Canvas — members 8+
C new(parent, style)
M caret() Caret
C caret=(caret)
C draw_background(gc, x, y, width, height)
C font=(font)
M ime() IME
C ime=(ime)
C scroll(dest_x, dest_y, x, y, width, height, all)
from Widget
C add_dispose_listener(listener)
C add_listener(event_type, listener)
M auto_direction?() boolean
M data() Object
C data=(data)
M display() Display
C dispose()
M disposed?() boolean
M get_data(key) Object
M get_listeners(event_type) Listener[]
M get_typed_listeners(event_type, listener_type) Stream<L>
M is_listening(event_type) boolean
C notify_listeners(event_type, event)
C remove_dispose_listener(listener)
C remove_listener(event_type, listener)
C reskin(flags)
C set_data(key, value)
M style() int
from Drawable
M auto_scalable?() boolean
from Control
F view NSView
M accessible() Accessible
C add_control_listener(listener)
C add_drag_detect_listener(listener)
C add_focus_listener(listener)
C add_gesture_listener(listener)
C add_help_listener(listener)
C add_key_listener(listener)
C add_menu_detect_listener(listener)
C add_mouse_listener(listener)
C add_mouse_move_listener(listener)
C add_mouse_track_listener(listener)
C add_mouse_wheel_listener(listener)
C add_paint_listener(listener)
C add_touch_listener(listener)
C add_traverse_listener(listener)
M autoscaling_mode=(autoscaling_mode) boolean
M background() Color
C background=(color)
M background_image() Image
C background_image=(image)
M border_width() int
M bounds() Rectangle
C bounds=(rect)
C capture=(capture)
M compute_size(w_hint, h_hint) Point
M cursor() Cursor
C cursor=(cursor)
M drag_detect(event) boolean
M drag_detect(event) boolean
M drag_detect() boolean
C drag_detect=(drag_detect)
M enabled() boolean
C enabled=(enabled)
M enabled?() boolean
M focus_control?() boolean
M font() Font
M force_focus() boolean
M foreground() Color
C foreground=(color)
C internal_dispose_gc(h_dc, data)
M internal_new_gc(data) long
M layout_data() Object
C layout_data=(layout_data)
M location() Point
C location=(location)
M menu() Menu
C menu=(menu)
M monitor() Monitor
C move_above(control)
C move_below(control)
M orientation() int
C orientation=(orientation)
C pack()
C pack(changed)
M parent() Composite
M parent=(parent) boolean
M print(gc) boolean
C redraw()
C redraw=(redraw)
M region() Region
C region=(region)
C remove_control_listener(listener)
C remove_drag_detect_listener(listener)
C remove_focus_listener(listener)
C remove_gesture_listener(listener)
C remove_help_listener(listener)
C remove_key_listener(listener)
C remove_menu_detect_listener(listener)
C remove_mouse_listener(listener)
C remove_mouse_move_listener(listener)
C remove_mouse_track_listener(listener)
C remove_mouse_wheel_listener(listener)
C remove_paint_listener(listener)
C remove_touch_listener(listener)
C remove_traverse_listener(listener)
M reparentable?() boolean
C request_layout()
C set_bounds(x, y, width, height)
C set_location(x, y)
C set_size(width, height)
M shell() Shell
M size() Point
C size=(size)
M text_direction() int
C text_direction=(text_direction)
M to_control(x, y) Point
M to_control(point) Point
M to_display(x, y) Point
M to_display(point) Point
M tool_tip_text() String
C tool_tip_text=(string)
M touch_enabled() boolean
C touch_enabled=(enabled)
M traverse(traversal, event) boolean
M traverse(traversal, event) boolean
M traverse(traversal) boolean
C update()
M visible() boolean
C visible=(visible)
M visible?() boolean
from Scrollable
M client_area() Rectangle
M compute_trim(x, y, width, height) Rectangle
M horizontal_bar() ScrollBar
M scrollbars_mode() int
C scrollbars_mode=(mode)
M vertical_bar() ScrollBar
from Composite
M background_mode() int
C background_mode=(mode)
C changed(changed)
M children() Control[]
M compute_size(w_hint, h_hint, changed) Point
C draw_background(gc, x, y, width, height, offset_x, offset_y)
M layout() Layout
C layout()
C layout(changed)
C layout(changed, all)
C layout(changed)
C layout(changed, flags)
C layout=(layout)
M layout_deferred() boolean
C layout_deferred=(defer)
M layout_deferred?() boolean
C redraw(x, y, width, height, all)
M set_focus() boolean
M tab_list() Control[]
C tab_list=(tab_list)
M to_string() String

org.eclipse.swt.widgets.Canvas

class extends Composite 8 members

Instances of this class provide a surface for drawing arbitrary graphics.

Styles:
(none)
Events:
(none)

This class may be subclassed by custom control implementors who are building controls that are not constructed from aggregates of other controls. That is, they are either painted using SWT graphics calls or are handled by native methods.

Constructors

new

new ( Composite parent, int style )
Java: <init>(org.eclipse.swt.widgets.Composite 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.Compositea 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

Instance Methods

caret

Caret caret ( )
Java: getCaret() · also: get_caret

Returns the caret.

The caret for the control is automatically hidden and shown when the control is painted or resized, when focus is gained or lost and when an the control is scrolled. To avoid drawing on top of the caret, the programmer must hide and show the caret when drawing in the window any other time.

Returns: the caret for the receiver, may be null

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

caret=

caret= ( Caret caret )
Java: setCaret(org.eclipse.swt.widgets.Caret caret) · also: set_caret

Sets the receiver's caret.

The caret for the control is automatically hidden and shown when the control is painted or resized, when focus is gained or lost and when an the control is scrolled. To avoid drawing on top of the caret, the programmer must hide and show the caret when drawing in the window any other time.

nametypedescription
caretorg.eclipse.swt.widgets.Caretthe new caret for the receiver, may be null

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if the caret 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

draw_background

draw_background ( GC gc, int x, int y, int width, int height )
Java: drawBackground(org.eclipse.swt.graphics.GC gc, int x, int y, int width, int height)

Fills the interior of the rectangle specified by the arguments, with the receiver's background.

nametypedescription
gcorg.eclipse.swt.graphics.GCthe gc where the rectangle is to be filled
xintthe x coordinate of the rectangle to be filled
yintthe y coordinate of the rectangle to be filled
widthintthe width of the rectangle to be filled
heightintthe height of the rectangle to be filled

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the gc is null
  • ERROR_INVALID_ARGUMENT - if the gc 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

font=

font= ( Font font )
Java: setFont(org.eclipse.swt.graphics.Font font) · also: set_font

ime

IME ime ( )
Java: getIME() · also: get_ime

Returns the IME.

Returns: the IME

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

ime=

ime= ( IME ime )
Java: setIME(org.eclipse.swt.widgets.IME ime) · also: set_ime

Sets the receiver's IME.

nametypedescription
imeorg.eclipse.swt.widgets.IMEthe new IME for the receiver, may be null

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if the IME 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

scroll

scroll ( int dest_x, int dest_y, int x, int y, int width, int height, boolean all )
Java: scroll(int destX, int destY, int x, int y, int width, int height, boolean all)

Scrolls a rectangular area of the receiver by first copying the source area to the destination and then causing the area of the source which is not covered by the destination to be repainted. Children that intersect the rectangle are optionally moved during the operation. In addition, all outstanding paint events are flushed before the source area is copied to ensure that the contents of the canvas are drawn correctly.

nametypedescription
dest_xintthe x coordinate of the destination
dest_yintthe y coordinate of the destination
xintthe x coordinate of the source
yintthe y coordinate of the source
widthintthe width of the area
heightintthe height of the area
allbooleantrueif children should be scrolled, and false otherwise

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

Inherited

from Widget

add_dispose_listener

add_dispose_listener ( DisposeListener listener )
Java: addDisposeListener(org.eclipse.swt.events.DisposeListener listener)

Adds the listener to the collection of listeners who will be notified when the widget is disposed. When the widget is disposed, the listener is notified by sending it the widgetDisposed() message.

nametypedescription
listenerorg.eclipse.swt.events.DisposeListenerthe listener which should be notified when the receiver is disposed

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_listener

add_listener ( int event_type, Listener listener )
Java: addListener(int eventType, org.eclipse.swt.widgets.Listener listener)

Adds the listener to the collection of listeners who will be notified when an event of the given type occurs. When the event does occur in the widget, the listener is notified by sending it the handleEvent() message. The event type is one of the event constants defined in class SWT.

nametypedescription
event_typeintthe type of event to listen for
listenerorg.eclipse.swt.widgets.Listenerthe listener which should be notified when the event occurs

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

auto_direction?

boolean auto_direction? ( )
Java: isAutoDirection() · also: is_auto_direction

Returns true if the widget has auto text direction, and false otherwise.

Returns: true when the widget has auto direction and false otherwise

data

Object data ( )
Java: getData() · also: get_data

Returns the application defined widget data associated with the receiver, or null if it has not been set. The widget data is a single, unnamed field that is stored with every widget.

Applications may put arbitrary objects in this field. If the object stored in the widget data needs to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.

Returns: the widget data

Throws

SWTException
  • ERROR_WIDGET_DISPOSED - when the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread

data=

data= ( Object data )
Java: setData(Object data) · also: set_data

Sets the application defined widget data associated with the receiver to be the argument. The widget data is a single, unnamed field that is stored with every widget.

Applications may put arbitrary objects in this field. If the object stored in the widget data needs to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.

nametypedescription
dataObjectthe widget data

Throws

SWTException
  • ERROR_WIDGET_DISPOSED - when the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread

display

Display display ( )
Java: getDisplay() · also: get_display

Returns the Display that is associated with the receiver.

A widget's display is either provided when it is created (for example, top level Shells) or is the same as its parent's display.

Returns: the receiver's display

Throws

SWTException
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed

dispose

dispose ( )
Java: dispose()

Disposes of the operating system resources associated with the receiver and all its descendants. After this method has been invoked, the receiver and all descendants will answer true when sent the message isDisposed(). Any internal connections between the widgets in the tree will have been removed to facilitate garbage collection. This method does nothing if the widget is already disposed.

NOTE: This method is not called recursively on the descendants 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.

Throws

SWTException
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

disposed?

boolean disposed? ( )
Java: isDisposed() · also: is_disposed

Returns true if the widget has been disposed, and false otherwise.

This method gets the dispose state for the widget. When a widget has been disposed, it is an error to invoke any other method (except #dispose()) using the widget.

Returns: true when the widget is disposed and false otherwise

get_data

Object get_data ( String key )
Java: getData(String key)

Returns the application defined property of the receiver with the specified name, or null if it has not been set.

Applications may have associated arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.

nametypedescription
keyStringthe name of the property

Returns: the value of the property or null if it has not been set

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the key 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

get_listeners

Listener[] get_listeners ( int event_type )
Java: getListeners(int eventType)

Returns an array of listeners who will be notified when an event of the given type occurs. The event type is one of the event constants defined in class SWT.

nametypedescription
event_typeintthe type of event to listen for

Returns: an array of listeners that will be notified when the event occurs

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

get_typed_listeners

Stream<L> get_typed_listeners ( int event_type, Class<L> listener_type )
Java: getTypedListeners(int eventType, Class<L> listenerType)

Returns the typed listeners who will be notified when an event of the given type occurs. The event type is one of the event constants defined in class SWT and the specified listener-type must correspond to that event. If for example the eventType is SWT#Selection, the listeners type should be SelectionListener.

nametypedescription
event_typeintthe type of event to listen for

Returns: a stream of typed listeners that will be notified when the event occurs

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

is_listening

boolean is_listening ( int event_type )
Java: isListening(int eventType)

Returns true if there are any listeners for the specified event type associated with the receiver, and false otherwise. The event type is one of the event constants defined in class SWT.

nametypedescription
event_typeintthe type of event

Returns: true if the event is hooked

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

notify_listeners

notify_listeners ( int event_type, Event event )
Java: notifyListeners(int eventType, org.eclipse.swt.widgets.Event event)

Notifies all of the receiver's listeners for events of the given type that one such event has occurred by invoking their handleEvent() method. The event type is one of the event constants defined in class SWT.

nametypedescription
event_typeintthe type of event which has occurred
eventorg.eclipse.swt.widgets.Eventthe event data

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

remove_dispose_listener

remove_dispose_listener ( DisposeListener listener )
Java: removeDisposeListener(org.eclipse.swt.events.DisposeListener listener)

Removes the listener from the collection of listeners who will be notified when the widget is disposed.

nametypedescription
listenerorg.eclipse.swt.events.DisposeListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_listener

remove_listener ( int event_type, Listener listener )
Java: removeListener(int eventType, org.eclipse.swt.widgets.Listener listener)

Removes the listener from the collection of listeners who will be notified when an event of the given type occurs. The event type is one of the event constants defined in class SWT.

nametypedescription
event_typeintthe type of event to listen for
listenerorg.eclipse.swt.widgets.Listenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

reskin

reskin ( int flags )
Java: reskin(int flags)

Marks the widget to be skinned.

The skin event is sent to the receiver's display when appropriate (usually before the next event is handled). Widgets are automatically marked for skinning upon creation as well as when its skin id or class changes. The skin id and/or class can be changed by calling Display#setData(String, Object) with the keys SWT#SKIN_ID and/or SWT#SKIN_CLASS. Once the skin event is sent to a widget, it will not be sent again unless reskin(int) is called on the widget or on an ancestor while specifying the SWT.ALL flag.

The parameter flags may be either:

SWT#ALL
all children in the receiver's widget tree should be skinned
SWT#NONE
only the receiver should be skinned

nametypedescription
flagsintthe flags specifying how to reskin

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

set_data

set_data ( String key, Object value )
Java: setData(String key, Object value)

Sets the application defined property of the receiver with the specified name to the given value.

Applications may associate arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.

nametypedescription
keyStringthe name of the property
valueObjectthe new value for the property

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the key 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

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. This can occur when the underlying operating system does not support a particular combination of requested styles. For example, if the platform widget used to implement a particular SWT widget always has scroll bars, the result of calling this method would always have the SWT.H_SCROLL and SWT.V_SCROLL bits set.

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

from Drawable

auto_scalable?

boolean auto_scalable? ( )
Java: isAutoScalable() · also: is_auto_scalable

Returns true iff coordinates can be auto-scaled on this drawable and false if not. E.g. a GC method should not auto-scale the bounds of a figure drawn on a Printer device, but it may have to auto-scale when drawing on a high-DPI Display monitor.

Returns: true if auto-scaling is enabled for this drawable

from Control

fieldtypenote
view NSView the handle to the OS resource (Warning: This field is platform dependent)

IMPORTANT: This field is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code.

accessible

Accessible accessible ( )
Java: getAccessible() · also: get_accessible

Returns the accessible object for the receiver.

If this is the first time this object is requested, then the object is created and returned. The object returned by getAccessible() does not need to be disposed.

Returns: the accessible object

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

add_control_listener

add_control_listener ( ControlListener listener )
Java: addControlListener(org.eclipse.swt.events.ControlListener listener)

Adds the listener to the collection of listeners who will be notified when the control is moved or resized, by sending it one of the messages defined in the ControlListener interface.

nametypedescription
listenerorg.eclipse.swt.events.ControlListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_drag_detect_listener

add_drag_detect_listener ( DragDetectListener listener )
Java: addDragDetectListener(org.eclipse.swt.events.DragDetectListener listener)

Adds the listener to the collection of listeners who will be notified when a drag gesture occurs, by sending it one of the messages defined in the DragDetectListener interface.

nametypedescription
listenerorg.eclipse.swt.events.DragDetectListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_focus_listener

add_focus_listener ( FocusListener listener )
Java: addFocusListener(org.eclipse.swt.events.FocusListener listener)

Adds the listener to the collection of listeners who will be notified when the control gains or loses focus, by sending it one of the messages defined in the FocusListener interface.

nametypedescription
listenerorg.eclipse.swt.events.FocusListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_gesture_listener

add_gesture_listener ( GestureListener listener )
Java: addGestureListener(org.eclipse.swt.events.GestureListener listener)

Adds the listener to the collection of listeners who will be notified when gesture events are generated for the control, by sending it one of the messages defined in the GestureListener interface.

NOTE: If setTouchEnabled(true) has previously been invoked on the receiver then setTouchEnabled(false) must be invoked on it to specify that gesture events should be sent instead of touch events.

Warning: This API is currently only implemented on Windows and Cocoa. SWT doesn't send Gesture or Touch events on GTK.

nametypedescription
listenerorg.eclipse.swt.events.GestureListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_help_listener

add_help_listener ( HelpListener listener )
Java: addHelpListener(org.eclipse.swt.events.HelpListener listener)

Adds the listener to the collection of listeners who will be notified when help events are generated for the control, by sending it one of the messages defined in the HelpListener interface.

nametypedescription
listenerorg.eclipse.swt.events.HelpListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_key_listener

add_key_listener ( KeyListener listener )
Java: addKeyListener(org.eclipse.swt.events.KeyListener listener)

Adds the listener to the collection of listeners who will be notified when keys are pressed and released on the system keyboard, by sending it one of the messages defined in the KeyListener interface.

When a key listener is added to a control, the control will take part in widget traversal. By default, all traversal keys (such as the tab key and so on) are delivered to the control. In order for a control to take part in traversal, it should listen for traversal events. Otherwise, the user can traverse into a control but not out. Note that native controls such as table and tree implement key traversal in the operating system. It is not necessary to add traversal listeners for these controls, unless you want to override the default traversal.

nametypedescription
listenerorg.eclipse.swt.events.KeyListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_menu_detect_listener

add_menu_detect_listener ( MenuDetectListener listener )
Java: addMenuDetectListener(org.eclipse.swt.events.MenuDetectListener listener)

Adds the listener to the collection of listeners who will be notified when the platform-specific context menu trigger has occurred, by sending it one of the messages defined in the MenuDetectListener interface.

nametypedescription
listenerorg.eclipse.swt.events.MenuDetectListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_mouse_listener

add_mouse_listener ( MouseListener listener )
Java: addMouseListener(org.eclipse.swt.events.MouseListener listener)

Adds the listener to the collection of listeners who will be notified when mouse buttons are pressed and released, by sending it one of the messages defined in the MouseListener interface.

nametypedescription
listenerorg.eclipse.swt.events.MouseListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_mouse_move_listener

add_mouse_move_listener ( MouseMoveListener listener )
Java: addMouseMoveListener(org.eclipse.swt.events.MouseMoveListener listener)

Adds the listener to the collection of listeners who will be notified when the mouse moves, by sending it one of the messages defined in the MouseMoveListener interface.

nametypedescription
listenerorg.eclipse.swt.events.MouseMoveListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_mouse_track_listener

add_mouse_track_listener ( MouseTrackListener listener )
Java: addMouseTrackListener(org.eclipse.swt.events.MouseTrackListener listener)

Adds the listener to the collection of listeners who will be notified when the mouse passes or hovers over controls, by sending it one of the messages defined in the MouseTrackListener interface.

nametypedescription
listenerorg.eclipse.swt.events.MouseTrackListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_mouse_wheel_listener

add_mouse_wheel_listener ( MouseWheelListener listener )
Java: addMouseWheelListener(org.eclipse.swt.events.MouseWheelListener listener)

Adds the listener to the collection of listeners who will be notified when the mouse wheel is scrolled, by sending it one of the messages defined in the MouseWheelListener interface.

nametypedescription
listenerorg.eclipse.swt.events.MouseWheelListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_paint_listener

add_paint_listener ( PaintListener listener )
Java: addPaintListener(org.eclipse.swt.events.PaintListener listener)

Adds the listener to the collection of listeners who will be notified when the receiver needs to be painted, by sending it one of the messages defined in the PaintListener interface.

nametypedescription
listenerorg.eclipse.swt.events.PaintListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_touch_listener

add_touch_listener ( TouchListener listener )
Java: addTouchListener(org.eclipse.swt.events.TouchListener listener)

Adds the listener to the collection of listeners who will be notified when touch events occur, by sending it one of the messages defined in the TouchListener interface.

NOTE: You must also call setTouchEnabled(true) to specify that touch events should be sent, which will cause gesture events to not be sent.

Warning: This API is currently only implemented on Windows and Cocoa. SWT doesn't send Gesture or Touch events on GTK.

nametypedescription
listenerorg.eclipse.swt.events.TouchListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

add_traverse_listener

add_traverse_listener ( TraverseListener listener )
Java: addTraverseListener(org.eclipse.swt.events.TraverseListener listener)

Adds the listener to the collection of listeners who will be notified when traversal events occur, by sending it one of the messages defined in the TraverseListener interface.

nametypedescription
listenerorg.eclipse.swt.events.TraverseListenerthe listener which should be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

autoscaling_mode=

boolean autoscaling_mode= ( AutoscalingMode autoscaling_mode )
Java: setAutoscalingMode(org.eclipse.swt.graphics.AutoscalingMode autoscalingMode) · also: set_autoscaling_mode

Sets the autoscaling mode for this widget. The capability is not supported on every platform, such that calling this method may not have an effect on unsupported platforms. The return value indicates if the autoscale mode was set properly. With #isAutoScalable(), the autoscale enablement can also be evaluated at any later point in time.

Currently, this is only supported on Windows.

nametypedescription
autoscaling_modeorg.eclipse.swt.graphics.AutoscalingModethe autoscaling mode to set

Returns: false if the operation was called on an unsupported platform

background

Color background ( )
Java: getBackground() · also: get_background

Returns the receiver's background color.

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.

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

background=

background= ( Color color )
Java: setBackground(org.eclipse.swt.graphics.Color color) · also: set_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.

Note: This operation is a hint and may be overridden by the platform.

Note: The background color can be overridden by setting a background image.

nametypedescription
colororg.eclipse.swt.graphics.Colorthe 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

background_image

Image background_image ( )
Java: getBackgroundImage() · also: get_background_image

Returns the receiver's background image.

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

background_image=

background_image= ( Image image )
Java: setBackgroundImage(org.eclipse.swt.graphics.Image image) · also: set_background_image

Sets the receiver's background image to the image specified by the argument, or to the default system color for the control if the argument is null. The background image is tiled to fill the available space.

Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.

Note: Setting a background image overrides a set background color.

nametypedescription
imageorg.eclipse.swt.graphics.Imagethe new image (or null)

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if the argument has been disposed
  • ERROR_INVALID_ARGUMENT - if the argument is not a bitmap
SWTException
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

border_width

int border_width ( )
Java: getBorderWidth() · also: get_border_width

Returns the receiver's border width in points.

Returns: the border width

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

bounds

Rectangle bounds ( )
Java: getBounds() · also: get_bounds

Returns a rectangle describing the receiver's size and location in points relative to its parent (or its display if its parent is null), unless the receiver is a shell. In this case, the location is relative to the display.

Returns: the receiver's bounding 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

bounds=

bounds= ( Rectangle rect )
Java: setBounds(org.eclipse.swt.graphics.Rectangle rect) · also: set_bounds

Sets the receiver's size and location in points to the rectangular area specified by the argument. The x and y fields of the rectangle are relative to the receiver's parent (or its display if its parent is null).

Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.

Note: On GTK, attempting to set the width or height of the receiver to a number higher or equal 2^14 will cause them to be set to (2^14)-1 instead.

nametypedescription
rectorg.eclipse.swt.graphics.Rectanglethe new bounds for 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

capture=

capture= ( boolean capture )
Java: setCapture(boolean capture) · also: set_capture

If the argument is true, causes the receiver to have all mouse events delivered to it until the method is called with false as the argument. Note that on some platforms, a mouse button must currently be down for capture to be assigned.

nametypedescription
capturebooleantrue to capture the mouse, and false to release it

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

compute_size

Point compute_size ( int w_hint, int h_hint )
Java: computeSize(int wHint, int hHint)

Returns the preferred size (in points) of the receiver.

The preferred size of a control is the size that it would best be displayed at. The width hint and height hint arguments allow the caller to ask a control questions such as "Given a particular width, how high does the control need to be to show all of the contents?" To indicate that the caller does not wish to constrain a particular dimension, the constant SWT.DEFAULT is passed for the hint.

nametypedescription
w_hintintthe width hint (can be SWT.DEFAULT)
h_hintintthe height hint (can be SWT.DEFAULT)

Returns: the preferred size of the control

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

cursor

Cursor cursor ( )
Java: getCursor() · also: get_cursor

Returns the receiver's cursor, or null if it has not been set.

When the mouse pointer passes over a control its appearance is changed to match the control's cursor.

Returns: the receiver's cursor or null

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

cursor=

cursor= ( Cursor cursor )
Java: setCursor(org.eclipse.swt.graphics.Cursor cursor) · also: set_cursor

Sets the receiver's cursor to the cursor specified by the argument, or to the default cursor for that kind of control if the argument is null.

When the mouse pointer passes over a control its appearance is changed to match the control's cursor.

nametypedescription
cursororg.eclipse.swt.graphics.Cursorthe new cursor (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

drag_detect

boolean drag_detect ( Event event )
Java: dragDetect(org.eclipse.swt.widgets.Event event)

Detects a drag and drop gesture. This method is used to detect a drag gesture when called from within a mouse down listener.

By default, a drag is detected when the gesture occurs anywhere within the client area of a control. Some controls, such as tables and trees, override this behavior. In addition to the operating system specific drag gesture, they require the mouse to be inside an item. Custom widget writers can use setDragDetect to disable the default detection, listen for mouse down, and then call dragDetect() from within the listener to conditionally detect a drag.

nametypedescription
eventorg.eclipse.swt.widgets.Eventthe mouse down event

Returns: true if the gesture occurred, and false otherwise.

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT if the event 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

drag_detect

boolean drag_detect ( MouseEvent event )
Java: dragDetect(org.eclipse.swt.events.MouseEvent event)

Detects a drag and drop gesture. This method is used to detect a drag gesture when called from within a mouse down listener.

By default, a drag is detected when the gesture occurs anywhere within the client area of a control. Some controls, such as tables and trees, override this behavior. In addition to the operating system specific drag gesture, they require the mouse to be inside an item. Custom widget writers can use setDragDetect to disable the default detection, listen for mouse down, and then call dragDetect() from within the listener to conditionally detect a drag.

nametypedescription
eventorg.eclipse.swt.events.MouseEventthe mouse down event

Returns: true if the gesture occurred, and false otherwise.

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT if the event 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

drag_detect

boolean drag_detect ( )
Java: getDragDetect() · also: get_drag_detect

Returns true if the receiver is detecting drag gestures, and false otherwise.

Returns: the receiver's drag detect 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

drag_detect=

drag_detect= ( boolean drag_detect )
Java: setDragDetect(boolean dragDetect) · also: set_drag_detect

Sets the receiver's drag detect state. If the argument is true, the receiver will detect drag gestures, otherwise these gestures will be ignored.

nametypedescription
drag_detectbooleanthe new drag detect 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

enabled

boolean enabled ( )
Java: getEnabled() · also: get_enabled

Returns true if the receiver is enabled, and false otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Returns: the receiver's enabled 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

enabled=

enabled= ( boolean enabled )
Java: setEnabled(boolean enabled) · also: set_enabled

Enables the receiver if the argument is true, and disables it otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

nametypedescription
enabledbooleanthe new enabled 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

enabled?

boolean enabled? ( )
Java: isEnabled() · also: is_enabled

Returns true if the receiver is enabled and all ancestors up to and including the receiver's nearest ancestor shell are enabled. Otherwise, false is returned. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Returns: the receiver's enabled 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

focus_control?

boolean focus_control? ( )
Java: isFocusControl() · also: is_focus_control

Returns true if the receiver has the user-interface focus, and false otherwise.

Returns: the receiver's focus 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

font

Font font ( )
Java: getFont() · also: get_font

Returns the font that the receiver will use to paint textual information.

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

force_focus

boolean force_focus ( )
Java: forceFocus()

Forces the receiver to have the keyboard focus, causing all keyboard events to be delivered to it.

Returns: true if the control got focus, and false if it was unable to.

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

foreground

Color foreground ( )
Java: getForeground() · also: get_foreground

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

foreground=

foreground= ( Color color )
Java: setForeground(org.eclipse.swt.graphics.Color color) · also: set_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.

Note: This operation is a hint and may be overridden by the platform.

nametypedescription
colororg.eclipse.swt.graphics.Colorthe 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

internal_dispose_gc

internal_dispose_gc ( long h_dc, GCData data )
Java: internal_dispose_GC(long hDC, org.eclipse.swt.graphics.GCData data)

Invokes platform specific functionality to dispose a GC handle.

IMPORTANT: This method is not part of the public API for Control. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.

nametypedescription
h_dclongthe platform specific GC handle
dataorg.eclipse.swt.graphics.GCDatathe platform specific GC data

internal_new_gc

long internal_new_gc ( GCData data )
Java: internal_new_GC(org.eclipse.swt.graphics.GCData data)

Invokes platform specific functionality to allocate a new GC handle.

IMPORTANT: This method is not part of the public API for Control. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.

nametypedescription
dataorg.eclipse.swt.graphics.GCDatathe platform specific GC data

Returns: the platform specific GC handle

layout_data

Object layout_data ( )
Java: getLayoutData() · also: get_layout_data

Returns layout data which is associated with the receiver.

Returns: the receiver's layout data

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

layout_data=

layout_data= ( Object layout_data )
Java: setLayoutData(Object layoutData) · also: set_layout_data

Sets the layout data associated with the receiver to the argument.

nametypedescription
layout_dataObjectthe new layout data for 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

location

Point location ( )
Java: getLocation() · also: get_location

Returns a point describing the receiver's location relative to its parent in points (or its display if its parent is null), unless the receiver is a shell. In this case, the point is usually relative to the display.

Warning: When executing this operation on a shell, it may not yield a value with the expected meaning on some platforms. For example, executing this operation on a shell when the environment uses the Wayland protocol, the result is not a coordinate relative to the display. It will not change when moving the shell.

Returns: the receiver's location

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

location=

location= ( Point location )
Java: setLocation(org.eclipse.swt.graphics.Point location) · also: set_location

Sets the receiver's location to the point specified by the argument which is relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell. In this case, the point is relative to the display.

Warning: When executing this operation on a shell, it may not have the intended effect on some platforms. For example, executing this operation on a shell when the environment uses the Wayland protocol, nothing will happen.

nametypedescription
locationorg.eclipse.swt.graphics.Pointthe new location for 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

menu

Menu menu ( )
Java: getMenu() · also: get_menu

Returns the receiver's pop up menu if it has one, or null if it does not. All controls may optionally have a pop up menu that is displayed when the user requests one for the control. The sequence of key strokes, button presses and/or button releases that are used to request a pop up menu is platform specific.

Returns: the receiver's menu

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

menu=

menu= ( Menu menu )
Java: setMenu(org.eclipse.swt.widgets.Menu menu) · also: set_menu

Sets the receiver's pop up menu to the argument. All controls may optionally have a pop up menu that is displayed when the user requests one for the control. The sequence of key strokes, button presses and/or button releases that are used to request a pop up menu is platform specific.

Note: Disposing of a control that has a pop up menu will dispose of the menu. To avoid this behavior, set the menu to null before the control is disposed.

nametypedescription
menuorg.eclipse.swt.widgets.Menuthe new pop up menu

Throws

IllegalArgumentException
  • ERROR_MENU_NOT_POP_UP - the menu is not a pop up menu
  • ERROR_INVALID_PARENT - if the menu is not in the same widget tree
  • ERROR_INVALID_ARGUMENT - if the menu 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

monitor

Monitor monitor ( )
Java: getMonitor() · also: get_monitor

Returns the receiver's monitor.

Returns: the receiver's monitor

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

move_above

move_above ( Control control )
Java: moveAbove(org.eclipse.swt.widgets.Control control)

Moves the receiver above the specified control in the drawing order. If the argument is null, then the receiver is moved to the top of the drawing order. The control at the top of the drawing order will not be covered by other controls even if they occupy intersecting areas.

nametypedescription
controlorg.eclipse.swt.widgets.Controlthe sibling control (or null)

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if the control 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

move_below

move_below ( Control control )
Java: moveBelow(org.eclipse.swt.widgets.Control control)

Moves the receiver below the specified control in the drawing order. If the argument is null, then the receiver is moved to the bottom of the drawing order. The control at the bottom of the drawing order will be covered by all other controls which occupy intersecting areas.

nametypedescription
controlorg.eclipse.swt.widgets.Controlthe sibling control (or null)

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if the control 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

orientation

int orientation ( )
Java: getOrientation() · also: get_orientation

Returns the orientation of the receiver, which will be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.

Returns: the orientation style

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

orientation=

orientation= ( int orientation )
Java: setOrientation(int orientation) · also: set_orientation

Sets the orientation of the receiver, which must be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.

nametypedescription
orientationintnew orientation style

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

pack

pack ( )
Java: pack()

Causes the receiver to be resized to its preferred size. For a composite, this involves computing the preferred size from its layout, if there is one.

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

pack

pack ( boolean changed )
Java: pack(boolean changed)

Causes the receiver to be resized to its preferred size. For a composite, this involves computing the preferred size from its layout, if there is one.

If the changed flag is true, it indicates that the receiver's contents have changed, therefore any caches that a layout manager containing the control may have been keeping need to be flushed. When the control is resized, the changed flag will be false, so layout manager caches can be retained.

nametypedescription
changedbooleanwhether or not the receiver's contents have changed

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

parent

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

Returns the receiver's parent, which must be a Composite or null when the receiver is a shell that was created with null or a display for a parent.

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

parent=

boolean parent= ( Composite parent )
Java: setParent(org.eclipse.swt.widgets.Composite parent) · also: set_parent

Changes the parent of the widget to be the one provided. Returns true if the parent is successfully changed.

nametypedescription
parentorg.eclipse.swt.widgets.Compositethe new parent for the control.

Returns: true if the parent is changed and false otherwise.

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if the argument has been disposed
  • ERROR_NULL_ARGUMENT - if the parent 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

print

boolean print ( GC gc )
Java: print(org.eclipse.swt.graphics.GC gc)

Prints the receiver and all children.

nametypedescription
gcorg.eclipse.swt.graphics.GCthe gc where the drawing occurs

Returns: true if the operation was successful and false otherwise

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the gc is null
  • ERROR_INVALID_ARGUMENT - if the gc 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

redraw

redraw ( )
Java: redraw()

Causes the entire bounds of the receiver to be marked as needing to be redrawn. The next time a paint request is processed, the control will be completely painted, including the background.

Schedules a paint request if the invalidated area is visible or becomes visible later. It is not necessary for the caller to explicitly call #update() after calling this method, but depending on the platform, the automatic repaints may be delayed considerably.

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

redraw=

redraw= ( boolean redraw )
Java: setRedraw(boolean redraw) · also: set_redraw

If the argument is false, causes subsequent drawing operations in the receiver to be ignored. No drawing of any kind can occur in the receiver until the flag is set to true. Graphics operations that occurred while the flag was false are lost. When the flag is set to true, the entire widget is marked as needing to be redrawn. Nested calls to this method are stacked.

Note: This operation is a hint and may not be supported on some platforms or for some widgets.

nametypedescription
redrawbooleanthe new redraw 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

region

Region region ( )
Java: getRegion() · also: get_region

Returns the region that defines the shape of the control, or null if the control has the default shape.

Returns: the region that defines the shape of the shell (or null)

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

region=

region= ( Region region )
Java: setRegion(org.eclipse.swt.graphics.Region region) · also: set_region

Sets the shape of the control to the region specified by the argument. When the argument is null, the default shape of the control is restored.

nametypedescription
regionorg.eclipse.swt.graphics.Regionthe region that defines the shape of the control (or null)

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if the region 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

remove_control_listener

remove_control_listener ( ControlListener listener )
Java: removeControlListener(org.eclipse.swt.events.ControlListener listener)

Removes the listener from the collection of listeners who will be notified when the control is moved or resized.

nametypedescription
listenerorg.eclipse.swt.events.ControlListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_drag_detect_listener

remove_drag_detect_listener ( DragDetectListener listener )
Java: removeDragDetectListener(org.eclipse.swt.events.DragDetectListener listener)

Removes the listener from the collection of listeners who will be notified when a drag gesture occurs.

nametypedescription
listenerorg.eclipse.swt.events.DragDetectListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_focus_listener

remove_focus_listener ( FocusListener listener )
Java: removeFocusListener(org.eclipse.swt.events.FocusListener listener)

Removes the listener from the collection of listeners who will be notified when the control gains or loses focus.

nametypedescription
listenerorg.eclipse.swt.events.FocusListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_gesture_listener

remove_gesture_listener ( GestureListener listener )
Java: removeGestureListener(org.eclipse.swt.events.GestureListener listener)

Removes the listener from the collection of listeners who will be notified when gesture events are generated for the control.

nametypedescription
listenerorg.eclipse.swt.events.GestureListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_help_listener

remove_help_listener ( HelpListener listener )
Java: removeHelpListener(org.eclipse.swt.events.HelpListener listener)

Removes the listener from the collection of listeners who will be notified when the help events are generated for the control.

nametypedescription
listenerorg.eclipse.swt.events.HelpListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_key_listener

remove_key_listener ( KeyListener listener )
Java: removeKeyListener(org.eclipse.swt.events.KeyListener listener)

Removes the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.

nametypedescription
listenerorg.eclipse.swt.events.KeyListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_menu_detect_listener

remove_menu_detect_listener ( MenuDetectListener listener )
Java: removeMenuDetectListener(org.eclipse.swt.events.MenuDetectListener listener)

Removes the listener from the collection of listeners who will be notified when the platform-specific context menu trigger has occurred.

nametypedescription
listenerorg.eclipse.swt.events.MenuDetectListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_mouse_listener

remove_mouse_listener ( MouseListener listener )
Java: removeMouseListener(org.eclipse.swt.events.MouseListener listener)

Removes the listener from the collection of listeners who will be notified when mouse buttons are pressed and released.

nametypedescription
listenerorg.eclipse.swt.events.MouseListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_mouse_move_listener

remove_mouse_move_listener ( MouseMoveListener listener )
Java: removeMouseMoveListener(org.eclipse.swt.events.MouseMoveListener listener)

Removes the listener from the collection of listeners who will be notified when the mouse moves.

nametypedescription
listenerorg.eclipse.swt.events.MouseMoveListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_mouse_track_listener

remove_mouse_track_listener ( MouseTrackListener listener )
Java: removeMouseTrackListener(org.eclipse.swt.events.MouseTrackListener listener)

Removes the listener from the collection of listeners who will be notified when the mouse passes or hovers over controls.

nametypedescription
listenerorg.eclipse.swt.events.MouseTrackListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_mouse_wheel_listener

remove_mouse_wheel_listener ( MouseWheelListener listener )
Java: removeMouseWheelListener(org.eclipse.swt.events.MouseWheelListener listener)

Removes the listener from the collection of listeners who will be notified when the mouse wheel is scrolled.

nametypedescription
listenerorg.eclipse.swt.events.MouseWheelListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_paint_listener

remove_paint_listener ( PaintListener listener )
Java: removePaintListener(org.eclipse.swt.events.PaintListener listener)

Removes the listener from the collection of listeners who will be notified when the receiver needs to be painted.

nametypedescription
listenerorg.eclipse.swt.events.PaintListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_touch_listener

remove_touch_listener ( TouchListener listener )
Java: removeTouchListener(org.eclipse.swt.events.TouchListener listener)

Removes the listener from the collection of listeners who will be notified when touch events occur.

nametypedescription
listenerorg.eclipse.swt.events.TouchListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

remove_traverse_listener

remove_traverse_listener ( TraverseListener listener )
Java: removeTraverseListener(org.eclipse.swt.events.TraverseListener listener)

Removes the listener from the collection of listeners who will be notified when traversal events occur.

nametypedescription
listenerorg.eclipse.swt.events.TraverseListenerthe listener which should no longer be notified

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the listener 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

reparentable?

boolean reparentable? ( )
Java: isReparentable() · also: is_reparentable

Returns true if the underlying operating system supports this reparenting, otherwise false

Returns: true if the widget can be reparented, otherwise false

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

request_layout

request_layout ( )
Java: requestLayout()

Requests that this control and all of its ancestors be repositioned by their layouts at the earliest opportunity. This should be invoked after modifying the control in order to inform any dependent layouts of the change.

The control will not be repositioned synchronously. This method is fast-running and only marks the control for future participation in a deferred layout.

Invoking this method multiple times before the layout occurs is an inexpensive no-op.

set_bounds

set_bounds ( int x, int y, int width, int height )
Java: setBounds(int x, int y, int width, int height)

Sets the receiver's size and location in points to the rectangular area specified by the arguments. The x and y arguments are relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell. In this case, the x and y arguments are relative to the display.

Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.

Note: On GTK, attempting to set the width or height of the receiver to a number higher or equal 2^14 will cause them to be set to (2^14)-1 instead.

nametypedescription
xintthe new x coordinate for the receiver
yintthe new y coordinate for the receiver
widthintthe new width for the receiver
heightintthe new height for 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

set_location

set_location ( int x, int y )
Java: setLocation(int x, int y)

Sets the receiver's location to the point specified by the arguments which are relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell. In this case, the point is relative to the display.

Warning: When executing this operation on a shell, it may not have the intended effect on some platforms. For example, executing this operation on a shell when the environment uses the Wayland protocol, nothing will happen.

nametypedescription
xintthe new x coordinate for the receiver
yintthe new y coordinate for 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

set_size

set_size ( int width, int height )
Java: setSize(int width, int height)

Sets the receiver's size to the point specified by the arguments.

Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.

Note: On GTK, attempting to set the width or height of the receiver to a number higher or equal 2^14 will cause them to be set to (2^14)-1 instead.

nametypedescription
widthintthe new width in points for the receiver
heightintthe new height in points for 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

shell

Shell shell ( )
Java: getShell() · also: get_shell

Returns the receiver's shell. For all controls other than shells, this simply returns the control's nearest ancestor shell. Shells return themselves, even if they are children of other shells.

Returns: the receiver's shell

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

size

Point size ( )
Java: getSize() · also: get_size

Returns a point describing the receiver's size in points. The x coordinate of the result is the width of the receiver. The y coordinate of the result is the height of the receiver.

Returns: the receiver's size

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

size=

size= ( Point size )
Java: setSize(org.eclipse.swt.graphics.Point size) · also: set_size

Sets the receiver's size to the point specified by the argument.

Note: Attempting to set the width or height of the receiver to a negative number will cause them to be set to zero instead.

Note: On GTK, attempting to set the width or height of the receiver to a number higher or equal 2^14 will cause them to be set to (2^14)-1 instead.

nametypedescription
sizeorg.eclipse.swt.graphics.Pointthe new size in points for the receiver

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the point 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

text_direction

int text_direction ( )
Java: getTextDirection() · also: get_text_direction

Returns the text direction of the receiver, which will be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.

Returns: the text direction style

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_direction=

text_direction= ( int text_direction )
Java: setTextDirection(int textDirection) · also: set_text_direction

Sets the base text direction (a.k.a. "paragraph direction") of the receiver, which must be one of the constants SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, or SWT.AUTO_TEXT_DIRECTION.

setOrientation would override this value with the text direction that is consistent with the new orientation.

Warning: This API is currently only implemented on Windows. It doesn't set the base text direction on GTK and Cocoa.

nametypedescription
text_directionintthe base text direction style

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

to_control

Point to_control ( int x, int y )
Java: toControl(int x, int y)

Returns a point which is the result of converting the argument, which is specified in display relative coordinates, to coordinates relative to the receiver.

NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use Display#map(Control, Control, Rectangle).

nametypedescription
xintthe x coordinate in points to be translated
yintthe y coordinate in points to be translated

Returns: the translated coordinates

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

to_control

Point to_control ( Point point )
Java: toControl(org.eclipse.swt.graphics.Point point)

Returns a point which is the result of converting the argument, which is specified in display relative coordinates, to coordinates relative to the receiver.

NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use Display#map(Control, Control, Rectangle).

nametypedescription
pointorg.eclipse.swt.graphics.Pointthe point to be translated (must not be null)

Returns: the translated coordinates

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the point 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

to_display

Point to_display ( int x, int y )
Java: toDisplay(int x, int y)

Returns a point which is the result of converting the argument, which is specified in coordinates relative to the receiver, to display relative coordinates.

NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use Display#map(Control, Control, Rectangle).

nametypedescription
xintthe x coordinate to be translated
yintthe y coordinate to be translated

Returns: the translated coordinates

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

to_display

Point to_display ( Point point )
Java: toDisplay(org.eclipse.swt.graphics.Point point)

Returns a point which is the result of converting the argument, which is specified in coordinates relative to the receiver, to display relative coordinates.

NOTE: To properly map a rectangle or a corner of a rectangle on a right-to-left platform, use Display#map(Control, Control, Rectangle).

nametypedescription
pointorg.eclipse.swt.graphics.Pointthe point to be translated (must not be null)

Returns: the translated coordinates

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the point 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

tool_tip_text

String tool_tip_text ( )
Java: getToolTipText() · also: get_tool_tip_text

Returns the receiver's tool tip text, or null if it has not been set.

Returns: the receiver's tool tip 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

tool_tip_text=

tool_tip_text= ( String string )
Java: setToolTipText(String string) · also: set_tool_tip_text

Sets the receiver's tool tip text to the argument, which may be null indicating that the default tool tip for the control will be shown. For a control that has a default tool tip, such as the Tree control on Windows, setting the tool tip text to an empty string replaces the default, causing no tool tip text to be shown.

The mnemonic indicator (character '&') is not displayed in a tool tip. To display a single '&' in the tool tip, the character '&' can be escaped by doubling it in the string.

NOTE: This operation is a hint and behavior is platform specific, on Windows for CJK-style mnemonics of the form " (&C)" at the end of the tooltip text are not shown in tooltip.

nametypedescription
stringStringthe new tool tip text (or null)

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

touch_enabled

boolean touch_enabled ( )
Java: getTouchEnabled() · also: get_touch_enabled

Returns true if this control is set to send touch events, or false if it is set to send gesture events instead. This method also returns false if a touch-based input device is not detected (this can be determined with Display#getTouchEnabled()). Use #setTouchEnabled(boolean) to switch the events that a control sends between touch events and gesture events.

Returns: true if the control is set to send touch events, or false otherwise

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

touch_enabled=

touch_enabled= ( boolean enabled )
Java: setTouchEnabled(boolean enabled) · also: set_touch_enabled

Sets whether this control should send touch events (by default controls do not). Setting this to false causes the receiver to send gesture events instead. No exception is thrown if a touch-based input device is not detected (this can be determined with Display#getTouchEnabled()).

nametypedescription
enabledbooleanthe new touch-enabled 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

traverse

boolean traverse ( int traversal, Event event )
Java: traverse(int traversal, org.eclipse.swt.widgets.Event event)

Performs a platform traversal action corresponding to a KeyDown event.

Valid traversal values are SWT.TRAVERSE_NONE, SWT.TRAVERSE_MNEMONIC, SWT.TRAVERSE_ESCAPE, SWT.TRAVERSE_RETURN, SWT.TRAVERSE_TAB_NEXT, SWT.TRAVERSE_TAB_PREVIOUS, SWT.TRAVERSE_ARROW_NEXT, SWT.TRAVERSE_ARROW_PREVIOUS, SWT.TRAVERSE_PAGE_NEXT and SWT.TRAVERSE_PAGE_PREVIOUS. If traversal is SWT.TRAVERSE_NONE then the Traverse event is created with standard values based on the KeyDown event. If traversal is one of the other traversal constants then the Traverse event is created with this detail, and its doit is taken from the KeyDown event.

nametypedescription
traversalintthe type of traversal, or SWT.TRAVERSE_NONE to compute this from event
eventorg.eclipse.swt.widgets.Eventthe KeyDown event

Returns: true if the traversal succeeded

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT if the event 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

traverse

boolean traverse ( int traversal, KeyEvent event )
Java: traverse(int traversal, org.eclipse.swt.events.KeyEvent event)

Performs a platform traversal action corresponding to a KeyDown event.

Valid traversal values are SWT.TRAVERSE_NONE, SWT.TRAVERSE_MNEMONIC, SWT.TRAVERSE_ESCAPE, SWT.TRAVERSE_RETURN, SWT.TRAVERSE_TAB_NEXT, SWT.TRAVERSE_TAB_PREVIOUS, SWT.TRAVERSE_ARROW_NEXT, SWT.TRAVERSE_ARROW_PREVIOUS, SWT.TRAVERSE_PAGE_NEXT and SWT.TRAVERSE_PAGE_PREVIOUS. If traversal is SWT.TRAVERSE_NONE then the Traverse event is created with standard values based on the KeyDown event. If traversal is one of the other traversal constants then the Traverse event is created with this detail, and its doit is taken from the KeyDown event.

nametypedescription
traversalintthe type of traversal, or SWT.TRAVERSE_NONE to compute this from event
eventorg.eclipse.swt.events.KeyEventthe KeyDown event

Returns: true if the traversal succeeded

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT if the event 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

traverse

boolean traverse ( int traversal )
Java: traverse(int traversal)

Based on the argument, perform one of the expected platform traversal action. The argument should be one of the constants: SWT.TRAVERSE_ESCAPE, SWT.TRAVERSE_RETURN, SWT.TRAVERSE_TAB_NEXT, SWT.TRAVERSE_TAB_PREVIOUS, SWT.TRAVERSE_ARROW_NEXT, SWT.TRAVERSE_ARROW_PREVIOUS, SWT.TRAVERSE_PAGE_NEXT and SWT.TRAVERSE_PAGE_PREVIOUS.

nametypedescription
traversalintthe type of traversal

Returns: true if the traversal succeeded

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

update

update ( )
Java: update()

Forces all outstanding paint requests for the widget to be processed before this method returns. If there are no outstanding paint request, this method does nothing.

Note:

  • This method does not cause a redraw.
  • Some OS versions forcefully perform automatic deferred painting. This method does nothing in that case.

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

visible

boolean visible ( )
Java: getVisible() · also: get_visible

Returns true if the receiver is visible, and false otherwise.

If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.

Returns: the receiver's visibility 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

visible=

visible= ( boolean visible )
Java: setVisible(boolean visible) · also: set_visible

Marks the receiver as visible if the argument is true, and marks it invisible otherwise.

If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.

nametypedescription
visiblebooleanthe new visibility 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

visible?

boolean visible? ( )
Java: isVisible() · also: is_visible

Returns true if the receiver is visible and all ancestors up to and including the receiver's nearest ancestor shell are visible. Otherwise, false is returned.

Returns: the receiver's visibility 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

from Scrollable

client_area

Rectangle client_area ( )
Java: getClientArea() · also: get_client_area

Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").

Returns: the client area

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

compute_trim

Rectangle compute_trim ( int x, int y, int width, int height )
Java: computeTrim(int x, int y, int width, int height)

Given a desired client area for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area.

In other words, it returns a rectangle such that, if the receiver's bounds were set to that rectangle, the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent).

nametypedescription
xintthe desired x coordinate of the client area
yintthe desired y coordinate of the client area
widthintthe desired width of the client area
heightintthe desired height of the client area

Returns: the required bounds to produce the given client area

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

horizontal_bar

ScrollBar horizontal_bar ( )
Java: getHorizontalBar() · also: get_horizontal_bar

Returns the receiver's horizontal scroll bar if it has one, and null if it does not.

Returns: the horizontal scroll bar (or null)

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

scrollbars_mode

int scrollbars_mode ( )
Java: getScrollbarsMode() · also: get_scrollbars_mode

Returns the mode of the receiver's scrollbars. This will be bitwise OR of one or more of the constants defined in class SWT.

  • SWT.SCROLLBAR_OVERLAY - if receiver uses overlay scrollbars
  • SWT.NONE - otherwise

Returns: the mode of scrollbars

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

scrollbars_mode=

scrollbars_mode= ( int mode )
Java: setScrollbarsMode(int mode) · also: set_scrollbars_mode

Sets the mode of the receiver's scrollbars. This will be bitwise OR of one or more of the constants defined in class SWT.

  • SWT.SCROLLBAR_OVERLAY - if receiver uses overlay scrollbars
  • SWT.NONE - otherwise

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

vertical_bar

ScrollBar vertical_bar ( )
Java: getVerticalBar() · also: get_vertical_bar

Returns the receiver's vertical scroll bar if it has one, and null if it does not.

Returns: the vertical scroll bar (or null)

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

from Composite

background_mode

int background_mode ( )
Java: getBackgroundMode() · also: get_background_mode

Returns the receiver's background drawing mode. This will be one of the following constants defined in class SWT: INHERIT_NONE, INHERIT_DEFAULT, INHERIT_FORCE.

Returns: the background mode

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

background_mode=

background_mode= ( int mode )
Java: setBackgroundMode(int mode) · also: set_background_mode

Sets the background drawing mode to the argument which should be one of the following constants defined in class SWT: INHERIT_NONE, INHERIT_DEFAULT, INHERIT_FORCE.

nametypedescription
modeintthe new background mode

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

changed

changed ( Control[] changed )
Java: changed(org.eclipse.swt.widgets.Control[] changed)
Deprecated. use Composite#layout(Control[], int) instead

Clears any data that has been cached by a Layout for all widgets that are in the parent hierarchy of the changed control up to and including the receiver. If an ancestor does not have a layout, it is skipped.

nametypedescription
changedorg.eclipse.swt.widgets.Control[]an array of controls that changed state and require a recalculation of size

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed
  • ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver
SWTException
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

children

Control[] children ( )
Java: getChildren() · also: get_children

Returns a (possibly empty) array containing the receiver's children. Children are returned in the order that they are drawn. The topmost control appears at the beginning of the array. Subsequent controls draw beneath this control and appear later in the array.

Note: This is not the actual structure used by the receiver to maintain its list of children, so modifying the array will not affect the receiver.

Returns: an array of 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

compute_size

Point compute_size ( int w_hint, int h_hint, boolean changed )
Java: computeSize(int wHint, int hHint, boolean changed)

draw_background

draw_background ( GC gc, int x, int y, int width, int height, int offset_x, int offset_y )
Java: drawBackground(org.eclipse.swt.graphics.GC gc, int x, int y, int width, int height, int offsetX, int offsetY)

Fills the interior of the rectangle specified by the arguments, with the receiver's background.

The offsetX and offsetY are used to map from the gc origin to the origin of the parent image background. This is useful to ensure proper alignment of the image background.

nametypedescription
gcorg.eclipse.swt.graphics.GCthe gc where the rectangle is to be filled
xintthe x coordinate of the rectangle to be filled
yintthe y coordinate of the rectangle to be filled
widthintthe width of the rectangle to be filled
heightintthe height of the rectangle to be filled
offset_xintthe image background x offset
offset_yintthe image background y offset

Throws

IllegalArgumentException
  • ERROR_NULL_ARGUMENT - if the gc is null
  • ERROR_INVALID_ARGUMENT - if the gc 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

layout

Layout layout ( )
Java: getLayout() · also: get_layout

Returns layout which is associated with the receiver, or null if one has not been set.

Returns: the receiver's layout or null

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

layout

layout ( )
Java: layout()

If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the receiver does not have a layout, do nothing.

Use of this method is discouraged since it is the least-efficient way to trigger a layout. The use of layout(true) discards all cached layout information, even from controls which have not changed. It is much more efficient to invoke Control#requestLayout() on every control which has changed in the layout than it is to invoke this method on the layout itself.

This is equivalent to calling layout(true).

Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.

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

layout

layout ( boolean changed )
Java: layout(boolean changed)

If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the argument is true the layout must not rely on any information it has cached about the immediate children. If it is false the layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the receiver does not have a layout, do nothing.

It is normally more efficient to invoke Control#requestLayout() on every control which has changed in the layout than it is to invoke this method on the layout itself. Clients are encouraged to use Control#requestLayout() where possible instead of calling this method.

If a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. The layout will cascade down through all child widgets in the receiver's widget tree until a child is encountered that does not resize. Note that a layout due to a resize will not flush any cached information (same as layout(false)).

Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.

nametypedescription
changedbooleantrue if the layout must flush its caches, and false otherwise

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

layout

layout ( boolean changed, boolean all )
Java: layout(boolean changed, boolean all)

If the receiver has a layout, asks the layout to lay out (that is, set the size and location of) the receiver's children. If the changed argument is true the layout must not rely on any information it has cached about its children. If it is false the layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the all argument is true the layout will cascade down through all child widgets in the receiver's widget tree, regardless of whether the child has changed size. The changed argument is applied to all layouts. If the all argument is false, the layout will not cascade down through all child widgets in the receiver's widget tree. However, if a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. Note that a layout due to a resize will not flush any cached information (same as layout(false)).

It is normally more efficient to invoke Control#requestLayout() on every control which has changed in the layout than it is to invoke this method on the layout itself. Clients are encouraged to use Control#requestLayout() where possible instead of calling this method.

Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.

nametypedescription
changedbooleantrue if the layout must flush its caches, and false otherwise
allbooleantrue if all children in the receiver's widget tree should be laid out, and false otherwise

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

layout

layout ( Control[] changed )
Java: layout(org.eclipse.swt.widgets.Control[] changed)

Forces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarchy of the changed control up to and including the receiver. The layouts in the hierarchy must not rely on any information cached about the changed control or any of its ancestors. The layout may (potentially) optimize the work it is doing by assuming that none of the peers of the changed control have changed state since the last layout. If an ancestor does not have a layout, skip it.

It is normally more efficient to invoke Control#requestLayout() on every control which has changed in the layout than it is to invoke this method on the layout itself. Clients are encouraged to use Control#requestLayout() where possible instead of calling this method.

Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.

nametypedescription
changedorg.eclipse.swt.widgets.Control[]a control that has had a state change which requires a recalculation of its size

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed
  • ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver
SWTException
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

layout

layout ( Control[] changed, int flags )
Java: layout(org.eclipse.swt.widgets.Control[] changed, int flags)

Forces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarchy of the changed control up to and including the receiver.

The parameter flags may be a combination of:

SWT.ALL
all children in the receiver's widget tree should be laid out
SWT.CHANGED
the layout must flush its caches
SWT.DEFER
layout will be deferred

When the changed array is specified, the flags SWT.ALL and SWT.CHANGED have no effect. In this case, the layouts in the hierarchy must not rely on any information cached about the changed control or any of its ancestors. The layout may (potentially) optimize the work it is doing by assuming that none of the peers of the changed control have changed state since the last layout. If an ancestor does not have a layout, skip it.

When the changed array is not specified, the flag SWT.ALL indicates that the whole widget tree should be laid out. And the flag SWT.CHANGED indicates that the layouts should flush any cached information for all controls that are laid out.

The SWT.DEFER flag always causes the layout to be deferred by calling Composite.setLayoutDeferred(true) and scheduling a call to Composite.setLayoutDeferred(false), which will happen when appropriate (usually before the next event is handled). When this flag is set, the application should not call Composite.setLayoutDeferred(boolean).

Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint.

nametypedescription
changedorg.eclipse.swt.widgets.Control[]a control that has had a state change which requires a recalculation of its size
flagsintthe flags specifying how the layout should happen

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if any of the controls in changed is null or has been disposed
  • ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver
SWTException
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

layout=

layout= ( Layout layout )
Java: setLayout(org.eclipse.swt.widgets.Layout layout) · also: set_layout

Sets the layout which is associated with the receiver to be the argument which may be null.

nametypedescription
layoutorg.eclipse.swt.widgets.Layoutthe receiver's new layout or null

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

layout_deferred

boolean layout_deferred ( )
Java: getLayoutDeferred() · also: get_layout_deferred

Returns true if the receiver has deferred the performing of layout, and false otherwise.

Returns: the receiver's deferred layout 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

layout_deferred=

layout_deferred= ( boolean defer )
Java: setLayoutDeferred(boolean defer) · also: set_layout_deferred

If the argument is true, causes subsequent layout operations in the receiver or any of its children to be ignored. No layout of any kind can occur in the receiver or any of its children until the flag is set to false. Layout operations that occurred while the flag was true are remembered and when the flag is set to false, the layout operations are performed in an optimized manner. Nested calls to this method are stacked.

nametypedescription
deferbooleanthe new defer 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

layout_deferred?

boolean layout_deferred? ( )
Java: isLayoutDeferred() · also: is_layout_deferred

Returns true if the receiver or any ancestor up to and including the receiver's nearest ancestor shell has deferred the performing of layouts. Otherwise, false is returned.

Returns: the receiver's deferred layout 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

redraw

redraw ( int x, int y, int width, int height, boolean all )
Java: redraw(int x, int y, int width, int height, boolean all)

set_focus

boolean set_focus ( )
Java: setFocus()

tab_list

Control[] tab_list ( )
Java: getTabList() · also: get_tab_list

Gets the (possibly empty) tabbing order for the control.

Returns: tabList the ordered list of controls representing the tab order

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

tab_list=

tab_list= ( Control[] tab_list )
Java: setTabList(org.eclipse.swt.widgets.Control[] tabList) · also: set_tab_list

Sets the tabbing order for the specified controls to match the order that they occur in the argument list.

nametypedescription
tab_listorg.eclipse.swt.widgets.Control[]the ordered list of controls representing the tab order or null

Throws

IllegalArgumentException
  • ERROR_INVALID_ARGUMENT - if a widget in the tabList is null or has been disposed
  • ERROR_INVALID_PARENT - if widget in the tabList is not in the same widget tree
SWTException
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

to_string

String to_string ( )
Java: toString()