Package org.eclipse.jface.contentassist
Interface IContentAssistSubjectControl
- All Known Implementing Classes:
- AbstractControlContentAssistSubjectAdapter,- ComboContentAssistSubjectAdapter,- TextContentAssistSubjectAdapter
public interface IContentAssistSubjectControl
A content assist subject control can request assistance provided by a
 subject control content assistant.
- Since:
- 3.0
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddKeyListener(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 theKeyListenerinterface.booleanaddSelectionListener(SelectionListener selectionListener) If supported, adds a selection listener.booleanappendVerifyKeyListener(VerifyKeyListener verifyKeyListener) If supported, appends a verify key listener to the viewer's list of verify key listeners.intReturns the caret position relative to the start of the text in widget coordinates.Returns the control of this content assist subject control.Returns this content assist subject control's document.Returns the line delimiter used for entering new lines by key down or paste operation.intReturns the line height.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.Returns the selected range.Returns the selected range in the subject's widget.booleanprependVerifyKeyListener(VerifyKeyListener verifyKeyListener) If supported, inserts the verify key listener at the beginning of this content assist subject's list of verify key listeners.voidremoveKeyListener(KeyListener keyListener) Removes the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.voidremoveSelectionListener(SelectionListener selectionListener) Removes the specified selection listener.voidremoveVerifyKeyListener(VerifyKeyListener verifyKeyListener) Removes the verify key listener from this content assist subject control's list of verify key listeners.voidrevealRange(int offset, int length) Reveals the given region.voidsetEventConsumer(IEventConsumer eventConsumer) If supported, registers an event consumer with this content assist subject.voidsetSelectedRange(int offset, int length) Sets the selected range.booleanTests whether a verify key listener can be added either usingprependVerifyKeyListenerorappendVerifyKeyListener(VerifyKeyListener).
- 
Method Details- 
getControlControl getControl()Returns the control of this content assist subject control.- Returns:
- the control of this content assist subject control
 
- 
getLineHeightint getLineHeight()Returns the line height.- Returns:
- line height in pixel
- Throws:
- SWTException- in these cases:- SWT.ERROR_WIDGET_DISPOSED- if the receiver has been disposed
- SWT.ERROR_THREAD_INVALID_ACCESS- if not called from the thread that created the receiver
 
 
- 
getCaretOffsetint getCaretOffset()Returns the caret position relative to the start of the text in widget coordinates.- Returns:
- the caret position relative to the start of the text in widget coordinates
- Throws:
- SWTException- in these cases:- SWT.ERROR_WIDGET_DISPOSED- if the receiver has been disposed
- SWT.ERROR_THREAD_INVALID_ACCESS- if not called from the thread that created the receiver
 
 
- 
getLocationAtOffsetReturns the x, y location of the upper left corner of the character bounding box at the specified offset in the text. The point is relative to the upper left corner of the widget client area.- Parameters:
- offset- widget offset relative to the start of the content 0 <= offset >= getCharCount()
- Returns:
- x, y location of the upper left corner of the character bounding box at the specified offset in the text
- Throws:
- SWTException- in these cases:- SWT.ERROR_WIDGET_DISPOSED- if the receiver has been disposed
- SWT.ERROR_THREAD_INVALID_ACCESS- if not called from the thread that created the receiver
 
- IllegalArgumentException- when the offset is outside the valid range
 
- 
getLineDelimiterString getLineDelimiter()Returns the line delimiter used for entering new lines by key down or paste operation.- Returns:
- line delimiter used for entering new lines by key down or paste operation
- Throws:
- SWTException- in these cases:- SWT.ERROR_WIDGET_DISPOSED- if the receiver has been disposed
- SWT.ERROR_THREAD_INVALID_ACCESS- if not called from the thread that created the receiver
 
 
- 
getWidgetSelectionRangePoint getWidgetSelectionRange()Returns the selected range in the subject's widget.- Returns:
- start and length of the selection, x is the offset of the
- Throws:
- SWTException- in these cases:- SWT.ERROR_WIDGET_DISPOSED- if the receiver has been disposed
- SWT.ERROR_THREAD_INVALID_ACCESS- if not called from the thread that created the receiver
 
 
- 
getSelectedRangePoint getSelectedRange()Returns the selected range.- Returns:
- start and length of the selection, x is the offset and y the length based on the subject's model (e.g. document)
 
- 
setSelectedRangevoid setSelectedRange(int offset, int length) Sets the selected range. Offset and length based on the subject's model (e.g. document).- Parameters:
- offset- the offset of the selection based on the subject's model e.g. document
- length- the length of the selection based on the subject's model e.g. document
 
- 
revealRangevoid revealRange(int offset, int length) Reveals the given region. Offset and length based on the subject's model (e.g. document).- Parameters:
- offset- the offset of the selection based on the subject's model e.g. document
- length- the length of the selection based on the subject's model e.g. document
 
- 
getDocumentIDocument getDocument()Returns this content assist subject control's document.- Returns:
- the viewer's input document
 
- 
appendVerifyKeyListenerIf supported, appends a verify key listener to the viewer's list of verify key listeners. If the listener is already registered with the viewer this call moves the listener to the end of the list.Note: This content assist subject control may not support appending a verify listener, in which case falsewill be returned. If this content assist subject control only supportsaddVerifyKeyListenerthen this method can be used butprependVerifyKeyListenermust returnfalse.- Parameters:
- verifyKeyListener- the listener to be added
- Returns:
- trueif the listener was added
 
- 
prependVerifyKeyListenerIf supported, inserts the verify key listener at the beginning of this content assist subject's list of verify key listeners. If the listener is already registered with the viewer this call moves the listener to the beginning of the list.Note: This content assist subject control may not support prepending a verify listener, in which case falsewill be returned. However,appendVerifyKeyListener(VerifyKeyListener)might work.- Parameters:
- verifyKeyListener- the listener to be inserted
- Returns:
- trueif the listener was added
 
- 
removeVerifyKeyListenerRemoves the verify key listener from this content assist subject control's list of verify key listeners. If the listener is not registered, this call has no effect.- Parameters:
- verifyKeyListener- the listener to be removed
 
- 
supportsVerifyKeyListenerboolean supportsVerifyKeyListener()Tests whether a verify key listener can be added either usingprependVerifyKeyListenerorappendVerifyKeyListener(VerifyKeyListener).- Returns:
- trueif adding verify key listeners is supported
 
- 
addKeyListenerAdds 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 theKeyListenerinterface.- Parameters:
- keyListener- the listener which should be notified
- Throws:
- IllegalArgumentException- if the listener is- null
- SWTException- in these cases:- SWT.ERROR_WIDGET_DISPOSED- if the receiver has been disposed
- SWT.ERROR_THREAD_INVALID_ACCESS- if not called from the thread that created the receiver
 
- See Also:
 
- 
removeKeyListenerRemoves the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.- Parameters:
- keyListener- the listener which should be notified
- Throws:
- IllegalArgumentException- if the listener is null
- SWTException- in these cases:- SWT.ERROR_WIDGET_DISPOSED- if the receiver has been disposed
- SWT.ERROR_THREAD_INVALID_ACCESS- if not called from the thread that created the receiver
 
- See Also:
 
- 
setEventConsumerIf supported, registers an event consumer with this content assist subject.- Parameters:
- eventConsumer- the content assist subject control's event consumer.- nullis a valid argument.
 
- 
removeSelectionListenerRemoves the specified selection listener.- Parameters:
- selectionListener- the listener
- Throws:
- SWTException-- SWT.ERROR_WIDGET_DISPOSED- if the receiver has been disposed
- SWT.ERROR_THREAD_INVALID_ACCESS- if not called from the thread that created the receiver
 
- IllegalArgumentException- if listener is- null
 
- 
addSelectionListenerIf supported, adds a selection listener. A Selection event is sent by the widget when the selection has changed.- Parameters:
- selectionListener- the listener
- Returns:
- trueif adding a selection listener is supported- SWT.ERROR_WIDGET_DISPOSED- if the receiver has been disposed
- SWT.ERROR_THREAD_INVALID_ACCESS- if not called from the thread that created the receiver
 
- Throws:
- IllegalArgumentException- if listener is- null
 
 
-