66 * Constant used to indicate that the part of the text that should be 67 * retrieved is contiguous text with the same text attributes. 68 * 69 * @see AccessibleText#getAtIndex 70 * @see AccessibleText#getAfterIndex 71 * @see AccessibleText#getBeforeIndex 72 */ 73 public static final int ATTRIBUTE_RUN = 5; // BugID: 4849720 74 75 /** 76 * Returns the text between two indices 77 * 78 * @param startIndex the start index in the text 79 * @param endIndex the end index in the text 80 * @return the text string if the indices are valid. 81 * Otherwise, null is returned. 82 */ 83 public String getTextRange(int startIndex, int endIndex); 84 85 /** 86 * Returns the <code>AccessibleTextSequence</code> at a given index. 87 * 88 * @param part the <code>CHARACTER</code>, <code>WORD</code>, 89 * <code>SENTENCE</code>, <code>LINE</code> or <code>ATTRIBUTE_RUN</code> 90 * to retrieve 91 * @param index an index within the text 92 * @return an <code>AccessibleTextSequence</code> specifying the text 93 * if part and index are valid. Otherwise, null is returned. 94 * 95 * @see AccessibleText#CHARACTER 96 * @see AccessibleText#WORD 97 * @see AccessibleText#SENTENCE 98 */ 99 public AccessibleTextSequence getTextSequenceAt(int part, int index); 100 101 /** 102 * Returns the <code>AccessibleTextSequence</code> after a given index. 103 * 104 * @param part the <code>CHARACTER</code>, <code>WORD</code>, 105 * <code>SENTENCE</code>, <code>LINE</code> or <code>ATTRIBUTE_RUN</code> 106 * to retrieve 107 * @param index an index within the text 108 * @return an <code>AccessibleTextSequence</code> specifying the text 109 * if part and index are valid. Otherwise, null is returned. 110 * 111 * @see AccessibleText#CHARACTER 112 * @see AccessibleText#WORD 113 * @see AccessibleText#SENTENCE 114 */ 115 public AccessibleTextSequence getTextSequenceAfter(int part, int index); 116 117 /** 118 * Returns the <code>AccessibleTextSequence</code> before a given index. 119 * 120 * @param part the <code>CHARACTER</code>, <code>WORD</code>, 121 * <code>SENTENCE</code>, <code>LINE</code> or <code>ATTRIBUTE_RUN</code> 122 * to retrieve 123 * @param index an index within the text 124 * @return an <code>AccessibleTextSequence</code> specifying the text 125 * if part and index are valid. Otherwise, null is returned. 126 * 127 * @see AccessibleText#CHARACTER 128 * @see AccessibleText#WORD 129 * @see AccessibleText#SENTENCE 130 */ 131 public AccessibleTextSequence getTextSequenceBefore(int part, int index); 132 133 /** 134 * Returns the bounding rectangle of the text between two indices. 135 * 136 * @param startIndex the start index in the text 137 * @param endIndex the end index in the text 138 * @return the bounding rectangle of the text if the indices are valid. 139 * Otherwise, null is returned. 140 */ 141 public Rectangle getTextBounds(int startIndex, int endIndex); 142 } | 66 * Constant used to indicate that the part of the text that should be 67 * retrieved is contiguous text with the same text attributes. 68 * 69 * @see AccessibleText#getAtIndex 70 * @see AccessibleText#getAfterIndex 71 * @see AccessibleText#getBeforeIndex 72 */ 73 public static final int ATTRIBUTE_RUN = 5; // BugID: 4849720 74 75 /** 76 * Returns the text between two indices 77 * 78 * @param startIndex the start index in the text 79 * @param endIndex the end index in the text 80 * @return the text string if the indices are valid. 81 * Otherwise, null is returned. 82 */ 83 public String getTextRange(int startIndex, int endIndex); 84 85 /** 86 * Returns the {@code AccessibleTextSequence} at a given index. 87 * 88 * @param part the {@code CHARACTER}, {@code WORD}, 89 * {@code SENTENCE}, {@code LINE} or {@code ATTRIBUTE_RUN} 90 * to retrieve 91 * @param index an index within the text 92 * @return an {@code AccessibleTextSequence} specifying the text 93 * if part and index are valid. Otherwise, null is returned. 94 * 95 * @see AccessibleText#CHARACTER 96 * @see AccessibleText#WORD 97 * @see AccessibleText#SENTENCE 98 */ 99 public AccessibleTextSequence getTextSequenceAt(int part, int index); 100 101 /** 102 * Returns the {@code AccessibleTextSequence} after a given index. 103 * 104 * @param part the {@code CHARACTER}, {@code WORD}, 105 * {@code SENTENCE}, {@code LINE} or {@code ATTRIBUTE_RUN} 106 * to retrieve 107 * @param index an index within the text 108 * @return an {@code AccessibleTextSequence} specifying the text 109 * if part and index are valid. Otherwise, null is returned. 110 * 111 * @see AccessibleText#CHARACTER 112 * @see AccessibleText#WORD 113 * @see AccessibleText#SENTENCE 114 */ 115 public AccessibleTextSequence getTextSequenceAfter(int part, int index); 116 117 /** 118 * Returns the {@code AccessibleTextSequence} before a given index. 119 * 120 * @param part the {@code CHARACTER}, {@code WORD}, 121 * {@code SENTENCE}, {@code LINE} or {@code ATTRIBUTE_RUN} 122 * to retrieve 123 * @param index an index within the text 124 * @return an {@code AccessibleTextSequence} specifying the text 125 * if part and index are valid. Otherwise, null is returned. 126 * 127 * @see AccessibleText#CHARACTER 128 * @see AccessibleText#WORD 129 * @see AccessibleText#SENTENCE 130 */ 131 public AccessibleTextSequence getTextSequenceBefore(int part, int index); 132 133 /** 134 * Returns the bounding rectangle of the text between two indices. 135 * 136 * @param startIndex the start index in the text 137 * @param endIndex the end index in the text 138 * @return the bounding rectangle of the text if the indices are valid. 139 * Otherwise, null is returned. 140 */ 141 public Rectangle getTextBounds(int startIndex, int endIndex); 142 } |