org.eclipse.actf.accservice.core.win32.ia2
Class IA2AccessibleEditableText

java.lang.Object
  extended by org.eclipse.actf.accservice.core.win32.ia2.IA2AccessibleEditableText
All Implemented Interfaces:
IAccessibleEditableTextElement

public class IA2AccessibleEditableText
extends Object
implements IAccessibleEditableTextElement

implementation of IAccessibleEditableTextElement for GUI controls that implement IAccessible2/IBM interfaces. This interface gives write access to a text representation. This interface is typically used in conjunction with the AccessibleText interface and complements that interface with the additional ability to modify text. The substrings used with this interface are specified as follows: If startOffset is less than endOffset, the substring starts with the character at startOffset and ends with the character just before endOffset. If endOffset is lower than startOffset, the result is the same as a call with the two arguments exchanged. The whole text can be defined by passing the indices zero and IAccessibleText::nCharacters. If both indices have the same value, an empty string is defined.

Author:
Kavitha Teegala

Constructor Summary
IA2AccessibleEditableText(int accRef, IA2Accessible parent)
          Constructor used to create an accessible text object
 
Method Summary
 void copyText(int startIndex, int endIndex)
          Copies the text range into the clipboard.
 void cutText(int startIndex, int endIndex)
          Deletes a range of text and copies it to the clipboard.
 void deleteText(int startIndex, int endIndex)
          Deletes the text between two indices
 void insertText(int index, String s)
          Inserts the specified string at the given index/
protected  boolean internalCopyText(int startIndex, int endIndex)
           
protected  boolean internalCutText(int startIndex, int endIndex)
           
protected  boolean internalDeleteText(int startIndex, int endIndex)
           
protected  boolean internalInsertText(int index, String s)
           
protected  boolean internalPasteText(int startIndex)
           
 int internalRef()
          used by native code only.
protected  boolean internalReplaceText(int startIndex, int endIndex, String s)
           
protected  boolean internalSetAttributes(int startIndex, int endIndex, String as)
           
 void pasteText(int startIndex)
          Pastes the text from the system clipboard into the text starting at the specified index.
 void replaceText(int startIndex, int endIndex, String s)
          Replaces the text between two indices with the specified string.
 void setAttributes(int startIndex, int endIndex, String[] as)
          Sets attributes for the text between two indices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IA2AccessibleEditableText

public IA2AccessibleEditableText(int accRef,
                                 IA2Accessible parent)
Constructor used to create an accessible text object

Parameters:
accRef - reference pointer to the IA2Accessible text object
parent - IA2Accessible parent of this object
Method Detail

internalRef

public int internalRef()
used by native code only. Clients should not call directly.

Returns:
ptr address for native object

copyText

public void copyText(int startIndex,
                     int endIndex)
              throws InvalidComponentException
Description copied from interface: IAccessibleEditableTextElement
Copies the text range into the clipboard.

Specified by:
copyText in interface IAccessibleEditableTextElement
Parameters:
startIndex - the starting index in the text
endIndex - the ending index in the text
Throws:
InvalidComponentException

internalCopyText

protected boolean internalCopyText(int startIndex,
                                   int endIndex)

cutText

public void cutText(int startIndex,
                    int endIndex)
             throws InvalidComponentException
Description copied from interface: IAccessibleEditableTextElement
Deletes a range of text and copies it to the clipboard.

Specified by:
cutText in interface IAccessibleEditableTextElement
Parameters:
startIndex - the starting index in the text
endIndex - the ending index in the text
Throws:
InvalidComponentException

internalCutText

protected boolean internalCutText(int startIndex,
                                  int endIndex)

deleteText

public void deleteText(int startIndex,
                       int endIndex)
                throws InvalidComponentException
Description copied from interface: IAccessibleEditableTextElement
Deletes the text between two indices

Specified by:
deleteText in interface IAccessibleEditableTextElement
Parameters:
startIndex - the starting index in the text
endIndex - the ending index in the text
Throws:
InvalidComponentException

internalDeleteText

protected boolean internalDeleteText(int startIndex,
                                     int endIndex)

insertText

public void insertText(int index,
                       String s)
                throws InvalidComponentException
Description copied from interface: IAccessibleEditableTextElement
Inserts the specified string at the given index/

Specified by:
insertText in interface IAccessibleEditableTextElement
Parameters:
index - the index in the text where the string will be inserted
s - the string to insert in the text
Throws:
InvalidComponentException

internalInsertText

protected boolean internalInsertText(int index,
                                     String s)

pasteText

public void pasteText(int startIndex)
               throws InvalidComponentException
Description copied from interface: IAccessibleEditableTextElement
Pastes the text from the system clipboard into the text starting at the specified index.

Specified by:
pasteText in interface IAccessibleEditableTextElement
Parameters:
startIndex - the starting index in the text
Throws:
InvalidComponentException

internalPasteText

protected boolean internalPasteText(int startIndex)

replaceText

public void replaceText(int startIndex,
                        int endIndex,
                        String s)
                 throws InvalidComponentException
Description copied from interface: IAccessibleEditableTextElement
Replaces the text between two indices with the specified string.

Specified by:
replaceText in interface IAccessibleEditableTextElement
Parameters:
startIndex - the starting index in the text
endIndex - the ending index in the text
s - the string to replace the text between two indices
Throws:
InvalidComponentException

internalReplaceText

protected boolean internalReplaceText(int startIndex,
                                      int endIndex,
                                      String s)

setAttributes

public void setAttributes(int startIndex,
                          int endIndex,
                          String[] as)
                   throws InvalidComponentException
Description copied from interface: IAccessibleEditableTextElement
Sets attributes for the text between two indices.

Specified by:
setAttributes in interface IAccessibleEditableTextElement
Parameters:
startIndex - the starting index in the text
endIndex - the ending index in the text
as - -atrributes in a String array
Throws:
InvalidComponentException
See Also:
AttributeSet

internalSetAttributes

protected boolean internalSetAttributes(int startIndex,
                                        int endIndex,
                                        String as)