Class Text
- All Implemented Interfaces:
Drawable
- Styles:
- CENTER, ICON_CANCEL, ICON_SEARCH, LEFT, MULTI, PASSWORD, SEARCH, SINGLE, RIGHT, READ_ONLY, WRAP
- Events:
- DefaultSelection, Modify, Verify, OrientationChange
Note: Only one of the styles MULTI and SINGLE may be specified, and only one of the styles LEFT, CENTER, and RIGHT may be specified.
Note: The styles ICON_CANCEL and ICON_SEARCH are hints used in combination with SEARCH. When the platform supports the hint, the text control shows these icons. When an icon is selected, a default selection event is sent with the detail field set to one of ICON_CANCEL or ICON_SEARCH. Normally, application code does not need to check the detail. In the case of ICON_CANCEL, the text is cleared before the default selection event is sent causing the application to search for an empty string.
Note: Some text actions such as Undo are not natively supported on all platforms.
IMPORTANT: This class is not intended to be subclassed.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) GdkRGBA(package private) long(package private) double(package private) doublestatic final StringThe delimiter used by multi-line text widgets.(package private) boolean(package private) int(package private) int(package private) GdkRGBA(package private) long(package private) long(package private) long(package private) static final int(package private) intstatic final intThe maximum number of characters that can be entered into a text widget.(package private) static final char(package private) String(package private) static final char(package private) int[](package private) static final int(package private) int(package private) longGTK4 only field, holds the address to the underlying GtkText widget.Fields inherited from class Scrollable
horizontalBar, RESIZE_ON_GETCLIENTAREA, scrolledHandle, verticalBarFields inherited from class Control
accessible, autoScale, backgroundAlpha, backgroundImage, cachedNoBackground, checkScaleFactor, cssBackground, cssForeground, cursor, DISABLE_EMOJI, dragDetectionQueue, dragGesture, drawCount, drawRegion, enableWindow, eventRegion, firstFixedHandle, fixedHandle, font, gestureBegin, gestureEnd, gestureRotation, gestureSwipe, gestureZoom, keyController, labelRelation, lastInput, layoutData, menu, mouseDown, panGesture, parent, provider, redrawWindow, region, regionHandle, rotateGesture, toolTipText, zoomGestureFields inherited from class Widget
ACTIVATE, ACTIVATE_INVERSE, AUTO_TEXT_DIRECTION, BACKGROUND, BACKSPACE, BACKSPACE_INVERSE, BUTTON_PRESS_EVENT, BUTTON_PRESS_EVENT_INVERSE, BUTTON_RELEASE_EVENT, BUTTON_RELEASE_EVENT_INVERSE, CANVAS, CHANGE_VALUE, CHANGED, CHECK_SUBWINDOW, CLICKED, CLOSE_REQUEST, COMMIT, COMPUTE_SIZE, CONFIGURE_EVENT, COPY_CLIPBOARD, COPY_CLIPBOARD_INVERSE, CREATE_MENU_PROXY, CUT_CLIPBOARD, CUT_CLIPBOARD_INVERSE, data, DAY_SELECTED, DAY_SELECTED_DOUBLE_CLICK, DECELERATE, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_FROM_CURSOR, DELETE_FROM_CURSOR_INVERSE, DELETE_RANGE, DELETE_TEXT, DIRECTION_CHANGED, DISABLED, display, DISPOSE_SENT, DISPOSED, DPI_CHANGED, DRAG_DETECT, DRAW, ENTER, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPAND_COLLAPSE_CURSOR_ROW, EXPOSE_EVENT, EXPOSE_EVENT_INVERSE, FOCUS, FOCUS_IN, FOCUS_IN_EVENT, FOCUS_OUT, FOCUS_OUT_EVENT, FONT, FOREGROUND, FOREIGN_HANDLE, gdkSeatGrabPrepareFunc, GESTURE_PRESSED, GESTURE_RELEASED, GRAB_FOCUS, handle, HANDLE, HAS_AUTO_DIRECTION, HIDDEN, HIDE, ICON_RELEASE, IM_UPDATE, INPUT, INSERT_TEXT, IS_ACTIVE, KEY_CHECK_SUBWINDOW, KEY_GTK_CSS, KEY_PRESS_EVENT, KEY_PRESSED, KEY_RELEASE_EVENT, KEY_RELEASED, KEYED_DATA, LAST_SIGNAL, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, LEAVE, LEAVE_NOTIFY_EVENT, MAP, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MONTH_CHANGED, MOTION, MOTION_INVERSE, MOTION_NOTIFY_EVENT, MOTION_NOTIFY_EVENT_INVERSE, MOVE_CURSOR, MOVE_CURSOR_INVERSE, MOVE_FOCUS, MOVED, NOTIFY_DEFAULT_HEIGHT, NOTIFY_DEFAULT_WIDTH, NOTIFY_MAXIMIZED, NOTIFY_STATE, OBSCURED, OUTPUT, PARENT_BACKGROUND, PASTE_CLIPBOARD, PASTE_CLIPBOARD_INVERSE, POPPED_UP, POPULATE_POPUP, POPUP_MENU, PREEDIT_CHANGED, REALIZE, RELEASED, RESIZED, ROW_ACTIVATED, ROW_DELETED, ROW_HAS_CHILD_TOGGLED, ROW_INSERTED, SCROLL, SCROLL_BEGIN, SCROLL_CHILD, SCROLL_END, SCROLL_EVENT, SELECT, SELECTION_DONE, SHOW, SHOW_HELP, SIZE_ALLOCATE, SIZE_ALLOCATE_GTK4, SKIN_NEEDED, START_INTERACTIVE_SEARCH, state, STATUS_ICON_POPUP_MENU, style, STYLE_UPDATED, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TEXT_BUFFER_INSERT_TEXT, THEME_BACKGROUND, TOGGLED, UNMAP, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, WINDOW_STATE_EVENT, ZERO_HEIGHT, ZERO_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModifyListener(ModifyListener listener) Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by sending it one of the messages defined in theModifyListenerinterface.voidaddSegmentListener(SegmentListener listener) Adds a segment listener.voidaddSelectionListener(SelectionListener listener) Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in theSelectionListenerinterface.voidaddVerifyListener(VerifyListener listener) Adds the listener to the collection of listeners who will be notified when the receiver's text is verified, by sending it one of the messages defined in theVerifyListenerinterface.voidAppends a string.(package private) void(package private) int(package private) static intcheckStyle(int style) (package private) voidclearSegments(boolean applyText) voidClears the selection.(package private) PointcomputeSizeInPixels(int wHint, int hHint, boolean changed) (package private) RectanglecomputeTrimInPixels(int x, int y, int width, int height) voidcopy()Copies the selected text.(package private) voidcreateHandle(int index) (package private) voidcreateWidget(int index) voidcut()Cuts the selected text.(package private) GdkRGBA(package private) char[]deprocessText(char[] text, int start, int end) (package private) void(package private) booleandragDetect(int x, int y, boolean filter, boolean dragOnTimeout, boolean[] consume) (package private) long(package private) booleanfilterKey(long event) (package private) voidfixIM()(package private) intintReturns the line number of the caret.Returns a point describing the location of the caret relative to the receiver.intReturns the character position of the caret.intReturns the number of characters.(package private) GdkRGBA(package private) GdkRGBAbooleanReturns the double click enabled flag.charReturns the echo character.booleanReturns the editable state.intReturns the number of lines.Returns the line delimiter.intReturns the height of a line.Returns the widget message.intReturns the orientation of the receiver, which will be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.(package private) intgetPosition(Point point) Returns aPointwhose x coordinate is the character position representing the start of the selected text, and whose y coordinate is the character position representing the end of the selection.intReturns the number of selected characters.Gets the selected text, or an empty string if there is no current selection.intgetTabs()Returns the number of tabs.(package private) intgetTabWidth(int tabs) getText()Returns the widget text.getText(int start, int end) Returns a range of text.char[]Returns the widget's text as a character array.intReturns the maximum number of characters that the receiver is capable of holding.intReturns the zero-relative index of the line which is currently at the top of the receiver.intReturns the top SWT logical point.(package private) longgtk_activate(long widget) (package private) longgtk_button_press_event(long widget, long event) (package private) longgtk_changed(long widget) (package private) longgtk_commit(long imContext, long text) (package private) longgtk_delete_range(long widget, long iter1, long iter2) (package private) longgtk_delete_text(long widget, long start_pos, long end_pos) (package private) longgtk_draw(long widget, long cairo) (package private) longgtk_focus_out_event(long widget, long event) (package private) longgtk_grab_focus(long widget) (package private) longgtk_icon_release(long widget, long icon_pos, long event) (package private) longgtk_insert_text(long widget, long new_text, long new_text_length, long position) (package private) longgtk_populate_popup(long widget, long menu) (package private) longgtk_text_buffer_insert_text(long widget, long iter, long text, long length) (package private) longgtk3_event_after(long widget, long gdkEvent) (package private) longgtk3_key_press_event(long widget, long event) (package private) voidvoidInserts a string.(package private) booleanWidgets with unusual bounds calculation behavior can override this method to returntrueif the widget must be visible during call toControl.setInitialBounds().(package private) longvoidpaste()Pastes text from clipboard.(package private) voidregister()(package private) voidvoidremoveModifyListener(ModifyListener listener) Removes the listener from the collection of listeners who will be notified when the receiver's text is modified.voidremoveSegmentListener(SegmentListener listener) Removes the listener from the collection of listeners who will be notified when the receiver's text is modified.voidremoveSelectionListener(SelectionListener listener) Removes the listener from the collection of listeners who will be notified when the control is selected by the user.voidremoveVerifyListener(VerifyListener listener) Removes the listener from the collection of listeners who will be notified when the control is verified.private voidscrollIfNotVisible(byte[] iter, byte[] scrollTo, boolean insert) Methods that insert or select text should not modify the topIndex of the viewer.voidSelects all the text in the receiver.(package private) voidsetBackgroundGdkRGBA(long context, long handle, GdkRGBA rgba) (package private) voidsetCursor(long cursor) voidsetDoubleClickEnabled(boolean doubleClick) Sets the double click enabled flag.voidsetEchoChar(char echo) Sets the echo character.voidsetEditable(boolean editable) Sets the editable state.(package private) voidsetFontDescription(long font) (package private) voidsetForegroundGdkRGBA(GdkRGBA rgba) voidsetMessage(String message) Sets the widget message.voidsetOrientation(int orientation) Sets the orientation of the receiver, which must be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.voidsetSelection(int start) Sets the selection.voidsetSelection(int start, int end) Sets the selection to the range specified by the given start and end indices.voidsetSelection(Point selection) Sets the selection to the range specified by the given point, where the x coordinate represents the start index and the y coordinate represents the end index.voidsetTabs(int tabs) Sets the number of tabs.(package private) voidsetTabStops(int tabs) (package private) voidsetText(char[] text) voidSets the contents of the receiver to the given string.voidsetTextChars(char[] text) Sets the contents of the receiver to the characters in the array.voidsetTextLimit(int limit) Sets the maximum number of characters that the receiver is capable of holding to be the argument.voidsetTopIndex(int index) Sets the zero-relative index of the line which is currently at the top of the receiver.voidShows the selection.(package private) inttranslateOffset(int offset) (package private) booleantranslateTraversal(long event) (package private) inttraversalCode(int key, long event) (package private) intuntranslateOffset(int offset) (package private) StringverifyText(String string, int start, int end) (package private) longwindowProc(long handle, long user_data) (package private) longwindowProc(long handle, long arg0, long user_data) (package private) longwindowProc(long handle, long arg0, long arg1, long user_data) (package private) longwindowProc(long handle, long arg0, long arg1, long arg2, long user_data) Methods inherited from class Scrollable
clientHandle, computeTrim, createScrollBar, destroyScrollBar, getClientArea, getClientAreaInPixels, getHorizontalBar, getScrollbarsMode, getVerticalBar, gtk_scroll_event, hScrollBarWidth, redrawBackgroundImage, redrawWidget, releaseChildren, releaseHandle, resizeHandle, reskinChildren, sendLeaveNotify, setOrientation, setScrollbarsMode, setScrollBarVisible, showWidget, topHandle, updateBackgroundMode, updateScrollBarValue, vScrollBarWidthMethods inherited from class Control
_getAccessible, _getShell, addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addRelation, addTouchListener, addTraverseListener, adjustChildClipping, cairoClipRegion, cairoCopyRegion, cairoDisposeRegion, checkBackground, checkBorder, checkBuffered, checkMirrored, checkSubwindow, cleanupEnableWindow, computeNativeSize, computeSize, computeSize, computeSizeInPixels, computeTabGroup, computeTabList, computeTabRoot, containedInRegion, defaultFont, destroyWidget, dragDetect, dragDetect, dragDetect, drawBackground, drawGripper, drawWidget, enableWidget, enterExitHandle, eventHandle, eventSurface, findBackgroundControl, findMenus, fixChildren, fixFocus, fixGdkEventTypeValues, fixModal, fixParentGdkResource, fixStyle, fixStyle, flushQueueOnDnd, focusHandle, fontHandle, forceFocus, forceFocus, forceResize, gestureBeginProc, gestureEndProc, gestureHandle, getAccessible, getBackground, getBackgroundGdkRGBA, getBackgroundImage, getBaseGdkRGBA, getBgGdkRGBA, getBorderWidth, getBounds, getBoundsInPixels, getClientWidth, getControl, getControlOrigin, getCursor, getDragDetect, getEnabled, getFont, getFontDescription, getForeground, getForegroundGdkRGBA, getIMCaretPos, getLayoutData, getLocation, getLocationInPixels, getMenu, getMonitor, getParent, getPath, getRegion, getShell, getSize, getSizeInPixels, getSurfaceOrigin, getTextDirection, getThickness, getToolTipText, getTouchEnabled, getVisible, getWindowOrigin, gtk_button_press_event, gtk_button_release_event, gtk_css_provider_load_from_css, gtk_enter_notify_event, gtk_focus, gtk_focus_in_event, gtk_gesture_press_event, gtk_gesture_release_event, gtk_label_set_align, gtk_leave_notify_event, gtk_mnemonic_activate, gtk_motion_notify_event, gtk_preedit_changed, gtk_realize, gtk_style_context_get_border, gtk_style_context_get_padding, gtk_style_updated, gtk_unrealize, gtk_widget_reparent, gtk_widget_set_align, gtk3_key_release_event, gtk3_popup_menu, gtk3_show_help, gtk4_draw, gtk4_enter_event, gtk4_focus_enter_event, gtk4_focus_leave_event, gtk4_focus_window_event, gtk4_key_press_event, gtk4_key_release_event, gtk4_leave_event, gtk4_motion_event, gtk4_scroll_event, hasFocus, hooksPaint, hoverProc, imHandle, internal_dispose_GC, internal_new_GC, isActive, isAutoScalable, isDescribedByLabel, isEnabled, isFocusAncestor, isFocusControl, isFocusHandle, isReparentable, isShowing, isTabGroup, isTabItem, isVisible, magnifyProc, markLayout, menuShell, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, moveChildren, moveHandle, pack, pack, paintHandle, paintSurface, print, printWidget, printWindow, redraw, redraw, redraw, redrawChildren, release, releaseParent, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeRelation, removeTouchListener, removeTraverseListener, requestLayout, resizeCalculationsGTK3, restackWindow, rotateProc, sendDragEvent, sendFocusEvent, sendGestureEvent, sendGestureEvent, sendGestureEvent, sendHelpEvent, sendMouseEvent, sendMouseEvent, setBackground, setBackground, setBackgroundGdkRGBA, setBackgroundGdkRGBA, setBackgroundImage, setBackgroundSurface, setBounds, setBounds, setBounds, setBoundsInPixels, setBoundsInPixels, setCapture, setCursor, setDragDetect, setEnabled, setFocus, setFont, setForeground, setForegroundGdkRGBA, setInitialBounds, setLayoutData, setLocation, setLocation, setLocationInPixels, setLocationInPixels, setMenu, setParent, setParentBackground, setParentGdkResource, setRadioSelection, setRedraw, setRegion, setRelations, setSize, setSize, setSizeInPixels, setSizeInPixels, setTabItemFocus, setTextDirection, setToolTipText, setToolTipText, setTouchEnabled, setVisible, setWidgetBackground, setZOrder, setZOrder, showMenu, showMenu, sort, swipeProc, toControl, toControl, toDisplay, toDisplay, toDisplayInPixels, translateMnemonic, translateMnemonic, traverse, traverse, traverse, traverse, traverse, traverseEscape, traverseGroup, traverseItem, traverseMnemonic, traversePage, traverseReturn, update, update, updateLayout, wantDragDropDetectionMethods inherited from class Widget
_addListener, addDisposeListener, addListener, addTypedListener, cellDataProc, checkBits, checkOpen, checkOrientation, checkParent, checkSubclass, checkWidget, convertPangoFontDescriptionToCss, cssHandle, dispose, dpiChanged, enterMotionProc, error, filterProc, filters, fixMnemonic, fixMnemonic, fixMnemonic, focusProc, fontHeight, gdk_event_free, gdk_event_get_state, gdk_event_get_surface_or_window, gdk_pointer_grab, gdk_pointer_ungrab, gdk_surface_get_size, gdk_window_get_size, GdkSeatGrabPrepareFunc, gesturePressReleaseProc, getData, getData, getDisplay, getListeners, getName, getNameText, getStyle, getTypedListeners, gtk_adjustment_get, gtk_box_new, gtk_box_pack_end, gtk_box_set_child_packing, gtk_cell_renderer_get_preferred_size, gtk_change_value, gtk_clicked, gtk_close_request, gtk_configure_event, gtk_container_get_border_width_or_margin, gtk_container_set_border_width, gtk_create_menu_proxy, gtk_day_selected, gtk_day_selected_double_click, gtk_delete_event, gtk_expand_collapse_cursor_row, gtk_hide, gtk_input, gtk_map, gtk_map_event, gtk_menu_popped_up, gtk_month_changed, gtk_move_focus, gtk_output, gtk_row_activated, gtk_row_has_child_toggled, gtk_scroll_child, gtk_select, gtk_selection_done, gtk_show, gtk_size_allocate, gtk_start_interactive_search, gtk_status_icon_popup_menu, gtk_switch_page, gtk_test_collapse_row, gtk_test_expand_row, gtk_timer, gtk_toggled, gtk_tree_view_column_cell_get_position, gtk_unmap, gtk_unmap_event, gtk_value_changed, gtk_widget_get_preferred_size, gtk_widget_get_surface, gtk_widget_get_window, gtk_widget_hide, gtk_widget_show, gtk_widget_size_allocate, gtk_window_state_event, hooks, isAutoDirection, isDisposed, isListening, isValidSubclass, isValidThread, keyPressReleaseProc, leaveProc, mnemonicHit, mnemonicMatch, notifyCreationTracker, notifyDisposalTracker, notifyListeners, notifyProc, notifyState, postEvent, postEvent, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, rendererGetPreferredWidthProc, rendererRenderProc, rendererSnapshotProc, reskin, reskinWidget, scrollProc, sendEvent, sendEvent, sendEvent, sendEvent, sendIMKeyEvent, sendKeyEvent, sendSelectionEvent, sendSelectionEvent, setButtonState, setData, setData, setFontDescription, setInputState, setKeyState, setLocationState, setTabGroupFocus, setToolTipText, shellMapProc, sizeAllocateProc, sizeRequestProc, snapshotToDraw, timerProc, toString, translateTraversal, windowActiveProc, windowProc
-
Field Details
-
bufferHandle
long bufferHandle -
imContext
long imContext -
tabs
int tabs -
lastEventTime
int lastEventTime -
gdkEventKey
long gdkEventKey -
fixStart
int fixStart -
fixEnd
int fixEnd -
doubleClick
boolean doubleClick -
message
String message -
textHandle
long textHandleGTK4 only field, holds the address to the underlying GtkText widget. -
LTR_MARK
static final char LTR_MARK- See Also:
-
RTL_MARK
static final char RTL_MARK- See Also:
-
segments
int[] segments -
ITER_SIZEOF
static final int ITER_SIZEOF -
SPACE_FOR_CURSOR
static final int SPACE_FOR_CURSOR- See Also:
-
LIMIT
public static final int LIMITThe maximum number of characters that can be entered into a text widget.Note that this value is platform dependent, based upon the native widget implementation.
-
DELIMITER
The delimiter used by multi-line text widgets. When text is queried and from the widget, it will be delimited using this delimiter. -
background
GdkRGBA background -
foreground
GdkRGBA foreground -
indexMark
long indexMark -
cachedAdjustment
double cachedAdjustment -
currentAdjustment
double currentAdjustment
-
-
Constructor Details
-
Text
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
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
parent- a composite control which will be the parent of the new instance (cannot be null)style- the style of control to construct- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
- See Also:
-
-
Method Details
-
checkStyle
static int checkStyle(int style) -
createHandle
void createHandle(int index) - Overrides:
createHandlein classWidget
-
applyThemeBackground
int applyThemeBackground()- Overrides:
applyThemeBackgroundin classScrollable- Returns:
- 0 to remove THEME_BACKGROUND
- 1 to apply THEME_BACKGROUND
- otherwise don't change THEME_BACKGROUND state
-
createWidget
void createWidget(int index) - Overrides:
createWidgetin classScrollable
-
addModifyListener
Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by sending it one of the messages defined in theModifyListenerinterface.- Parameters:
listener- the 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
- See Also:
-
addSegmentListener
Adds a segment listener.A
SegmentEventis sent whenever text content is being modified or a segment listener is added or removed. You can customize the appearance of text by indicating certain characters to be inserted at certain text offsets. This may be used for bidi purposes, e.g. when adjacent segments of right-to-left text should not be reordered relative to each other. E.g., multiple Java string literals in a right-to-left language should generally remain in logical order to each other, that is, the way they are stored.Warning: This API is currently only implemented on Windows and GTK.
SegmentEvents won't be sent on Cocoa.- Parameters:
listener- the 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
- Since:
- 3.8
- See Also:
-
addSelectionListener
Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in theSelectionListenerinterface.widgetSelectedis not called for texts.widgetDefaultSelectedis typically called when ENTER is pressed in a single-line text, or when ENTER is pressed in a search text. If the receiver has theSWT.SEARCH | SWT.ICON_CANCELstyle and the user cancels the search, the event object detail field contains the valueSWT.ICON_CANCEL. Likewise, if the receiver has theSWT.ICON_SEARCHstyle and the icon search is selected, the event object detail field contains the valueSWT.ICON_SEARCH.- Parameters:
listener- the listener which should be notified when the control is selected by the user- 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
- See Also:
-
addVerifyListener
Adds the listener to the collection of listeners who will be notified when the receiver's text is verified, by sending it one of the messages defined in theVerifyListenerinterface.- Parameters:
listener- the 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
- See Also:
-
append
Appends a string.The new text is appended to the text at the end of the widget.
- Parameters:
string- the string to be appended- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the string 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
-
applySegments
void applySegments() -
clearSegments
void clearSegments(boolean applyText) -
clearSelection
public void clearSelection()Clears the selection.- 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
-
computeSizeInPixels
- Overrides:
computeSizeInPixelsin classControl
-
computeTrimInPixels
- Overrides:
computeTrimInPixelsin classScrollable
-
copy
public void copy()Copies the selected text.The current selection is copied to the clipboard.
- 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
-
cut
public void cut()Cuts the selected text.The current selection is first copied to the clipboard and then deleted from the widget.
- 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
-
deprocessText
char[] deprocessText(char[] text, int start, int end) -
defaultBackground
GdkRGBA defaultBackground()- Overrides:
defaultBackgroundin classControl
-
deregister
void deregister()- Overrides:
deregisterin classScrollable
-
dragDetect
boolean dragDetect(int x, int y, boolean filter, boolean dragOnTimeout, boolean[] consume) - Overrides:
dragDetectin classControl
-
eventWindow
long eventWindow()- Overrides:
eventWindowin classControl
-
filterKey
-
fixIM
void fixIM() -
getBorderWidthInPixels
int getBorderWidthInPixels()- Overrides:
getBorderWidthInPixelsin classScrollable
-
getCaretLineNumber
public int getCaretLineNumber()Returns the line number of the caret.The line number of the caret is returned.
- Returns:
- the line number
- 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
-
getCaretLocation
Returns a point describing the location of the caret relative to the receiver.- Returns:
- a point, the location of the caret
- 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
-
getCaretPosition
public int getCaretPosition()Returns the character position of the caret.Indexing is zero based.
- Returns:
- the position of the caret
- 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
-
getCharCount
public int getCharCount()Returns the number of characters.- Returns:
- number of characters in the widget
- 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
-
getDoubleClickEnabled
public boolean getDoubleClickEnabled()Returns the double click enabled flag.The double click flag enables or disables the default action of the text widget when the user double clicks.
- Returns:
- whether or not double click is enabled
- 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
-
getEchoChar
public char getEchoChar()Returns the echo character.The echo character is the character that is displayed when the user enters text or the text is changed by the programmer.
- Returns:
- the echo character
- 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
- See Also:
-
getEditable
public boolean getEditable()Returns the editable state.- Returns:
- whether or not the receiver is editable
- 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
-
getLineCount
public int getLineCount()Returns the number of lines.- Returns:
- the number of lines in the widget
- 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
-
getLineDelimiter
Returns the line delimiter.- Returns:
- a string that is the line delimiter
- 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
- See Also:
-
getLineHeight
public int getLineHeight()Returns the height of a line.- Returns:
- the height of a row of 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
-
getMessage
Returns the widget message. The message text is displayed as a hint for the user, indicating the purpose of the field.Typically this is used in conjunction with
SWT.SEARCH.- Returns:
- the widget message
- 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
- Since:
- 3.3
-
getOrientation
public int getOrientation()Returns the orientation of the receiver, which will be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.- Overrides:
getOrientationin classControl- 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
- Since:
- 2.1.2
-
getPosition
-
getSelection
Returns aPointwhose x coordinate is the character position representing the start of the selected text, and whose y coordinate is the character position representing the end of the selection. An "empty" selection is indicated by the x and y coordinates having the same value.Indexing is zero based. The range of a selection is from 0..N where N is the number of characters in the widget.
- Returns:
- a point representing the selection start and end
- 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
-
getSelectionCount
public int getSelectionCount()Returns the number of selected characters.- Returns:
- the number of selected characters.
- 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
-
getSelectionText
Gets the selected text, or an empty string if there is no current selection.- Returns:
- the selected 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
-
getTabs
public int getTabs()Returns the number of tabs.Tab stop spacing is specified in terms of the space (' ') character. The width of a single tab stop is the pixel width of the spaces.
- Returns:
- the number of tab characters
- 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
-
getTabWidth
int getTabWidth(int tabs) -
getText
Returns the widget text.The text for a text widget is the characters in the widget, or an empty string if this has never been set.
- Returns:
- the widget 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
-
getText
Returns a range of text. Returns an empty string if the start of the range is greater than the 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.
- Parameters:
start- the start of the rangeend- the end of the range- Returns:
- the range of 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
-
getTextChars
public char[] getTextChars()Returns the widget's text as a character array.The text for a text widget is the characters in the widget, or a zero-length array if this has never been set.
Note: Use this API to prevent the text from being written into a String object whose lifecycle is outside of your control. This can help protect the text, for example, when the widget is used as a password field. However, the text can't be protected if an
SWT.SegmentsorSWT.Verifylistener has been added to the widget.- Returns:
- a character array that contains the widget's 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
- Since:
- 3.7
- See Also:
-
getTextLimit
public int getTextLimit()Returns the maximum number of characters that the receiver is capable of holding.If this has not been changed by
setTextLimit(), it will be the constantText.LIMIT.- Returns:
- the text limit
- 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
- See Also:
-
getTopIndex
public int getTopIndex()Returns the zero-relative index of the line which is currently at the top of the receiver.This index can change when lines are scrolled or new lines are added or removed.
- Returns:
- the index of the top line
- 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
-
getTopPixel
public int getTopPixel()Returns the top SWT logical point.The top point is the SWT logical point position of the line that is currently at the top of the widget. On some platforms, a text widget can be scrolled by points instead of lines so that a partial line is displayed at the top of the widget.
The top SWT logical point changes when the widget is scrolled. The top SWT logical point does not include the widget trimming.
- Returns:
- the SWT logical point position of the top line
- 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
-
gtk_activate
long gtk_activate(long widget) - Overrides:
gtk_activatein classWidget
-
gtk_button_press_event
long gtk_button_press_event(long widget, long event) - Overrides:
gtk_button_press_eventin classControl
-
gtk_changed
long gtk_changed(long widget) - Overrides:
gtk_changedin classWidget
-
gtk_commit
long gtk_commit(long imContext, long text) - Overrides:
gtk_commitin classControl
-
gtk_delete_range
long gtk_delete_range(long widget, long iter1, long iter2) - Overrides:
gtk_delete_rangein classWidget
-
gtk_delete_text
long gtk_delete_text(long widget, long start_pos, long end_pos) - Overrides:
gtk_delete_textin classWidget
-
gtk3_event_after
long gtk3_event_after(long widget, long gdkEvent) - Overrides:
gtk3_event_afterin classControl
-
gtk_draw
long gtk_draw(long widget, long cairo) - Overrides:
gtk_drawin classScrollable
-
mustBeVisibleOnInitBounds
boolean mustBeVisibleOnInitBounds()Description copied from class:ControlWidgets with unusual bounds calculation behavior can override this method to returntrueif the widget must be visible during call toControl.setInitialBounds().- Overrides:
mustBeVisibleOnInitBoundsin classControl- Returns:
falseby default on modern GTK 3 versions (3.20+).
-
gtk_focus_out_event
long gtk_focus_out_event(long widget, long event) - Overrides:
gtk_focus_out_eventin classControl
-
gtk_grab_focus
long gtk_grab_focus(long widget) - Overrides:
gtk_grab_focusin classWidget
-
gtk_icon_release
long gtk_icon_release(long widget, long icon_pos, long event) - Overrides:
gtk_icon_releasein classWidget
-
gtk_insert_text
long gtk_insert_text(long widget, long new_text, long new_text_length, long position) - Overrides:
gtk_insert_textin classWidget
-
gtk3_key_press_event
long gtk3_key_press_event(long widget, long event) - Overrides:
gtk3_key_press_eventin classControl
-
gtk_populate_popup
long gtk_populate_popup(long widget, long menu) - Overrides:
gtk_populate_popupin classWidget
-
gtk_text_buffer_insert_text
long gtk_text_buffer_insert_text(long widget, long iter, long text, long length) - Overrides:
gtk_text_buffer_insert_textin classWidget
-
hookEvents
void hookEvents()- Overrides:
hookEventsin classControl
-
insert
Inserts a string.The old selection is replaced with the new text.
- Parameters:
string- the string- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the string is
null
- ERROR_NULL_ARGUMENT - if the string is
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
scrollIfNotVisible
private void scrollIfNotVisible(byte[] iter, byte[] scrollTo, boolean insert) Methods that insert or select text should not modify the topIndex of the viewer. To avoid this issue we calculate the visible area, positions of the topIndex, and the insertion/selection points. If the insertion/selection points are outside the visible area, then scroll to them. Otherwise do nothing, which preserves the topIndex.- Parameters:
iter- the GtkTextIter representing the insertion/selection pointscrollTo- the GtkTextIter representing the point to be scrolled to (can be null)insert- true if insertion is being performed, false if selection
-
paintWindow
long paintWindow()- Overrides:
paintWindowin classControl
-
paste
public void paste()Pastes text from clipboard.The selected text is deleted from the widget and new text inserted from the clipboard.
Note: Pasting data to controls may occurs asynchronously. The widget text may not reflect the updated value immediately after calling this method. The new text will appear once pending events are processed in the event loop. Use
Display.asyncExec(Runnable)before accessinggetText().- 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
-
register
void register()- Overrides:
registerin classScrollable
-
releaseWidget
void releaseWidget()- Overrides:
releaseWidgetin classControl
-
removeModifyListener
Removes the listener from the collection of listeners who will be notified when the receiver's text is modified.- Parameters:
listener- the 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
- See Also:
-
removeSegmentListener
Removes the listener from the collection of listeners who will be notified when the receiver's text is modified.- Parameters:
listener- the 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
- Since:
- 3.8
- See Also:
-
removeSelectionListener
Removes the listener from the collection of listeners who will be notified when the control is selected by the user.- Parameters:
listener- the 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
- See Also:
-
removeVerifyListener
Removes the listener from the collection of listeners who will be notified when the control is verified.- Parameters:
listener- the 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
- See Also:
-
selectAll
public void selectAll()Selects all the text in 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
-
getContextBackgroundGdkRGBA
GdkRGBA getContextBackgroundGdkRGBA()- Overrides:
getContextBackgroundGdkRGBAin classControl
-
getContextColorGdkRGBA
GdkRGBA getContextColorGdkRGBA()- Overrides:
getContextColorGdkRGBAin classControl
-
setBackgroundGdkRGBA
- Overrides:
setBackgroundGdkRGBAin classControl
-
setForegroundGdkRGBA
- Overrides:
setForegroundGdkRGBAin classControl
-
setCursor
-
setDoubleClickEnabled
public void setDoubleClickEnabled(boolean doubleClick) Sets the double click enabled flag.The double click flag enables or disables the default action of the text widget when the user double clicks.
Note: This operation is a hint and is not supported on platforms that do not have this concept.
- Parameters:
doubleClick- the new double click flag- 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
-
setEchoChar
public void setEchoChar(char echo) Sets the echo character.The echo character is the character that is displayed when the user enters text or the text is changed by the programmer. Setting the echo character to '\0' clears the echo character and redraws the original text. If for any reason the echo character is invalid, or if the platform does not allow modification of the echo character, the default echo character for the platform is used.
- Parameters:
echo- the new echo character- 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
-
setEditable
public void setEditable(boolean editable) Sets the editable state.- Parameters:
editable- the new editable 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
-
setFontDescription
void setFontDescription(long font) - Overrides:
setFontDescriptionin classControl
-
setMessage
Sets the widget message. The message text is displayed as a hint for the user, indicating the purpose of the field.Typically this is used in conjunction with
SWT.SEARCH.- Parameters:
message- the new message- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the message 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
- Since:
- 3.3
-
setOrientation
public void setOrientation(int orientation) Sets the orientation of the receiver, which must be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.Note: This operation is a hint and is not supported on platforms that do not have this concept.
- Overrides:
setOrientationin classControl- Parameters:
orientation- new 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
- Since:
- 2.1.2
-
setSelection
public void setSelection(int start) Sets the 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 regular array indexing rules.
- Parameters:
start- new caret position- 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
-
setSelection
public void setSelection(int start, int end) Sets the selection to the range specified by the given start and end indices.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:
start- the start of the rangeend- the end of the range- 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
-
setSelection
Sets the selection to the range specified by the given point, where the x coordinate represents the start index and the y coordinate represents the end index.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:
selection- the point- 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
-
setTabs
public void setTabs(int tabs) Sets the number of tabs.Tab stop spacing is specified in terms of the space (' ') character. The width of a single tab stop is the pixel width of the spaces.
- Parameters:
tabs- the number of tabs- 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
-
setTabStops
void setTabStops(int tabs) -
setText
Sets the contents of the receiver to the given string. If the receiver has style SINGLE and the argument contains multiple lines of text, the result of this operation is undefined and may vary from platform to platform.Note: If control characters like '\n', '\t' etc. are used in the string, then the behavior is platform dependent.
- Parameters:
string- the new text- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the string 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
-
setTextChars
public void setTextChars(char[] text) Sets the contents of the receiver to the characters in the array. If the receiver has styleSWT.SINGLEand the argument contains multiple lines of text then the result of this operation is undefined and may vary between platforms.Note: Use this API to prevent the text from being written into a String object whose lifecycle is outside of your control. This can help protect the text, for example, when the widget is used as a password field. However, the text can't be protected if an
SWT.SegmentsorSWT.Verifylistener has been added to the widget.- Parameters:
text- a character array that contains the new text- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the array 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
- Since:
- 3.7
- See Also:
-
setText
void setText(char[] text) -
setTextLimit
public void setTextLimit(int limit) Sets the maximum number of characters that the receiver is capable of holding to be the argument.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). Specifying a limit value larger thanText.LIMITsets the receiver's limit toText.LIMIT.- Parameters:
limit- new text limit- Throws:
IllegalArgumentException-- ERROR_CANNOT_BE_ZERO - if the limit is zero
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
setTopIndex
public void setTopIndex(int index) Sets the zero-relative index of the line which is currently at the top of the receiver. This index can change when lines are scrolled or new lines are added and removed.- Parameters:
index- the index of the top item- 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
-
showSelection
public void showSelection()Shows the selection.If the selection is already showing in the receiver, this method simply returns. Otherwise, lines are scrolled until the selection is visible.
- 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
-
translateOffset
int translateOffset(int offset) -
translateTraversal
boolean translateTraversal(long event) - Overrides:
translateTraversalin classControl
-
traversalCode
int traversalCode(int key, long event) - Overrides:
traversalCodein classControl
-
untranslateOffset
int untranslateOffset(int offset) -
verifyText
-
windowProc
long windowProc(long handle, long user_data) - Overrides:
windowProcin classWidget
-
windowProc
long windowProc(long handle, long arg0, long user_data) - Overrides:
windowProcin classControl
-
windowProc
long windowProc(long handle, long arg0, long arg1, long user_data) - Overrides:
windowProcin classWidget
-
windowProc
long windowProc(long handle, long arg0, long arg1, long arg2, long user_data) - Overrides:
windowProcin classWidget
-