Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.jface.contentassist
Interface IContentAssistSubjectControl

All Known Implementing Classes:
  AbstractControlContentAssistSubjectAdapter

public interface IContentAssistSubjectControl

A content assist subject control can request assistance provided by a subject control content assistant.

Since:
  3.0

Method Summary
`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)`.

Method Detail

### getControl

    public Control getControl()

  Returns the control of this content assist subject control.

  Returns:
    the control of this content assist subject control

### getLineHeight

    public int getLineHeight()

  Returns the line height.

  Returns:
    line height in pixel
  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

### getCaretOffset

    public int 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` -
    - `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

### getLocationAtOffset

    public 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. 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` -
    - `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

### getLineDelimiter

    public String 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` -
    - `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

### getWidgetSelectionRange

    public Point 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` -
    - `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

### getSelectedRange

    public Point 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)

### setSelectedRange

    public void 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

### revealRange

    public void 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

### getDocument

    public IDocument getDocument()

  Returns this content assist subject control's document.

  Returns:
    the viewer's input document

### appendVerifyKeyListener

    public boolean appendVerifyKeyListener(VerifyKeyListener verifyKeyListener)

  If 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 `false` will be returned. If this content assist subject control only supports `addVerifyKeyListener` then this method can be used but `prependVerifyKeyListener` must return `false`.

  Parameters:
    `verifyKeyListener` - the listener to be added
  Returns:
    `true` if the listener was added

### prependVerifyKeyListener

    public 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. 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 `false` will be returned. However, `appendVerifyKeyListener(VerifyKeyListener)` might work.

  Parameters:
    `verifyKeyListener` - the listener to be inserted
  Returns:
    `true` if the listener was added

### removeVerifyKeyListener

    public void removeVerifyKeyListener(VerifyKeyListener verifyKeyListener)

  Removes 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

### supportsVerifyKeyListener

    public boolean supportsVerifyKeyListener()

  Tests whether a verify key listener can be added either using `prependVerifyKeyListener` or `appendVerifyKeyListener(VerifyKeyListener)`.

  Returns:
    `true` if adding verify key listeners is supported

### addKeyListener

    public 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.

  Parameters:
    `keyListener` - the listener which should be notified
  Throws:
    `IllegalArgumentException` - if the listener is `null`
    `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
  See Also:
    `KeyListener`, `removeKeyListener(KeyListener)`

### removeKeyListener

    public 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.

  Parameters:
    `keyListener` - the listener which should be notified
  Throws:
    `IllegalArgumentException` - if the listener is null
    `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
  See Also:
    `KeyListener`, `addKeyListener(KeyListener)`

### setEventConsumer

    public void setEventConsumer(IEventConsumer eventConsumer)

  If supported, registers an event consumer with this content assist subject.

  Parameters:
    `eventConsumer` - the content assist subject control's event consumer. `null` is a valid argument.

### removeSelectionListener

    public void removeSelectionListener(SelectionListener selectionListener)

  Removes 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`

### addSelectionListener

    public boolean addSelectionListener(SelectionListener selectionListener)

  If supported, adds a selection listener. A Selection event is sent by the widget when the selection has changed.

  Parameters:
    `selectionListener` - the listener
  Returns:
    `true` if 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.