This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing
class JTable.AccessibleJTable

java.lang.Object extended by javax.accessibility.AccessibleContext extended by java.awt.Component.AccessibleAWTComponent extended by java.awt.Container.AccessibleAWTContainer extended by javax.swing.JComponent.AccessibleJComponent extended by javax.swing.JTable.AccessibleJTable
All Implemented Interfaces:
PropertyChangeListener, Serializable, AccessibleComponent, AccessibleExtendedComponent, AccessibleExtendedTable, AccessibleSelection, CellEditorListener, ListSelectionListener, TableColumnModelListener, TableModelListener
Enclosing class:
JTable

protected class JTable.AccessibleJTable
extends JComponent.AccessibleJComponent
implements AccessibleSelection, ListSelectionListener, TableModelListener, TableColumnModelListener, CellEditorListener, PropertyChangeListener, AccessibleExtendedTable

This class implements accessibility support for the JTable class. It provides an implementation of the Java Accessibility API appropriate to table user-interface elements.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see {@link java.beans.XMLEncoder}.


Nested Class Summary
protected class

           The class provides an implementation of the Java Accessibility API appropriate to table cells.
protected class

          
Nested classes/interfaces inherited from class javax.swing.JComponent.AccessibleJComponent
JComponent.AccessibleJComponent.AccessibleContainerHandler, JComponent.AccessibleJComponent.AccessibleFocusHandler
 
Nested classes/interfaces inherited from class java.awt.Container.AccessibleAWTContainer
Container.AccessibleAWTContainer.AccessibleContainerHandler
 
Nested classes/interfaces inherited from class java.awt.Component.AccessibleAWTComponent
Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandler
   
Field Summary
 
Fields inherited from class javax.swing.JComponent.AccessibleJComponent
accessibleContainerHandler, accessibleFocusHandler
 
Fields inherited from class java.awt.Container.AccessibleAWTContainer
accessibleContainerHandler
 
Fields inherited from class java.awt.Component.AccessibleAWTComponent
accessibleAWTComponentHandler, accessibleAWTFocusHandler
 
Fields inherited from class javax.accessibility.AccessibleContext
accessibleDescription, accessibleName, accessibleParent, ACCESSIBLE_ACTION_PROPERTY, ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY, ACCESSIBLE_CARET_PROPERTY, ACCESSIBLE_CHILD_PROPERTY, ACCESSIBLE_COMPONENT_BOUNDS_CHANGED, ACCESSIBLE_DESCRIPTION_PROPERTY, ACCESSIBLE_HYPERTEXT_OFFSET, ACCESSIBLE_INVALIDATE_CHILDREN, ACCESSIBLE_NAME_PROPERTY, ACCESSIBLE_SELECTION_PROPERTY, ACCESSIBLE_STATE_PROPERTY, ACCESSIBLE_TABLE_CAPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED, ACCESSIBLE_TABLE_MODEL_CHANGED, ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_ROW_HEADER_CHANGED, ACCESSIBLE_TABLE_SUMMARY_CHANGED, ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED, ACCESSIBLE_TEXT_PROPERTY, ACCESSIBLE_VALUE_PROPERTY, ACCESSIBLE_VISIBLE_DATA_PROPERTY
 
Constructor Summary
protected

          AccessibleJTable constructor
 
Method Summary
 void

          Adds the specified Accessible child of the object to the object's selection.
 void

          Clears the selection in the object, so that no children in the object are selected.
 void

          Track changes to the table contents (column insertions)
 void

          Track changes of a column moving due to margin changes.
 void

          Track changes of a column repositioning.
 void

          Track changes to the table contents (column deletions)
 void

          Track that the selection model of the TableColumnModel changed.
 void

          Invoked when editing is canceled.
 void

          Track changes to a cell's contents.
 Accessible
getAccessibleAt(int r, int c)

          
 Accessible

          Returns the Accessible child, if one exists, contained at the local coordinate Point.
 Accessible

          Returns the caption for the table.
 Accessible

          Returns the nth Accessible child of the object.
 int

          Returns the number of accessible children in the object.
 int

          Returns the column number of an index in the table.
 int

          Returns the column at a given index into the table.
 int

          
 Accessible

          Returns the description of the specified column in the table.
 int

          Returns the number of columns occupied by the Accessible at a given (row, column).
 AccessibleTable

          Returns the column headers as an AccessibleTable.
 int
getAccessibleIndex(int r, int c)

          Returns the index at a row and column in the table.
 int
getAccessibleIndexAt(int r, int c)

          Returns the index at a given (row, column) in the table.
 AccessibleRole

          Gets the role of this object.
 int
