javax.swing

Class JTable.AccessibleJTable

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

Provides accessibility support for JTable.
Nested Class Summary
protected classJTable.AccessibleJTable.AccessibleJTableCell
Provides accessibility support for table cells.
protected classJTable.AccessibleJTable.AccessibleJTableModelChange
Constructor Summary
protected AccessibleJTable()
Creates a new AccessibleJTable.
Method Summary
voidaddAccessibleSelection(int i)
Adds the accessible child with the specified index i to the selection.
voidclearAccessibleSelection()
Deselects all selected accessible children.
voidcolumnAdded(TableColumnModelEvent event)
voidcolumnMarginChanged(ChangeEvent event)
voidcolumnMoved(TableColumnModelEvent event)
voidcolumnRemoved(TableColumnModelEvent event)
voidcolumnSelectionChanged(ListSelectionEvent event)
voideditingCanceled(ChangeEvent event)
voideditingStopped(ChangeEvent event)
AccessiblegetAccessibleAt(int r, int c)
Returns the accessible child (table cell) at the specified row and column.
AccessiblegetAccessibleCaption()
Returns the caption of the table.
AccessiblegetAccessibleChild(int index)
Returns the accessible child at the given index.
intgetAccessibleColumn(int index)
Returns the column number of an accessible child (cell) with the specified index.
intgetAccessibleColumnAtIndex(int index)
Returns the accessible column at the specified index.
intgetAccessibleColumnCount()
Returns the number of columns in the table.
AccessiblegetAccessibleColumnDescription(int c)
Returns the accessible description for the column with the specified index, or null if no description has been set.
intgetAccessibleColumnExtentAt(int r, int c)
Returns the number of columns that the specified cell occupies.
AccessibleTablegetAccessibleColumnHeader()
Returns the column header.
intgetAccessibleIndex(int r, int c)
Returns the index of the accessible child at the specified row and column.
intgetAccessibleIndexAt(int row, int column)
Returns the accessible child index at the specified column and row.
AccessibleRolegetAccessibleRole()
Returns the accessible role for the JTable component.
intgetAccessibleRow(int index)
Returns the row number of an accessible child (cell) with the specified index.
intgetAccessibleRowAtIndex(int index)
Returns the accessible row at the specified index.
intgetAccessibleRowCount()
Returns the number of rows in the table.
AccessiblegetAccessibleRowDescription(int r)
Returns the accessible description for the row with the specified index, or null if no description has been set.
intgetAccessibleRowExtentAt(int r, int c)
Returns the number of rows that the specified cell occupies.
AccessibleTablegetAccessibleRowHeader()
Returns the accessible row header.
AccessiblegetAccessibleSelection(int i)
Returns the selected accessible object with the specified index i.
intgetAccessibleSelectionCount()
Returns the number of selected items in this table.
AccessiblegetAccessibleSummary()
Returns the summary for the table.
AccessibleTablegetAccessibleTable()
Returns the accessible table.
int[]getSelectedAccessibleColumns()
Returns the indices of all selected columns.
int[]getSelectedAccessibleRows()
Returns the indices of all selected rows.
booleanisAccessibleChildSelected(int i)
Returns true if the accessible child with the index i is selected, false otherwise.
booleanisAccessibleColumnSelected(int c)
Returns true if the column with the specified index is selected, false otherwise.
booleanisAccessibleRowSelected(int r)
Returns true if the row with the specified index is selected, false otherwise.
booleanisAccessibleSelected(int r, int c)
Returns true if the accessible child at the specified row and column is selected, false otherwise.
voidpropertyChange(PropertyChangeEvent e)
Receives notification when any of the JTable's properties changes.
voidremoveAccessibleSelection(int i)
Removes the accessible child with the specified index i from the current selection.
voidselectAllAccessibleSelection()
Selects all accessible children that can be selected.
voidsetAccessibleCaption(Accessible c)
Sets the caption for the table.
voidsetAccessibleColumnDescription(int c, Accessible description)
Sets the accessible description for the column with the specified index.
voidsetAccessibleColumnHeader(AccessibleTable header)
Sets the accessible column header.
voidsetAccessibleRowDescription(int r, Accessible description)
Sets the accessible description for the row with the specified index.
voidsetAccessibleRowHeader(AccessibleTable header)
Sets the accessible row header.
voidsetAccessibleSummary(Accessible s)
Sets the summary for the table.
voidtableChanged(TableModelEvent event)
Receives notification when the table model changes.
voidtableRowsDeleted(TableModelEvent event)
Receives notification when one or more rows have been deleted from the table.
voidtableRowsInserted(TableModelEvent event)
Receives notification when one or more rows have been inserted into the table and fires appropriate property change events.
voidvalueChanged(ListSelectionEvent event)
Receives notification when the row selection changes and fires appropriate property change events.

