public class IME extends Widget
IMPORTANT: This class is not intended to be subclassed.
Constructor and Description |
---|
IME(Canvas parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
int |
getCaretOffset()
Returns the offset of the caret from the start of the document.
|
int |
getCommitCount()
Returns the commit count of the composition.
|
int |
getCompositionOffset()
Returns the offset of the composition from the start of the document.
|
int[] |
getRanges()
Returns the ranges for the style that should be applied during the
in-line edit session.
|
TextStyle[] |
getStyles()
Returns the styles for the ranges.
|
java.lang.String |
getText()
Returns the composition text.
|
boolean |
getWideCaret()
Returns
true if the caret should be wide, and
false otherwise. |
void |
setCompositionOffset(int offset)
Sets the offset of the composition from the start of the document.
|
addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public IME(Canvas parent, int style)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent
- a canvas control which will be the parent of the new instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- Widget.checkSubclass()
,
Widget.getStyle()
public int getCaretOffset()
SWTException
- public int getCommitCount()
SWTException
- getText()
public int getCompositionOffset()
SWTException
- public int[] getRanges()
The ranges array contains start and end pairs. Each pair refers to
the corresponding style in the styles array. For example, the pair
that starts at ranges[n] and ends at ranges[n+1] uses the style
at styles[n/2] returned by getStyles()
.
SWTException
- getStyles()
public TextStyle[] getStyles()
The ranges array contains start and end pairs. Each pair refers to the corresponding style in the styles array. For example, the pair that starts at ranges[n] and ends at ranges[n+1] uses the style at styles[n/2].
SWTException
- getRanges()
public java.lang.String getText()
The text for an IME is the characters in the widget that are in the current composition. When the commit count is equal to the length of the composition text, then the in-line edit operation is complete.
SWTException
- public boolean getWideCaret()
true
if the caret should be wide, and
false
otherwise. In some languages, for example
Korean, the caret is typically widened to the width of the
current character in the in-line edit session.SWTException
- public void setCompositionOffset(int offset)
offset
- the offset of the compositionSWTException
-