Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/accessibility/AccessibleEditableText.java
38829 views
/*1* Copyright (c) 2000, 2006, 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 java.util.*;28import java.awt.*;29import javax.swing.text.*;3031/**32* <P>The AccessibleEditableText interface should be implemented by all33* classes that present editable textual information on the display.34* Along with the AccessibleText interface, this interface provides35* the standard mechanism for an assistive technology to access36* that text via its content, attributes, and spatial location.37* Applications can determine if an object supports the AccessibleEditableText38* interface by first obtaining its AccessibleContext (see {@link Accessible})39* and then calling the {@link AccessibleContext#getAccessibleEditableText}40* method of AccessibleContext. If the return value is not null, the object41* supports this interface.42*43* @see Accessible44* @see Accessible#getAccessibleContext45* @see AccessibleContext46* @see AccessibleContext#getAccessibleText47* @see AccessibleContext#getAccessibleEditableText48*49* @author Lynn Monsanto50* @since 1.451*/5253public interface AccessibleEditableText extends AccessibleText {5455/**56* Sets the text contents to the specified string.57*58* @param s the string to set the text contents59*/60public void setTextContents(String s);6162/**63* Inserts the specified string at the given index/64*65* @param index the index in the text where the string will66* be inserted67* @param s the string to insert in the text68*/69public void insertTextAtIndex(int index, String s);7071/**72* Returns the text string between two indices.73*74* @param startIndex the starting index in the text75* @param endIndex the ending index in the text76* @return the text string between the indices77*/78public String getTextRange(int startIndex, int endIndex);7980/**81* Deletes the text between two indices82*83* @param startIndex the starting index in the text84* @param endIndex the ending index in the text85*/86public void delete(int startIndex, int endIndex);8788/**89* Cuts the text between two indices into the system clipboard.90*91* @param startIndex the starting index in the text92* @param endIndex the ending index in the text93*/94public void cut(int startIndex, int endIndex);9596/**97* Pastes the text from the system clipboard into the text98* starting at the specified index.99*100* @param startIndex the starting index in the text101*/102public void paste(int startIndex);103104/**105* Replaces the text between two indices with the specified106* string.107*108* @param startIndex the starting index in the text109* @param endIndex the ending index in the text110* @param s the string to replace the text between two indices111*/112public void replaceText(int startIndex, int endIndex, String s);113114/**115* Selects the text between two indices.116*117* @param startIndex the starting index in the text118* @param endIndex the ending index in the text119*/120public void selectText(int startIndex, int endIndex);121122/**123* Sets attributes for the text between two indices.124*125* @param startIndex the starting index in the text126* @param endIndex the ending index in the text127* @param as the attribute set128* @see AttributeSet129*/130public void setAttributes(int startIndex, int endIndex, AttributeSet as);131132}133134135