getAccessibleRow(int index)

          Returns the row number of an index in the table.
 int

          Returns the row at a given index into the table.
 int

          
 Accessible

          Returns the description of the specified row in the table.
 int
getAccessibleRowExtentAt(int r, int c)

          Returns the number of rows occupied by the Accessible at a specified row and column in the table.
 AccessibleTable

          Returns the row headers as an AccessibleTable.
 AccessibleSelection

          Get the AccessibleSelection associated with this object.
 Accessible

          Returns an Accessible representing the specified selected child in the object.
 int

          Returns the number of Accessible children currently selected.
 Accessible

          Returns the summary description of the table.
 AccessibleTable

          Gets the AccessibleTable associated with this object.
 int[]

          Returns the selected columns in a table.
 int[]

          Returns the selected rows in a table.
 boolean

          Determines if the current child of this object is selected.
 boolean

          Returns a boolean value indicating whether the specified column is selected.
 boolean

          Returns a boolean value indicating whether the specified row is selected.
 boolean
isAccessibleSelected(int r, int c)

          Returns a boolean value indicating whether the accessible at a given (row, column) is selected.
 void

          Track changes to selection model, column model, etc.
 void

          Removes the specified child of the object from the object's selection.
 void

          Causes every child of the object to be selected, but only if the JTable supports multiple selections, and if individual cell selection is enabled.
 void

          Sets the caption for the table.
 void

          Sets the description text of the specified column of the table.
 void

          Sets the column headers as an AccessibleTable.
 void

          Sets the description text of the specified row of the table.
 void

          Sets the row headers as an AccessibleTable.
 void

          Sets the summary description of the table.
 void

          Track changes to the table contents
 void

          Track changes to the table contents (row deletions)
 void

          Track changes to the table contents (row insertions)
 void

          Track changes to table cell selections
 
Methods inherited from class javax.swing.JComponent.AccessibleJComponent
addPropertyChangeListener, getAccessibleChild, getAccessibleChildrenCount, getAccessibleDescription, getAccessibleKeyBinding, getAccessibleName, getAccessibleRole, getAccessibleStateSet, getBorderTitle, getTitledBorderText, getToolTipText, removePropertyChangeListener
 
Methods inherited from class java.awt.Container.AccessibleAWTContainer
addPropertyChangeListener, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount
 
Methods inherited from class java.awt.Component.AccessibleAWTComponent
addFocusListener, addPropertyChangeListener, contains, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAccessibleComponent, getAccessibleDescription, getAccessibleIndexInParent, getAccessibleName, getAccessibleParent, getAccessibleRole, getAccessibleStateSet, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocale, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, removePropertyChangeListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisible
 
Methods inherited from class javax.accessibility.AccessibleContext
addPropertyChangeListener, firePropertyChange, getAccessibleAction, getAccessibleChild, getAccessibleChildrenCount, getAccessibleComponent, getAccessibleDescription, getAccessibleEditableText, getAccessibleIcon, getAccessibleIndexInParent, getAccessibleName, getAccessibleParent, getAccessibleRelationSet, getAccessibleRole, getAccessibleSelection, getAccessibleStateSet, getAccessibleTable, getAccessibleText, getAccessibleValue, getLocale, removePropertyChangeListener, setAccessibleDescription, setAccessibleName, setAccessibleParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTable.AccessibleJTable

protected JTable.AccessibleJTable()
AccessibleJTable constructor

Method Detail

addAccessibleSelection

public void addAccessibleSelection(int i)
Adds the specified Accessible child of the object to the object's selection. If the object supports multiple selections, the specified child is added to any existing selection, otherwise it replaces any existing selection in the object. If the specified child is already selected, this method has no effect.

This method only works on JTables which have individual cell selection enabled.

Parameters:
i - the zero-based index of the child

clearAccessibleSelection

public void clearAccessibleSelection()
Clears the selection in the object, so that no children in the object are selected.


columnAdded

public void columnAdded(TableColumnModelEvent e)
Track changes to the table contents (column insertions)

Parameters:
e

columnMarginChanged

public void columnMarginChanged(ChangeEvent e)
Track changes of a column moving due to margin changes.

Parameters:
e

columnMoved

public void columnMoved(TableColumnModelEvent e)
Track changes of a column repositioning.

Parameters:
e

columnRemoved

public void columnRemoved(TableColumnModelEvent e)
Track changes to the table contents (column deletions)

Parameters:
e

columnSelectionChanged

public void columnSelectionChanged(ListSelectionEvent e)
Track that the selection model of the TableColumnModel changed.

Parameters:
e

editingCanceled

public void editingCanceled(ChangeEvent e)
Invoked when editing is canceled. The editor object is discarded and the cell is rendered once again.