Constructor Detail

AccessibleJTable

protected AccessibleJTable()
Creates a new AccessibleJTable.

Since: JDK1.5

Method Detail

addAccessibleSelection

public void addAccessibleSelection(int i)
Adds the accessible child with the specified index i to the selection.

Parameters: i the index of the accessible child to add to the selection

clearAccessibleSelection

public void clearAccessibleSelection()
Deselects all selected accessible children.

columnAdded

public void columnAdded(TableColumnModelEvent event)

columnMarginChanged

public void columnMarginChanged(ChangeEvent event)

columnMoved

public void columnMoved(TableColumnModelEvent event)

columnRemoved

public void columnRemoved(TableColumnModelEvent event)

columnSelectionChanged

public void columnSelectionChanged(ListSelectionEvent event)

editingCanceled

public void editingCanceled(ChangeEvent event)

editingStopped

public void editingStopped(ChangeEvent event)

getAccessibleAt

public Accessible getAccessibleAt(int r, int c)
Returns the accessible child (table cell) at the specified row and column.

Parameters: r the row number c the column number

Returns: the accessible child (table cell) at the specified row and column

getAccessibleCaption

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

Returns: the caption of the table

See Also: setAccessibleCaption

getAccessibleChild

public Accessible getAccessibleChild(int index)
Returns the accessible child at the given index.

Parameters: index the child index.

Returns: The accessible child.

getAccessibleColumn

public int getAccessibleColumn(int index)
Returns the column number of an accessible child (cell) with the specified index.

Parameters: index the index of the cell of which the column number is queried

Returns: the column number of an accessible child (cell) with the specified index

getAccessibleColumnAtIndex

public int getAccessibleColumnAtIndex(int index)
Returns the accessible column at the specified index.

Parameters: index the index for which to query the column

Returns: the column number at the specified table index

getAccessibleColumnCount

public int getAccessibleColumnCount()
Returns the number of columns in the table.

Returns: the number of columns in the table

getAccessibleColumnDescription

public Accessible getAccessibleColumnDescription(int c)
Returns the accessible description for the column with the specified index, or null if no description has been set.

Parameters: c the column for which the description is queried

Returns: the accessible description for the column with the specified index, or null if no description has been set

getAccessibleColumnExtentAt

public int getAccessibleColumnExtentAt(int r, int c)
Returns the number of columns that the specified cell occupies. The standard table cells only occupy one column, so we return 1 here.

Parameters: r the row number c the column number

Returns: the number of rows that the specified cell occupies

getAccessibleColumnHeader

public AccessibleTable getAccessibleColumnHeader()
Returns the column header.

Returns: the column header, or null if there is no column header

getAccessibleIndex

public int getAccessibleIndex(int r, int c)
Returns the index of the accessible child at the specified row and column.

Parameters: r the row number c the column number

Returns: the index of the accessible child at the specified row and column

getAccessibleIndexAt

public int getAccessibleIndexAt(int row, int column)
Returns the accessible child index at the specified column and row.

Parameters: row the row column the column

Returns: the index of the accessible child at the specified row and column

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible role for the JTable component.

