|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Text
com.ibm.editors.swt.VisualText
Instances of this class are selectable user interface objects that allow the user to enter and modify text in Visual or Logical mode. The visual editor supports visual data typing modes, such as: push, autopush, field reverse (familar to IBM host terminal users) that may be turned on/off by contextual menu or hot key combinations. The hot key combinations and corresponding text in contextual menu are customizable via public set methods. Depending on style being passed in second constructor's parameter, the editor will implement corresponding typing mode as follows: SWT.LEFT_TO_RIGHT - 'Visual Left-To-Right' typing mode SWT.RIGHT_TO_LEFT - 'Visual Right-To-Left' typing mode None of above - 'Regular Logical' typing mode The typing mode can be also changed dynamically for editor instance by calling 'setOrientation' method that excepts one of the following values: SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, SWT.NULL The visual editor supports overwrite mode, toggling between 'insert' and 'overwrite' mode could be enacted by pressing 'Insert' key.
Note: Only one of the styles MULTI and SINGLE may be specified.
IMPORTANT: This class is not intended to be subclassed.
Field Summary |
---|
Fields inherited from class org.eclipse.swt.widgets.Text |
---|
DELIMITER, LIMIT |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
VisualText(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. |
Method Summary | |
---|---|
void |
append(java.lang.String str)
Appends a string. |
boolean |
getAutoPush()
Gets auto push mode |
int |
getCaretPosition()
Gets the position of the caret. |
int |
getCharCount()
Gets the number of characters. |
boolean |
getFieldReverse()
Gets field reverse typing mode |
boolean |
getHindi()
Gets hindi numbers typing mode |
int |
getOrientation()
Returns the orientation of the receiver. |
boolean |
getOverWriteMode()
Gets overwrite typing mode state |
boolean |
getPush()
Gets push mode state |
org.eclipse.swt.graphics.Point |
getSelection()
Gets the position of the selected text. |
int |
getSelectionCount()
Gets the number of selected characters. |
java.lang.String |
getSelectionText()
Gets the selected text. |
int |
getStyle()
Gets the widget style. |
java.lang.String |
getText()
Gets the widget text. |
java.lang.String |
getText(int start,
int end)
Gets a range of text. |
int |
getTextLimit()
Returns the maximum number of characters that the receiver is capable of holding. |
void |
insert(java.lang.String str)
Inserts a string. |
boolean |
isShapeNeeded()
Queries shapeNeeded state |
void |
redefineHotKeyAutopush(int keyCode,
int stateMask,
java.lang.String hotKeyMenuText)
Redefines the hot key setting for toggling auto-push mode |
void |
redefineHotKeyFieldReverse(int keyCode,
int stateMask,
java.lang.String hotKeyMenuText)
Redefines the hot key setting for toggling field-reverse mode |
void |
redefineHotKeyHindi(int keyCode,
int stateMask,
java.lang.String hotKeyMenuText)
Redefines the hot key setting for toggling hindi numbers typing mode |
void |
redefineHotKeyPushOff(int keyCode,
int stateMask,
java.lang.String hotKeyMenuText)
Redefines the hot key setting for turning off push mode |
void |
redefineHotKeyPushOn(int keyCode,
int stateMask,
java.lang.String hotKeyMenuText)
Redefines the hot key setting for turning on push mode |
void |
setCodePage(int codepage)
sets code page for Widget |
boolean |
setFieldReverse(boolean fieldreverse,
org.eclipse.swt.widgets.Text control)
Sets field reverse typing mode |
boolean |
setHindi(boolean hindi)
Sets hindi numbers typing mode |
void |
setOrientation(int orientation)
Sets the logical orientation of the receiver, which must be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT .
|
void |
setOverWriteMode(boolean isOverWriteMode)
Sets overwrite typing mode |
boolean |
setPush(boolean push)
Sets push mode state |
void |
setSelection(int start)
Sets the selection. |
void |
setSelection(int start,
int end)
Sets the selection. |
void |
setSelection(org.eclipse.swt.graphics.Point selection)
Sets the selection. |
void |
setShapeNeeded(boolean shape)
Indicates to call BIDI engine when pushing is ON or the field is reversed in order to shape Arabic characters. |
void |
setText(java.lang.String str)
Sets the contents of the receiver to the given string. |
void |
setTextLimit(int limit)
Sets the maximum number of characters that the receiver is capable of holding to be the argument. |
void |
setVisualOrientation(int orientation)
Sets the orientation of the receiver, which must be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT or SWT.NULL .
|
Methods inherited from class org.eclipse.swt.widgets.Text |
---|
addModifyListener, addSelectionListener, addVerifyListener, clearSelection, computeSize, computeTrim, copy, cut, getBorderWidth, getCaretLineNumber, getCaretLocation, getDoubleClickEnabled, getEchoChar, getEditable, getLineCount, getLineDelimiter, getLineHeight, getTabs, getTopIndex, getTopPixel, paste, removeModifyListener, removeSelectionListener, removeVerifyListener, selectAll, setDoubleClickEnabled, setEchoChar, setEditable, setFont, setRedraw, setTabs, setTopIndex, showSelection |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFocus, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, dispose, getData, getData, getDisplay, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public VisualText(org.eclipse.swt.widgets.Composite 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 composite control which will be the parent of the new instance (cannot be null)style
- the style of control to construct
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SWT.RIGHT_TO_LEFT
,
SWT.LEFT_TO_RIGHT
,
SWT.SINGLE
,
SWT.MULTI
,
SWT.READ_ONLY
,
SWT.WRAP
Method Detail |
public void setVisualOrientation(int orientation)
SWT.LEFT_TO_RIGHT
or SWT.RIGHT_TO_LEFT
or SWT.NULL
.
orientation
- new orientation style
SWT.LEFT_TO_RIGHT - 'Visual Left-To-Right' typing mode
SWT.RIGHT_TO_LEFT - 'Visual Right-To-Left' typing mode
SWT.NULL - 'Regular Logical' typing mode
org.eclipse.swt.SWTException
- public void setOrientation(int orientation)
SWT.LEFT_TO_RIGHT
or SWT.RIGHT_TO_LEFT
.
Note: This operation is a hint and is not supported on platforms that do not have this concept.
orientation
- new orientation style
org.eclipse.swt.SWTException
- public int getOrientation()
org.eclipse.swt.SWTException
- public void setText(java.lang.String str)
str
- - string the new text
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void append(java.lang.String str)
The new text is appended to the text at the end of the widget.
str
- - string the string to be appended
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void insert(java.lang.String str)
The old selection is replaced with the new text.
str
- - string the string
org.eclipse.swt.SWTException
- public java.lang.String getText()
The text for a text widget is the characters in the widget.
org.eclipse.swt.SWTException
- public java.lang.String getText(int start, int end)
Indexing is zero based. The range of a selection is from 0..N-1 where N is the number of characters in the widget.
start
- the start of the rangeend
- the end of the range
org.eclipse.swt.SWTException
- public int getCharCount()
org.eclipse.swt.SWTException
- public void setTextLimit(int limit)
Instead of trying to set the text limit to zero, consider creating a read-only text widget.
To reset this value to the default, use setTextLimit(Text.LIMIT)
.
limit
- new text limit
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public int getTextLimit()
If this has not been changed by setTextLimit()
,
it will be the constant Text.LIMIT
.
org.eclipse.swt.SWTException
- public int getCaretPosition()
The character position of the caret is returned.
org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Point getSelection()
Indexing is zero based. The range of a selection is from 0..N where N is the number of characters in the widget.
org.eclipse.swt.SWTException
- public void setSelection(int start)
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 regular array indexing rules.
start
- new caret position
org.eclipse.swt.SWTException
- public void setSelection(int start, int end)
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.
start
- the start of the rangeend
- the end of the range
org.eclipse.swt.SWTException
- public void setSelection(org.eclipse.swt.graphics.Point selection)
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.
selection
- the point
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public int getSelectionCount()
org.eclipse.swt.SWTException
- public java.lang.String getSelectionText()
org.eclipse.swt.SWTException
- public void setCodePage(int codepage)
codepage
- - BiDi codepage 424/420public int getStyle()
public boolean setPush(boolean push)
push
- mode state of widget "on - true/off - false"public boolean getPush()
public boolean getAutoPush()
public boolean setHindi(boolean hindi)
hindi
- numbers typing mode of widget "on - true/off - false"
Numeral shapes designates whether the numbers being inserted have to be
presented using the European digit shapes or Arabic-Indic digit shapes.public boolean getHindi()
public boolean setFieldReverse(boolean fieldreverse, org.eclipse.swt.widgets.Text control)
fieldreverse
- - field reverse typing mode of widget "on - true/off - false"public boolean getFieldReverse()
public void redefineHotKeyPushOn(int keyCode, int stateMask, java.lang.String hotKeyMenuText)
keyCode
- - redefined key codestateMask
- - redefined state maskhotKeyMenuText
- - redefined text for context menu hot key descriptionpublic void redefineHotKeyPushOff(int keyCode, int stateMask, java.lang.String hotKeyMenuText)
keyCode
- - redefined key codestateMask
- - redefined state maskhotKeyMenuText
- - redefined text for context menu hot key descriptionpublic void redefineHotKeyAutopush(int keyCode, int stateMask, java.lang.String hotKeyMenuText)
keyCode
- - redefined key codestateMask
- - redefined state maskhotKeyMenuText
- - redefined text for context menu hot key descriptionpublic void redefineHotKeyFieldReverse(int keyCode, int stateMask, java.lang.String hotKeyMenuText)
keyCode
- - redefined key codestateMask
- - redefined state maskhotKeyMenuText
- - redefined text for context menu hot key descriptionpublic void redefineHotKeyHindi(int keyCode, int stateMask, java.lang.String hotKeyMenuText)
keyCode
- - redefined key codestateMask
- - redefined state maskhotKeyMenuText
- - redefined text for context menu hot key descriptionpublic boolean getOverWriteMode()
public void setOverWriteMode(boolean isOverWriteMode)
isOverWriteMode
- - typing mode of widget "on - true/off - false"public void setShapeNeeded(boolean shape)
shape
- - indicates if Arabic shaping is needed
for typing in/pasting textpublic boolean isShapeNeeded()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |