Path: blob/master/src/java.desktop/share/classes/javax/accessibility/AccessibleEditableText.java
41153 views
/*1* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.accessibility;2627import javax.swing.text.AttributeSet;2829/**30* The {@code AccessibleEditableText} interface should be implemented by all31* classes that present editable textual information on the display. Along with32* the {@code AccessibleText} interface, this interface provides the standard33* mechanism for an assistive technology to access that text via its content,34* attributes, and spatial location. Applications can determine if an object35* supports the {@code AccessibleEditableText} interface by first obtaining its36* {@code AccessibleContext} (see {@link Accessible}) and then calling the37* {@link AccessibleContext#getAccessibleEditableText} method of38* {@code AccessibleContext}. If the return value is not {@code null}, the39* object supports this interface.40*41* @author Lynn Monsanto42* @see Accessible43* @see Accessible#getAccessibleContext44* @see AccessibleContext45* @see AccessibleContext#getAccessibleText46* @see AccessibleContext#getAccessibleEditableText47* @since 1.448*/49public interface AccessibleEditableText extends AccessibleText {5051/**52* Sets the text contents to the specified string.53*54* @param s the string to set the text contents55*/56public void setTextContents(String s);5758/**59* Inserts the specified string at the given index.60*61* @param index the index in the text where the string will be inserted62* @param s the string to insert in the text63*/64public void insertTextAtIndex(int index, String s);6566/**67* Returns the text string between two indices.68*69* @param startIndex the starting index in the text70* @param endIndex the ending index in the text71* @return the text string between the indices72*/73public String getTextRange(int startIndex, int endIndex);7475/**76* Deletes the text between two indices.77*78* @param startIndex the starting index in the text79* @param endIndex the ending index in the text80*/81public void delete(int startIndex, int endIndex);8283/**84* Cuts the text between two indices into the system clipboard.85*86* @param startIndex the starting index in the text87* @param endIndex the ending index in the text88*/89public void cut(int startIndex, int endIndex);9091/**92* Pastes the text from the system clipboard into the text starting at the93* specified index.94*95* @param startIndex the starting index in the text96*/97public void paste(int startIndex);9899/**100* Replaces the text between two indices with the specified string.101*102* @param startIndex the starting index in the text103* @param endIndex the ending index in the text104* @param s the string to replace the text between two indices105*/106public void replaceText(int startIndex, int endIndex, String s);107108/**109* Selects the text between two indices.110*111* @param startIndex the starting index in the text112* @param endIndex the ending index in the text113*/114public void selectText(int startIndex, int endIndex);115116/**117* Sets attributes for the text between two indices.118*119* @param startIndex the starting index in the text120* @param endIndex the ending index in the text121* @param as the attribute set122* @see AttributeSet123*/124public void setAttributes(int startIndex, int endIndex, AttributeSet as);125}126127128