Top Description Constructors Methods
org.eclipse.swt.accessibility

public Class AccessibleTextExtendedAdapter

extends AccessibleTextAdapter
implements AccessibleTextExtendedListener
Class Inheritance
All Implemented Interfaces
org.eclipse.swt.accessibility.AccessibleTextExtendedListener, org.eclipse.swt.accessibility.AccessibleTextListener, org.eclipse.swt.internal.SWTEventListener, java.util.EventListener

This adapter class provides default implementations for the methods in the AccessibleTextExtendedListener interface.

Classes that wish to deal with AccessibleTextExtended events can extend this class and override only the methods that they are interested in.

Since
3.6
See Also
AccessibleTextExtendedListener, AccessibleTextEvent

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addSelection(AccessibleTextEvent
an event object containing the following fields:
  • [in] start - the 0 based offset of the first character of the new selection
  • [in] end - the 0 based offset after the last character of the new selection
  • [out] result - set to ACC#OK if the text selection was added
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.addSelection.

Adds a text selection.
public void
getCharacterCount(AccessibleTextEvent
an event object containing the following fields:
  • [out] count - the total number of characters
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getCharacterCount.

Returns the total number of characters in the text.
public void
getHyperlinkCount(AccessibleTextEvent
an event object containing the following fields:
  • [out] count - the number of links and link groups within this hypertext paragraph, or 0 if there are none
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getHyperlinkCount.

Returns the number of links and link groups contained within this hypertext paragraph.
public void
getHyperlinkIndex(AccessibleTextEvent
an event object containing the following fields:
  • [in] offset - the 0 based offset of the character for which to return the link index
  • [out] index - the 0 based index of the hyperlink that is associated with this character offset, or -1 if the offset is not in a link
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getHyperlinkIndex.

Returns the index of the hyperlink that is associated with this character offset.
public void
getOffsetAtPoint(AccessibleTextEvent
an event object containing the following fields:
  • [in] x - the X value in display coordinates for which to look up the offset of the character that is rendered on the display at that point
  • [in] y - the position's Y value for which to look up the offset of the character that is rendered on the display at that point
  • [out] offset - the 0 based offset of the character under the given point, or -1 if the point is invalid or there is no character under the point
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getOffsetAtPoint.

Returns the offset of the character under the specified point.
public void
getRanges(AccessibleTextEvent
an event object containing the following fields:
  • [in] x - the X coordinate of the top left corner of the bounding box, in display relative coordinates
  • [in] y - the Y coordinate of the top left corner of the bounding box, in display relative coordinates
  • [in] width - the width of the bounding box
  • [in] height - the height of the bounding box
  • [typical out] start - the 0 based offset of the first character of the substring in the bounding box
  • [typical out] end - the 0 based offset after the last character of the substring in the bounding box
  • [optional out] ranges - an array of pairs specifying the start and end offsets of each range, if the text range is clipped by the bounding box
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getRanges.

Returns the text range(s) contained within the given bounding box.
public void
getSelection(AccessibleTextEvent
an event object containing the following fields:
  • [in] index - the 0 based index of the selection
  • [out] start - the 0 based offset of first selected character
  • [out] end - the 0 based offset after the last selected character
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getSelection.

Returns the character offsets of the specified text selection.
public void
getSelectionCount(AccessibleTextEvent
an event object containing the following fields:
  • [out] count - the number of active non-contiguous selections
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getSelectionCount.

Returns the number of active non-contiguous selections.
public void
getText(AccessibleTextEvent
an event object containing the following fields:
  • [in] type - the boundary type of the substring to return. One of:
  • [in,out] start - the 0 based offset of first character of the substring
  • [in,out] end - the 0 based offset after the last character of the substring
  • [in,out] count - the number of boundary type units to move to find the substring:
    • in - look count units before start if count < 0, or after end if count > 0. Look at start if count == 0
    • out - the actual number of boundary type units that were moved. This may be fewer than the input count
  • [out] result - the requested substring. This may be empty or null when no appropriate substring is found, or if the type is invalid.
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getText.

Returns a substring and its range for the given range, count and boundary type.
public void
getTextBounds(AccessibleTextEvent
an event object containing the following fields:
  • [in] start - the 0 based offset of the first character of the substring in the bounding box
  • [in] end - the 0 based offset after the last character of the substring in the bounding box
  • [typical out] x - the X coordinate of the top left corner of the bounding box of the specified substring
  • [typical out] y - the Y coordinate of the top left corner of the bounding box of the specified substring
  • [typical out] width - the width of the bounding box of the specified substring
  • [typical out] height - the height of the bounding box of the specified substring
  • [optional out] rectangles - a set of disjoint bounding rectangles, if the specified text range includes partial lines
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getTextBounds.

Returns the bounding box(es) of the specified text range in display coordinates.
public void
getVisibleRanges(AccessibleTextEvent
an event object containing the following fields:
  • [typical out] start - the 0 based offset of the first character of the visible substring
  • [typical out] end - the 0 based offset after the last character of the visible substring
  • [optional out] ranges - an array of pairs specifying the start and end offsets of each range, if the visible text range is clipped
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getVisibleRanges.

Returns the visible text range(s).
public void
removeSelection(AccessibleTextEvent
an event object containing the following fields:
  • [in] index - the 0 based index of selection to remove
  • [out] result - set to ACC#OK if the range of text was deselected
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.removeSelection.

Deselects a range of text.
public void
scrollText(AccessibleTextEvent
an event object containing the following fields:
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.scrollText.

Scrolls a specific part of a substring according to the scroll type.
public void
setCaretOffset(AccessibleTextEvent
an event object containing the following fields:
  • [in] offset - the new offset of the caret
  • [out] result - set to ACC#OK if the caret position was set
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.setCaretOffset.

Sets the position of the caret.
public void
setSelection(AccessibleTextEvent
an event object containing the following fields:
  • [in] index - the 0 based index of the selection to change
  • [in] start - the new 0 based offset of the first character of the selection
  • [in] end - the new 0 based offset after the last character of the selection
  • [out] result - set to ACC#OK if the selection was set
e
)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.setSelection.

Changes the bounds of an existing selection.
Inherited from org.eclipse.swt.accessibility.AccessibleTextAdapter:
getCaretOffsetgetSelectionRange

Constructor Detail

AccessibleTextExtendedAdapterback to summary
public AccessibleTextExtendedAdapter()

Method Detail

addSelectionback to summary
public void addSelection(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.addSelection.

Adds a text selection.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] start - the 0 based offset of the first character of the new selection
  • [in] end - the 0 based offset after the last character of the new selection
  • [out] result - set to ACC#OK if the text selection was added
Annotations
@Override
getCharacterCountback to summary
public void getCharacterCount(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getCharacterCount.

Returns the total number of characters in the text.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [out] count - the total number of characters
Annotations
@Override
getHyperlinkCountback to summary
public void getHyperlinkCount(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getHyperlinkCount.

Returns the number of links and link groups contained within this hypertext paragraph.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [out] count - the number of links and link groups within this hypertext paragraph, or 0 if there are none
Annotations
@Override
getHyperlinkIndexback to summary
public void getHyperlinkIndex(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getHyperlinkIndex.

Returns the index of the hyperlink that is associated with this character offset.

This is the case when a link spans the given character index.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] offset - the 0 based offset of the character for which to return the link index
  • [out] index - the 0 based index of the hyperlink that is associated with this character offset, or -1 if the offset is not in a link
Annotations
@Override
getOffsetAtPointback to summary
public void getOffsetAtPoint(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getOffsetAtPoint.

Returns the offset of the character under the specified point.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] x - the X value in display coordinates for which to look up the offset of the character that is rendered on the display at that point
  • [in] y - the position's Y value for which to look up the offset of the character that is rendered on the display at that point
  • [out] offset - the 0 based offset of the character under the given point, or -1 if the point is invalid or there is no character under the point
Annotations
@Override
getRangesback to summary
public void getRanges(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getRanges.

Returns the text range(s) contained within the given bounding box.

Partially visible characters are included in the returned ranges.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] x - the X coordinate of the top left corner of the bounding box, in display relative coordinates
  • [in] y - the Y coordinate of the top left corner of the bounding box, in display relative coordinates
  • [in] width - the width of the bounding box
  • [in] height - the height of the bounding box
  • [typical out] start - the 0 based offset of the first character of the substring in the bounding box
  • [typical out] end - the 0 based offset after the last character of the substring in the bounding box
  • [optional out] ranges - an array of pairs specifying the start and end offsets of each range, if the text range is clipped by the bounding box
Annotations
@Override
getSelectionback to summary
public void getSelection(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getSelection.

Returns the character offsets of the specified text selection.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] index - the 0 based index of the selection
  • [out] start - the 0 based offset of first selected character
  • [out] end - the 0 based offset after the last selected character
Annotations
@Override
getSelectionCountback to summary
public void getSelectionCount(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getSelectionCount.

Returns the number of active non-contiguous selections.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [out] count - the number of active non-contiguous selections
Annotations
@Override
getTextback to summary
public void getText(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getText.

Returns a substring and its range for the given range, count and boundary type.

Returns the substring of the specified boundary type that is located count positions from the given character range. Also returns the start and end offsets of the returned substring.

For example, if the boundary type is TEXT_BOUNDARY_WORD, then the complete word that is located count words from the specified range is returned. If count is negative, then return the word that is count words before start. If count is positive, then return the word that is count words after end. If count is zero, start and end are the same, so return the word at start.

The whole text can be requested by passing start == 0 and end == getCharacterCount, TEXT_BOUNDARY_ALL, and 0 for count. Alternatively the whole text can be requested by calling AccessibleControlListener.getValue().

If start and end are valid, but no suitable word (or other boundary type) is found, the returned string is null and the returned range is degenerate (start == end).

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] type - the boundary type of the substring to return. One of:
  • [in,out] start - the 0 based offset of first character of the substring
  • [in,out] end - the 0 based offset after the last character of the substring
  • [in,out] count - the number of boundary type units to move to find the substring:
    • in - look count units before start if count < 0, or after end if count > 0. Look at start if count == 0
    • out - the actual number of boundary type units that were moved. This may be fewer than the input count
  • [out] result - the requested substring. This may be empty or null when no appropriate substring is found, or if the type is invalid.
Annotations
@Override
getTextBoundsback to summary
public void getTextBounds(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getTextBounds.

Returns the bounding box(es) of the specified text range in display coordinates.

Typically, the text range will represent a single character, i.e. end - start = 1, therefore providers should optimize for this case.

Note

The virtual character after the last character of the represented text, i.e. the one at offset getCharacterCount, is a special case. It represents the current input position and will therefore typically be queried by AT more often than other positions. Because it does not represent an existing character its bounding box is defined in relation to preceding characters. It should be roughly equivalent to the bounding box of some character when inserted at the end of the text; its height typically being the maximal height of all the characters in the text or the height of the preceding character, its width being at least one pixel so that the bounding box is not degenerate.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] start - the 0 based offset of the first character of the substring in the bounding box
  • [in] end - the 0 based offset after the last character of the substring in the bounding box
  • [typical out] x - the X coordinate of the top left corner of the bounding box of the specified substring
  • [typical out] y - the Y coordinate of the top left corner of the bounding box of the specified substring
  • [typical out] width - the width of the bounding box of the specified substring
  • [typical out] height - the height of the bounding box of the specified substring
  • [optional out] rectangles - a set of disjoint bounding rectangles, if the specified text range includes partial lines
Annotations
@Override
getVisibleRangesback to summary
public void getVisibleRanges(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.getVisibleRanges.

Returns the visible text range(s).

Partially visible characters are included in the returned ranges.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [typical out] start - the 0 based offset of the first character of the visible substring
  • [typical out] end - the 0 based offset after the last character of the visible substring
  • [optional out] ranges - an array of pairs specifying the start and end offsets of each range, if the visible text range is clipped
Annotations
@Override
removeSelectionback to summary
public void removeSelection(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.removeSelection.

Deselects a range of text.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] index - the 0 based index of selection to remove
  • [out] result - set to ACC#OK if the range of text was deselected
Annotations
@Override
scrollTextback to summary
public void scrollText(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.scrollText.

Scrolls a specific part of a substring according to the scroll type.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

Annotations
@Override
setCaretOffsetback to summary
public void setCaretOffset(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.setCaretOffset.

Sets the position of the caret.

The caret position is that of the character logically following it, e.g. to the right of it in a left to right language. The caret is actually placed to the leading side of the character with that offset. An offset of 0 places the caret so that the next insertion goes before the first character. An offset of getCharacterCount places the caret so that the next insertion goes after the last character.

Setting the caret position may or may not alter the current selection. A change of the selection is notified to the accessibility event listeners with an EVENT_TEXT_SELECTION_CHANGED event.

When the new caret position differs from the old one, this is notified to the accessibility event listeners with an EVENT_TEXT_CARET_MOVED event.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] offset - the new offset of the caret
  • [out] result - set to ACC#OK if the caret position was set
Annotations
@Override
setSelectionback to summary
public void setSelection(AccessibleTextEvent e)

Implements org.eclipse.swt.accessibility.AccessibleTextExtendedListener.setSelection.

Changes the bounds of an existing selection.

Parameters
e:AccessibleTextEvent

an event object containing the following fields:

  • [in] index - the 0 based index of the selection to change
  • [in] start - the new 0 based offset of the first character of the selection
  • [in] end - the new 0 based offset after the last character of the selection
  • [out] result - set to ACC#OK if the selection was set
Annotations
@Override