0N/A/*
2362N/A * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.accessibility;
0N/A
0N/A
0N/Aimport java.util.*;
0N/Aimport java.awt.*;
0N/Aimport javax.swing.text.*;
0N/A
0N/A
0N/A/**
0N/A * Encapsulation of a link, or set of links (e.g. client side imagemap)
0N/A * in a Hypertext document
0N/A *
0N/A * @see Accessible
0N/A * @see Accessible#getAccessibleContext
0N/A * @see AccessibleContext
0N/A * @see AccessibleText
0N/A * @see AccessibleContext#getAccessibleText
0N/A *
0N/A * @author Peter Korn
0N/A */
0N/Apublic abstract class AccessibleHyperlink implements AccessibleAction {
0N/A
0N/A /**
0N/A * Since the document a link is associated with may have
0N/A * changed, this method returns whether or not this Link is still valid
0N/A * (with respect to the document it references).
0N/A *
0N/A * @return a flag indicating whether this link is still valid with
0N/A * respect to the AccessibleHypertext it belongs to
0N/A */
0N/A public abstract boolean isValid();
0N/A
0N/A /**
0N/A * Returns the number of accessible actions available in this Link
0N/A * If there are more than one, the first one is NOT considered the
0N/A * "default" action of this LINK object (e.g. in an HTML imagemap).
0N/A * In general, links will have only one AccessibleAction in them.
0N/A *
0N/A * @return the zero-based number of Actions in this object
0N/A */
0N/A public abstract int getAccessibleActionCount();
0N/A
0N/A /**
0N/A * Performs the specified Action on the object
0N/A *
0N/A * @param i zero-based index of actions
0N/A * @return true if the action was performed; otherwise false.
0N/A * @see #getAccessibleActionCount
0N/A */
0N/A public abstract boolean doAccessibleAction(int i);
0N/A
0N/A /**
0N/A * Returns a String description of this particular
0N/A * link action. This should be a text string
0N/A * associated with anchoring text, this should be the
0N/A * anchor text. E.g. from HTML:
0N/A * <a HREF="http://www.sun.com/access">Accessibility</a>
0N/A * this method would return "Accessibility".
0N/A *
0N/A * Similarly, from this HTML:
0N/A * <a HREF="#top"><img src="top-hat.gif" alt="top hat"></a>
0N/A * this method would return "top hat"
0N/A *
0N/A * @param i zero-based index of the actions
0N/A * @return a String description of the action
0N/A * @see #getAccessibleActionCount
0N/A */
0N/A public abstract String getAccessibleActionDescription(int i);
0N/A
0N/A /**
0N/A * Returns an object that represents the link action,
0N/A * as appropriate for that link. E.g. from HTML:
0N/A * <a HREF="http://www.sun.com/access">Accessibility</a>
0N/A * this method would return a
0N/A * java.net.URL("http://www.sun.com/access.html");
0N/A *
0N/A * @param i zero-based index of the actions
0N/A * @return an Object representing the hypertext link itself
0N/A * @see #getAccessibleActionCount
0N/A */
0N/A public abstract Object getAccessibleActionObject(int i);
0N/A
0N/A /**
0N/A * Returns an object that represents the link anchor,
0N/A * as appropriate for that link. E.g. from HTML:
0N/A * <a href="http://www.sun.com/access">Accessibility</a>
0N/A * this method would return a String containing the text:
0N/A * "Accessibility".
0N/A *
0N/A * Similarly, from this HTML:
0N/A * <a HREF="#top"><img src="top-hat.gif" alt="top hat"></a>
0N/A * this might return the object ImageIcon("top-hat.gif", "top hat");
0N/A *
0N/A * @param i zero-based index of the actions
0N/A * @return an Object representing the hypertext anchor
0N/A * @see #getAccessibleActionCount
0N/A */
0N/A public abstract Object getAccessibleActionAnchor(int i);
0N/A
0N/A /**
0N/A * Gets the index with the hypertext document at which this
0N/A * link begins
0N/A *
0N/A * @return index of start of link
0N/A */
0N/A public abstract int getStartIndex();
0N/A
0N/A /**
0N/A * Gets the index with the hypertext document at which this
0N/A * link ends
0N/A *
0N/A * @return index of end of link
0N/A */
0N/A public abstract int getEndIndex();
0N/A}