Index

Global Objects

Types


Type Combo


Extends Control.
RWT Scripting analoge to org.eclipse.swt.widgets.Combo

Type Summary
Constructor Attributes Constructor Name and Description
 
Combo()
The constructor is not public.
Fields borrowed from class Widget:
$el
Method Summary
Method Attributes Method Name and Description
 
Returns an array whose first value is the character position representing the start of the selected text, and whose second value is the character position representing the end of the selection.
 
Returns the widget text.
 
setSelection(selection)
Sets the selection of the text to the range specified by an array whose first value is the character position representing the start of the selected text, and whose second value is the character position representing the end of the selection.
 
setText(text)
Sets the contents of the receiver's text field to the given string.
Methods borrowed from class Control:
addListener, forceFocus, getBackground, getCursor, getEnabled, getForeground, getToolTipText, getVisible, removeListener, setBackground, setEnabled, setForeground, setToolTipText, setVisible
Methods borrowed from class Widget:
getData, setData
Event Summary
Event Attributes Event Name and Description
 
Sent when the widget text is changed
 
Sent before the widget text is changed
Events borrowed from class Control:
Dispose, FocusIn, FocusOut, Hide, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseMove, MouseUp, MouseWheel, Paint, Show
Type Detail
Combo()
The constructor is not public.
Since:
2.2
Method Detail
{int[]} getSelection()
Returns an array whose first value is the character position representing the start of the selected text, and whose second value is the character position representing the end of the selection. An "empty" selection is indicated by the values being identical.

Indexing is zero based. The range of a selection is from 0..N where N is the number of characters in the widget.

Returns:
{int[]} array representing the selection start and end

{string} getText()
Returns the widget text.
Returns:
{string} the widget text

setSelection(selection)
Sets the selection of the text to the range specified by an array whose first value is the character position representing the start of the selected text, and whose second value is the character position representing the end of the selection. An "empty" selection is indicated by the values being identical.

Indexing is zero based. The range of a selection is from 0..N where N is the number of characters in the widget.

Text selections are specified in terms of caret positions. In a text widget that contains N characters, there are N+1 caret positions, ranging from 0..N. This differs from other functions that address character position such as getText () that use the usual array indexing rules.

Parameters:
{int[]} selection
array representing the selection start and end

setText(text)
Sets the contents of the receiver's text field to the given string.

Note: The text field in a Combo is typically only capable of displaying a single line of text. Thus, setting the text to a string containing line breaks or other special characters will probably cause it to display incorrectly.

Parameters:
{string} text
the new text
Event Detail
Modify
Sent when the widget text is changed
Parameters:
{Event} event
See:
SWT.Modify

Verify
Sent before the widget text is changed
Parameters:
{Event} event
See:
SWT.Verify

Copyright (c) EclipseSource and others 2013, 2019. All rights reserved.