Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/accessibility/AccessibleHypertext.java
38829 views
/*1* Copyright (c) 1998, 2000, 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;262728import java.util.*;29import java.awt.*;30import javax.swing.text.*;313233/**34* <P>The AccessibleHypertext class is the base class for all35* classes that present hypertext information on the display. This class36* provides the standard mechanism for an assistive technology to access37* that text via its content, attributes, and spatial location.38* It also provides standard mechanisms for manipulating hyperlinks.39* Applications can determine if an object supports the AccessibleHypertext40* interface by first obtaining its AccessibleContext (see {@link Accessible})41* and then calling the {@link AccessibleContext#getAccessibleText}42* method of AccessibleContext. If the return value is a class which extends43* AccessibleHypertext, then that object supports AccessibleHypertext.44*45* @see Accessible46* @see Accessible#getAccessibleContext47* @see AccessibleContext48* @see AccessibleText49* @see AccessibleContext#getAccessibleText50*51* @author Peter Korn52*/53public interface AccessibleHypertext extends AccessibleText {5455/**56* Returns the number of links within this hypertext document.57*58* @return number of links in this hypertext doc.59*/60public abstract int getLinkCount();6162/**63* Returns the nth Link of this Hypertext document.64*65* @param linkIndex within the links of this Hypertext66* @return Link object encapsulating the nth link(s)67*/68public abstract AccessibleHyperlink getLink(int linkIndex);6970/**71* Returns the index into an array of hyperlinks that72* is associated with this character index, or -1 if there73* is no hyperlink associated with this index.74*75* @param charIndex index within the text76* @return index into the set of hyperlinks for this hypertext doc.77*/78public abstract int getLinkIndex(int charIndex);79}808182