KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > accessibility > AccessibleEditableText


1 /*
2  * @(#)AccessibleEditableText.java 1.4 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.accessibility;
9
10 import java.util.*;
11 import java.awt.*;
12 import javax.swing.text.*;
13
14 /**
15  * <P>The AccessibleEditableText interface should be implemented by all
16  * classes that present editable textual information on the display.
17  * Along with the AccessibleText interface, this interface provides
18  * the standard mechanism for an assistive technology to access
19  * that text via its content, attributes, and spatial location.
20  * Applications can determine if an object supports the AccessibleEditableText
21  * interface by first obtaining its AccessibleContext (see {@link Accessible})
22  * and then calling the {@link AccessibleContext#getAccessibleEditableText}
23  * method of AccessibleContext. If the return value is not null, the object
24  * supports this interface.
25  *
26  * @see Accessible
27  * @see Accessible#getAccessibleContext
28  * @see AccessibleContext
29  * @see AccessibleContext#getAccessibleText
30  * @see AccessibleContext#getAccessibleEditableText
31  *
32  * @version 1.4 @(#)AccessibleEditableText.java 1.4
33  * @author Lynn Monsanto
34  */

35
36 public interface AccessibleEditableText extends AccessibleText JavaDoc {
37
38     /**
39      * Sets the text contents to the specified string.
40      *
41      * @param s the string to set the text contents
42      */

43     public void setTextContents(String JavaDoc s);
44
45     /**
46      * Inserts the specified string at the given index/
47      *
48      * @param index the index in the text where the string will
49      * be inserted
50      * @param s the string to insert in the text
51      */

52     public void insertTextAtIndex(int index, String JavaDoc s);
53
54     /**
55      * Returns the text string between two indices.
56      *
57      * @param startIndex the starting index in the text
58      * @param endIndex the ending index in the text
59      * @return the text string between the indices
60      */

61     public String JavaDoc getTextRange(int startIndex, int endIndex);
62
63     /**
64      * Deletes the text between two indices
65      *
66      * @param startIndex the starting index in the text
67      * @param endIndex the ending index in the text
68      */

69     public void delete(int startIndex, int endIndex);
70
71     /**
72      * Cuts the text between two indices into the system clipboard.
73      *
74      * @param startIndex the starting index in the text
75      * @param endIndex the ending index in the text
76      */

77     public void cut(int startIndex, int endIndex);
78
79     /**
80      * Pastes the text from the system clipboard into the text
81      * starting at the specified index.
82      *
83      * @param startIndex the starting index in the text
84      */

85     public void paste(int startIndex);
86
87     /**
88      * Replaces the text between two indices with the specified
89      * string.
90      *
91      * @param startIndex the starting index in the text
92      * @param endIndex the ending index in the text
93      * @param s the string to replace the text between two indices
94      */

95     public void replaceText(int startIndex, int endIndex, String JavaDoc s);
96
97     /**
98      * Selects the text between two indices.
99      *
100      * @param startIndex the starting index in the text
101      * @param endIndex the ending index in the text
102      */

103     public void selectText(int startIndex, int endIndex);
104
105     /**
106      * Sets attributes for the text between two indices.
107      *
108      * @param startIndex the starting index in the text
109      * @param endIndex the ending index in the text
110      * @param as the attribute set
111      * @see AttributeSet
112      */

113     public void setAttributes(int startIndex, int endIndex, AttributeSet as);
114
115 }
116
Popular Tags