Returns: {@link AccessibleRole#TABLE}.

getAccessibleRow

public int getAccessibleRow(int index)
Returns the row number of an accessible child (cell) with the specified index.

Parameters: index the index of the cell of which the row number is queried

Returns: the row number of an accessible child (cell) with the specified index

getAccessibleRowAtIndex

public int getAccessibleRowAtIndex(int index)
Returns the accessible row at the specified index.

Parameters: index the index for which to query the row

Returns: the row number at the specified table index

getAccessibleRowCount

public int getAccessibleRowCount()
Returns the number of rows in the table.

Returns: the number of rows in the table

getAccessibleRowDescription

public Accessible getAccessibleRowDescription(int r)
Returns the accessible description for the row with the specified index, or null if no description has been set.

Parameters: r the row for which the description is queried

Returns: the accessible description for the row with the specified index, or null if no description has been set

getAccessibleRowExtentAt

public int getAccessibleRowExtentAt(int r, int c)
Returns the number of rows that the specified cell occupies. The standard table cells only occupy one row, so we return 1 here.

Parameters: r the row number c the column number

Returns: the number of rows that the specified cell occupies

getAccessibleRowHeader

public AccessibleTable getAccessibleRowHeader()
Returns the accessible row header.

Returns: the accessible row header

getAccessibleSelection

public Accessible getAccessibleSelection(int i)
Returns the selected accessible object with the specified index i. This basically returns the i-th selected cell in the table when going though it row-wise, and inside the rows, column-wise.

Parameters: i the index of the selected object to find

Returns: the selected accessible object with the specified index i

getAccessibleSelectionCount

public int getAccessibleSelectionCount()
Returns the number of selected items in this table.

getAccessibleSummary

public Accessible getAccessibleSummary()
Returns the summary for the table.

Returns: the summary for the table

getAccessibleTable

public AccessibleTable getAccessibleTable()
Returns the accessible table.

Returns: this.

getSelectedAccessibleColumns

public int[] getSelectedAccessibleColumns()
Returns the indices of all selected columns.

Returns: the indices of all selected columns

getSelectedAccessibleRows

public int[] getSelectedAccessibleRows()
Returns the indices of all selected rows.

Returns: the indices of all selected rows

isAccessibleChildSelected

public boolean isAccessibleChildSelected(int i)
Returns true if the accessible child with the index i is selected, false otherwise.

Parameters: i the index of the accessible to check

Returns: true if the accessible child with the index i is selected, false otherwise

isAccessibleColumnSelected

public boolean isAccessibleColumnSelected(int c)
Returns true if the column with the specified index is selected, false otherwise.

Parameters: c the column number

Returns: true if the column with the specified index is selected, false otherwise

isAccessibleRowSelected

public boolean isAccessibleRowSelected(int r)
Returns true if the row with the specified index is selected, false otherwise.

Parameters: r the row number

Returns: true if the row with the specified index is selected, false otherwise

isAccessibleSelected

public boolean isAccessibleSelected(int r, int c)
Returns true if the accessible child at the specified row and column is selected, false otherwise.

Parameters: r the row number of the child c the column number of the child

Returns: true if the accessible child at the specified row and column is selected, false otherwise

propertyChange

public void propertyChange(PropertyChangeEvent e)
Receives notification when any of the JTable's properties changes. This is used to replace the listeners on the table's model, selection model, column model and cell editor.

Parameters: e the property change event

removeAccessibleSelection

public void removeAccessibleSelection(int i)
Removes the accessible child with the specified index i from the current selection. This will only work on tables that have cell selection enabled (rowSelectionAllowed == false && columnSelectionAllowed == false).

Parameters: i the index of the accessible to be removed from the selection

selectAllAccessibleSelection

public void selectAllAccessibleSelection()
Selects all accessible children that can be selected. This will only work on tables that support multiple selections and that have individual cell selection enabled.

setAccessibleCaption

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

Parameters: c the caption to set

setAccessibleColumnDescription

public void setAccessibleColumnDescription(int c, Accessible description)
Sets the accessible description for the column with the specified index.

Parameters: c the column number for which to set the description description the description to set

setAccessibleColumnHeader

public void setAccessibleColumnHeader(AccessibleTable header)
Sets the accessible column header. The default implementation doesn't allow changing the header this way, so this is a no-op.

Parameters: header the accessible column header to set

setAccessibleRowDescription

public void setAccessibleRowDescription(int r, Accessible description)
Sets the accessible description for the row with the specified index.

Parameters: r the row number for which to set the description description the description to set

setAccessibleRowHeader

public void setAccessibleRowHeader(AccessibleTable header)
Sets the accessible row header.

Parameters: header the header to set

setAccessibleSummary

public void setAccessibleSummary(Accessible s)
Sets the summary for the table.

Parameters: s the summary to set

tableChanged

public void tableChanged(TableModelEvent event)
Receives notification when the table model changes. Depending on the type of change, this method calls {@link #tableRowsInserted} or {@link #tableRowsDeleted}.

Parameters: event the table model event

tableRowsDeleted

public void tableRowsDeleted(TableModelEvent event)
Receives notification when one or more rows have been deleted from the table.

Parameters: event the table model event

tableRowsInserted

public void tableRowsInserted(TableModelEvent event)
Receives notification when one or more rows have been inserted into the table and fires appropriate property change events.

Parameters: event the table model event

valueChanged

public void valueChanged(ListSelectionEvent event)
Receives notification when the row selection changes and fires appropriate property change events.

Parameters: event the list selection event