当前位置: 首页>>代码示例>>Java>>正文


Java AccessibleEditableText类代码示例

本文整理汇总了Java中javax.accessibility.AccessibleEditableText的典型用法代码示例。如果您正苦于以下问题:Java AccessibleEditableText类的具体用法?Java AccessibleEditableText怎么用?Java AccessibleEditableText使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AccessibleEditableText类属于javax.accessibility包,在下文中一共展示了AccessibleEditableText类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setSelectedText

import javax.accessibility.AccessibleEditableText; //导入依赖的package包/类
static void setSelectedText(final Accessible a, final Component c, final String newText) {
    if (a == null) return;

    CAccessibility.invokeLater(new Runnable() {
        public void run() {
            final AccessibleContext ac = a.getAccessibleContext();
            if (ac == null) return;

            final AccessibleEditableText aet = ac.getAccessibleEditableText();
            if (aet == null) return;

            final int selectionStart = aet.getSelectionStart();
            final int selectionEnd = aet.getSelectionEnd();
            aet.replaceText(selectionStart, selectionEnd, newText);
        }
    }, c);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:CAccessibleText.java

示例2: setSelectedTextRange

import javax.accessibility.AccessibleEditableText; //导入依赖的package包/类
static void setSelectedTextRange(final Accessible a, final Component c, final int startIndex, final int endIndex) {
    if (a == null) return;

    CAccessibility.invokeLater(new Runnable() {
        public void run() {
            final AccessibleContext ac = a.getAccessibleContext();
            if (ac == null) return;

            final AccessibleEditableText aet = ac.getAccessibleEditableText();
            if (aet == null) return;

            final boolean validRange = (startIndex >= 0) && (endIndex >= startIndex) && (endIndex <= aet.getCharCount());
            if (!validRange) return;

            aet.selectText(startIndex, endIndex);
        }
    }, c);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:CAccessibleText.java

示例3: getAccessibleEditableText

import javax.accessibility.AccessibleEditableText; //导入依赖的package包/类
static AccessibleEditableText getAccessibleEditableText(final Accessible a, final Component c) {
    if (a == null) return null;

    return CAccessibility.invokeAndWait(new Callable<AccessibleEditableText>() {
        public AccessibleEditableText call() throws Exception {
            final AccessibleContext ac = a.getAccessibleContext();
            if (ac == null) return null;
            return ac.getAccessibleEditableText();
        }
    }, c);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:CAccessibleText.java

示例4: getTextRange

import javax.accessibility.AccessibleEditableText; //导入依赖的package包/类
static String getTextRange(final AccessibleEditableText aet, final int start, final int stop, final Component c) {
    if (aet == null) return null;

    return CAccessibility.invokeAndWait(new Callable<String>() {
        public String call() throws Exception {
            return aet.getTextRange(start, stop);
        }
    }, c);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:CAccessibleText.java

示例5: getStringForRange

import javax.accessibility.AccessibleEditableText; //导入依赖的package包/类
static String getStringForRange(final Accessible a, final Component c, final int location, final int length) {
    if (a == null) return null;
    return CAccessibility.invokeAndWait(new Callable<String>() {
        public String call() throws Exception {
            final AccessibleContext ac = a.getAccessibleContext();
            if (ac == null) return null;

            final AccessibleEditableText aet = ac.getAccessibleEditableText();
            if (aet == null) return null;

            return aet.getTextRange(location, location + length);
        }
    }, c);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:CAccessibleText.java


注:本文中的javax.accessibility.AccessibleEditableText类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。