Parameters:
e

editingStopped

public void editingStopped(ChangeEvent e)
Track changes to a cell's contents. Invoked when editing is finished. The changes are saved, the editor object is discarded, and the cell is rendered once again.

Parameters:
e

getAccessibleAt

public Accessible getAccessibleAt(int r,
                                  int c)
Parameters:
r
c

getAccessibleAt

public Accessible getAccessibleAt(Point p)
Returns the Accessible child, if one exists, contained at the local coordinate Point.

Overrides:
getAccessibleAt in class Container.AccessibleAWTContainer
Parameters:
p - the point defining the top-left corner of the Accessible, given in the coordinate space of the object's parent
Returns:
the Accessible, if it exists, at the specified location; else null

getAccessibleCaption

public Accessible getAccessibleCaption()
Returns the caption for the table.

Returns:
the caption for the table

getAccessibleChild

public Accessible getAccessibleChild(int i)
Returns the nth Accessible child of the object.

Overrides:
getAccessibleChild in class JComponent.AccessibleJComponent
Parameters:
i - zero-based index of child
Returns:
the nth Accessible child of the object

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of accessible children in the object. If all of the children of this object implement Accessible, then this method should return the number of children of this object.

Overrides:
getAccessibleChildrenCount in class JComponent.AccessibleJComponent
Returns:
the number of accessible children in the object

getAccessibleColumn

public int getAccessibleColumn(int index)
Returns the column number of an index in the table.

Parameters:
index - the zero-based index in the table
Returns:
the zero-based column of the table if one exists; otherwise -1.

getAccessibleColumnAtIndex

public int getAccessibleColumnAtIndex(int i)
Returns the column at a given index into the table.

Parameters:
i - zero-based index into the table
Returns:
the column at a given index

getAccessibleColumnCount

public int getAccessibleColumnCount()

getAccessibleColumnDescription

public Accessible getAccessibleColumnDescription(int c)
Returns the description of the specified column in the table.

Parameters:
c - zero-based column of the table
Returns:
the description of the column

getAccessibleColumnExtentAt

public int getAccessibleColumnExtentAt(int r,
                                       int c)
Returns the number of columns occupied by the Accessible at a given (row, column).

Parameters:
r
c
Returns:
the number of columns occupied by the Accessible at a specified row and column in the table

getAccessibleColumnHeader

public AccessibleTable getAccessibleColumnHeader()
Returns the column headers as an AccessibleTable.

Returns:
an AccessibleTable representing the column headers, or null if the table header is null

getAccessibleIndex

public int getAccessibleIndex(int r,
                              int c)
Returns the index at a row and column in the table.

Parameters:
r - zero-based row of the table
c - zero-based column of the table
Returns:
the zero-based index in the table if one exists; otherwise -1.

getAccessibleIndexAt

public int getAccessibleIndexAt(int r,
                                int c)
Returns the index at a given (row, column) in the table.

Parameters:
r - zero-based row of the table
c - zero-based column of the table
Returns:
the index into the table

getAccessibleRole

public AccessibleRole getAccessibleRole()
Gets the role of this object.

Overrides:
getAccessibleRole in class JComponent.AccessibleJComponent
Returns:
an instance of AccessibleRole describing the role of the object

getAccessibleRow

public int getAccessibleRow(int index)
Returns the row number of an index in the table.

Parameters:
index - the zero-based index in the table
Returns:
the zero-based row of the table if one exists; otherwise -1.

getAccessibleRowAtIndex

public int getAccessibleRowAtIndex(int i)
Returns the row at a given index into the table.

Parameters:
i - zero-based index into the table
Returns:
the row at a given index

getAccessibleRowCount

public int getAccessibleRowCount()

getAccessibleRowDescription

public Accessible getAccessibleRowDescription(int r)
Returns the description of the specified row in the table.

Parameters:
r - zero-based row of the table
Returns:
the description of the row

getAccessibleRowExtentAt

public int getAccessibleRowExtentAt(int r,
                                    int c)
Returns the number of rows occupied by the Accessible at a specified row and column in the table.

Parameters:
r
c
Returns:
the number of rows occupied by the Accessible at a specified row and column in the table

getAccessibleRowHeader

public AccessibleTable getAccessibleRowHeader()
Returns the row headers as an AccessibleTable.

Returns:
an AccessibleTable representing the row headers

getAccessibleSelection

public AccessibleSelection getAccessibleSelection()
Get the AccessibleSelection associated with this object. In the implementation of the Java Accessibility API for this class, return this object, which is responsible for implementing the AccessibleSelection interface on behalf of itself.

Overrides:
getAccessibleSelection in class AccessibleContext
Returns:
this object

