public interface IContentAssistSubjectControl
Modifier and Type | Method and Description |
---|---|
void |
addKeyListener(KeyListener keyListener)
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. |
boolean |
addSelectionListener(SelectionListener selectionListener)
If supported, adds a selection listener.
|
boolean |
appendVerifyKeyListener(VerifyKeyListener verifyKeyListener)
If supported, appends a verify key listener to the viewer's list of verify key
listeners.
|
int |
getCaretOffset()
Returns the caret position relative to the start of the text in widget
coordinates.
|
Control |
getControl()
Returns the control of this content assist subject control.
|
IDocument |
getDocument()
Returns this content assist subject control's document.
|
String |
getLineDelimiter()
Returns the line delimiter used for entering new lines by key down or
paste operation.
|
int |
getLineHeight()
Returns the line height.
|
Point |
getLocationAtOffset(int offset)
Returns the x, y location of the upper left corner of the character
bounding box at the specified offset in the text.
|
Point |
getSelectedRange()
Returns the selected range.
|
Point |
getWidgetSelectionRange()
Returns the selected range in the subject's widget.
|
boolean |
prependVerifyKeyListener(VerifyKeyListener verifyKeyListener)
If supported, inserts the verify key listener at the beginning of this content assist
subject's list of verify key listeners.
|
void |
removeKeyListener(KeyListener keyListener)
Removes the listener from the collection of listeners who will be
notified when keys are pressed and released on the system keyboard.
|
void |
removeSelectionListener(SelectionListener selectionListener)
Removes the specified selection listener.
|
void |
removeVerifyKeyListener(VerifyKeyListener verifyKeyListener)
Removes the verify key listener from this content assist subject control's
list of verify key listeners.
|
void |
revealRange(int offset,
int length)
Reveals the given region.
|
void |
setEventConsumer(IEventConsumer eventConsumer)
If supported, registers an event consumer with this content assist
subject.
|
void |
setSelectedRange(int offset,
int length)
Sets the selected range.
|
boolean |
supportsVerifyKeyListener()
Tests whether a verify key listener can be added either using
prependVerifyKeyListener
or appendVerifyKeyListener(VerifyKeyListener) . |
Control getControl()
int getLineHeight()
SWTException
- in these cases:
SWT.ERROR_WIDGET_DISPOSED
- if the receiver has been
disposedSWT.ERROR_THREAD_INVALID_ACCESS
- if not called from the
thread that created the receiverint getCaretOffset()
SWTException
- in these cases:
SWT.ERROR_WIDGET_DISPOSED
- if the receiver has been
disposedSWT.ERROR_THREAD_INVALID_ACCESS
- if not called from the
thread that created the receiverPoint getLocationAtOffset(int offset)
offset
- widget offset relative to the start of the content 0
<= offset <= getCharCount()SWTException
- in these cases:
SWT.ERROR_WIDGET_DISPOSED
- if the receiver has been disposedSWT.ERROR_THREAD_INVALID_ACCESS
- if not called from the thread that created the receiverIllegalArgumentException
- when the offset is outside the valid rangeString getLineDelimiter()
SWTException
- in these cases:
SWT.ERROR_WIDGET_DISPOSED
- if the receiver has been disposedSWT.ERROR_THREAD_INVALID_ACCESS
- if not called from the thread that created the receiverPoint getWidgetSelectionRange()
SWTException
- in these cases:
SWT.ERROR_WIDGET_DISPOSED
- if the receiver has been disposedSWT.ERROR_THREAD_INVALID_ACCESS
- if not called from the thread that created the receiverPoint getSelectedRange()
void setSelectedRange(int offset, int length)
offset
- the offset of the selection based on the subject's model e.g. documentlength
- the length of the selection based on the subject's model e.g. documentvoid revealRange(int offset, int length)
offset
- the offset of the selection based on the subject's model e.g. documentlength
- the length of the selection based on the subject's model e.g. documentIDocument getDocument()
boolean appendVerifyKeyListener(VerifyKeyListener verifyKeyListener)
Note: This content assist subject control may not support appending a verify
listener, in which case false
will be returned. If this
content assist subject control only supports addVerifyKeyListener
then this method can be used but prependVerifyKeyListener
must return false
.
verifyKeyListener
- the listener to be addedtrue
if the listener was addedboolean prependVerifyKeyListener(VerifyKeyListener verifyKeyListener)
Note: This content assist subject control may not support prepending a verify
listener, in which case false
will be returned. However,
appendVerifyKeyListener(VerifyKeyListener)
might work.
verifyKeyListener
- the listener to be insertedtrue
if the listener was addedvoid removeVerifyKeyListener(VerifyKeyListener verifyKeyListener)
verifyKeyListener
- the listener to be removedboolean supportsVerifyKeyListener()
prependVerifyKeyListener
or appendVerifyKeyListener(VerifyKeyListener)
.true
if adding verify key listeners is supportedvoid addKeyListener(KeyListener keyListener)
KeyListener
interface.keyListener
- the listener which should be notifiedIllegalArgumentException
- if the listener is null
SWTException
- in these cases:
SWT.ERROR_WIDGET_DISPOSED
- if the receiver has been disposedSWT.ERROR_THREAD_INVALID_ACCESS
- if not called from the thread that created the receiverKeyListener
,
removeKeyListener(KeyListener)
void removeKeyListener(KeyListener keyListener)
keyListener
- the listener which should be notifiedIllegalArgumentException
- if the listener is nullSWTException
- in these cases:
SWT.ERROR_WIDGET_DISPOSED
- if the receiver has been disposedSWT.ERROR_THREAD_INVALID_ACCESS
- if not called from the thread that created the receiverKeyListener
,
addKeyListener(KeyListener)
void setEventConsumer(IEventConsumer eventConsumer)
eventConsumer
- the content assist subject control's event consumer. null
is a valid argument.void removeSelectionListener(SelectionListener selectionListener)
selectionListener
- the listenerSWTException
- SWT.ERROR_WIDGET_DISPOSED
- if the receiver has been disposedSWT.ERROR_THREAD_INVALID_ACCESS
- if not called from the thread that created the receiverIllegalArgumentException
- if listener is null
boolean addSelectionListener(SelectionListener selectionListener)
selectionListener
- the listenertrue
if adding a selection listener is supported
SWT.ERROR_WIDGET_DISPOSED
- if the receiver has been disposedSWT.ERROR_THREAD_INVALID_ACCESS
- if not called from the thread that created the receiverIllegalArgumentException
- if listener is null
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.