getAccessibleSelection

public Accessible getAccessibleSelection(int i)
Returns an Accessible representing the specified selected child in the object. If there isn't a selection, or there are fewer children selected than the integer passed in, the return value will be null.

Note that the index represents the i-th selected child, which is different from the i-th child.

Parameters:
i - the zero-based index of selected children
Returns:
the i-th selected child

getAccessibleSelectionCount

public int getAccessibleSelectionCount()
Returns the number of Accessible children currently selected. If no children are selected, the return value will be 0.

Returns:
the number of items currently selected

getAccessibleSummary

public Accessible getAccessibleSummary()
Returns the summary description of the table.

Returns:
the summary description of the table

getAccessibleTable

public AccessibleTable getAccessibleTable()
Gets the AccessibleTable associated with this object. In the implementation of the Java Accessibility API for this class, return this object, which is responsible for implementing the AccessibleTables interface on behalf of itself.

Overrides:
getAccessibleTable in class AccessibleContext
Returns:
this object

getSelectedAccessibleColumns

public int[] getSelectedAccessibleColumns()
Returns the selected columns in a table.

Returns:
an array of selected columns where each element is a zero-based column of the table

getSelectedAccessibleRows

public int[] getSelectedAccessibleRows()
Returns the selected rows in a table.

Returns:
an array of selected rows where each element is a zero-based row of the table

isAccessibleChildSelected

public boolean isAccessibleChildSelected(int i)
Determines if the current child of this object is selected.

Parameters:
i - the zero-based index of the child in this Accessible object
Returns:
true if the current child of this object is selected

isAccessibleColumnSelected

public boolean isAccessibleColumnSelected(int c)
Returns a boolean value indicating whether the specified column is selected.

Parameters:
c - zero-based column of the table
Returns:
the boolean value true if the specified column is selected; otherwise, false

isAccessibleRowSelected

public boolean isAccessibleRowSelected(int r)
Returns a boolean value indicating whether the specified row is selected.

Parameters:
r - zero-based row of the table
Returns:
the boolean value true if the specified row is selected; otherwise, false

isAccessibleSelected

public boolean isAccessibleSelected(int r,
                                    int c)
Returns a boolean value indicating whether the accessible at a given (row, column) is selected.

Parameters:
r - zero-based row of the table
c - zero-based column of the table
Returns:
the boolean value true if the accessible at (row, column) is selected; otherwise, the boolean value false

propertyChange

public void propertyChange(PropertyChangeEvent e)
Track changes to selection model, column model, etc. so as to be able to re-place listeners on those in order to pass on information to the Accessibility PropertyChange mechanism

Parameters:
e

removeAccessibleSelection

public void removeAccessibleSelection(int i)
Removes the specified child of the object from the object's selection. If the specified item isn't currently selected, this method has no effect.

This method only works on JTables which have individual cell selection enabled.

Parameters:
i - the zero-based index of the child

selectAllAccessibleSelection

public void selectAllAccessibleSelection()
Causes every child of the object to be selected, but only if the JTable supports multiple selections, and if individual cell selection is enabled.


setAccessibleCaption

public void setAccessibleCaption(Accessible a)
Sets the caption for the table.

Parameters:
a - the caption for the table

setAccessibleColumnDescription

public void setAccessibleColumnDescription(int c,
                                           Accessible a)
Sets the description text of the specified column of the table.

Parameters:
c - zero-based column of the table
a - the description of the column

setAccessibleColumnHeader

public void setAccessibleColumnHeader(AccessibleTable a)
Sets the column headers as an AccessibleTable.

Parameters:
a - an AccessibleTable representing the column headers

setAccessibleRowDescription

public void setAccessibleRowDescription(int r,
                                        Accessible a)
Sets the description text of the specified row of the table.

Parameters:
r - zero-based row of the table
a - the description of the row

setAccessibleRowHeader

public void setAccessibleRowHeader(AccessibleTable a)
Sets the row headers as an AccessibleTable.

Parameters:
a - an AccessibleTable representing the row headers

setAccessibleSummary

public void setAccessibleSummary(Accessible a)
Sets the summary description of the table.

Parameters:
a - the summary description of the table

tableChanged

public void tableChanged(TableModelEvent e)
Track changes to the table contents

Parameters:
e

tableRowsDeleted

public void tableRowsDeleted(TableModelEvent e)
Track changes to the table contents (row deletions)

Parameters:
e

tableRowsInserted

public void tableRowsInserted(TableModelEvent e)
Track changes to the table contents (row insertions)

Parameters:
e

valueChanged

public void valueChanged(ListSelectionEvent e)
Track changes to table cell selections

Parameters:
e


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.