Method from javax.swing.text.html.AccessibleHTML$TableElementInfo$TableAccessibleContext Detail: |
public void addRowHeader(TableCellElementInfo cellInfo,
int rowNumber) {
if (rowHeadersTable == null) {
rowHeadersTable = new AccessibleHeadersTable();
}
rowHeadersTable.addHeader(cellInfo, rowNumber);
}
|
public Accessible getAccessibleAt(int r,
int c) {
TableCellElementInfo cellInfo = getCell(r, c);
if (cellInfo != null) {
return cellInfo.getAccessible();
} else {
return null;
}
}
Returns the Accessible at a specified row and column
in the table. |
public Accessible getAccessibleCaption() {
ElementInfo captionInfo = getCaptionInfo();
if (captionInfo instanceof Accessible) {
return (Accessible)caption;
} else {
return null;
}
}
Returns the caption for the table. |
public Accessible getAccessibleChild(int i) {
int rowCount = ((TableElementInfo)elementInfo).getRowCount();
int columnCount = ((TableElementInfo)elementInfo).getColumnCount();
int r = i / rowCount;
int c = i % columnCount;
if (r < 0 || r >= rowCount || c < 0 || c >= columnCount) {
return null;
} else {
return getAccessibleAt(r, c);
}
}
Returns the specified Accessible child of the object. The Accessible
children of an Accessible object are zero-based, so the first child
of an Accessible child is at index 0, the second child is at index 1,
and so on. |
public int getAccessibleChildrenCount() {
return ((TableElementInfo)elementInfo).getRowCount() *
((TableElementInfo)elementInfo).getColumnCount();
}
Returns the number of accessible children of the object. |
public int getAccessibleColumn(int index) {
if (validateIfNecessary()) {
int numCells = getAccessibleColumnCount() *
getAccessibleRowCount();
if (index >= numCells) {
return -1;
} else {
return index % getAccessibleColumnCount();
}
}
return -1;
}
Returns the column number of an index in the table. |
public int getAccessibleColumnCount() {
return ((TableElementInfo)elementInfo).getColumnCount();
}
Returns the number of columns in the table. |
public Accessible getAccessibleColumnDescription(int c) {
return null;
}
Returns the description text of the specified column in the table. |
public int getAccessibleColumnExtentAt(int r,
int c) {
return ((TableElementInfo)elementInfo).getColumnExtentAt(r, c);
}
Returns the number of columns occupied by the Accessible at
a specified row and column in the table. |
public AccessibleTable getAccessibleColumnHeader() {
return null;
}
Returns the column headers as an AccessibleTable. |
public String getAccessibleColumnHeader(int c) {
if (validateIfNecessary()) {
TableCellElementInfo cellInfo = getCell(0, c);
if (cellInfo.isHeaderCell()) {
View v = cellInfo.getView();
if (v != null && model != null) {
try {
return model.getText(v.getStartOffset(),
v.getEndOffset() -
v.getStartOffset());
} catch (BadLocationException e) {
return null;
}
}
}
}
return null;
}
Returns the column header at a column in a table. |
public String getAccessibleDescription() {
return editor.getContentType();
}
Gets the accessibleDescription property of this object. If this
property isn't set, returns the content type of this
JEditorPane instead (e.g. "plain/text", "html/text"). |
public int getAccessibleIndex(int r,
int c) {
if (validateIfNecessary()) {
if (r >= getAccessibleRowCount() ||
c >= getAccessibleColumnCount()) {
return -1;
} else {
return r * getAccessibleColumnCount() + c;
}
}
return -1;
}
Returns the index at a row and column in the table. |
public int getAccessibleIndexInParent() {
return elementInfo.getIndexInParent();
}
Gets the 0-based index of this object in its accessible parent. |
public String getAccessibleName() {
// return the role of the object
return getAccessibleRole().toString();
}
Gets the accessibleName property of this object. The accessibleName
property of an object is a localized String that designates the purpose
of the object. For example, the accessibleName property of a label
or button might be the text of the label or button itself. In the
case of an object that doesn't display its name, the accessibleName
should still be set. For example, in the case of a text field used
to enter the name of a city, the accessibleName for the en_US locale
could be 'city.' |
public AccessibleRole getAccessibleRole() {
return AccessibleRole.TABLE;
}
Gets the role of this object. The role of the object is the generic
purpose or use of the class of this object. For example, the role
of a push button is AccessibleRole.PUSH_BUTTON. The roles in
AccessibleRole are provided so component developers can pick from
a set of predefined roles. This enables assistive technologies to
provide a consistent interface to various tweaked subclasses of
components (e.g., use AccessibleRole.PUSH_BUTTON for all components
that act like a push button) as well as distinguish between sublasses
that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes
and AccessibleRole.RADIO_BUTTON for radio buttons).
Note that the AccessibleRole class is also extensible, so
custom component developers can define their own AccessibleRole's
if the set of predefined roles is inadequate. |
public int getAccessibleRow(int index) {
if (validateIfNecessary()) {
int numCells = getAccessibleColumnCount() *
getAccessibleRowCount();
if (index >= numCells) {
return -1;
} else {
return index / getAccessibleColumnCount();
}
}
return -1;
}
Returns the row number of an index in the table. |
public int getAccessibleRowCount() {
return ((TableElementInfo)elementInfo).getRowCount();
}
Returns the number of rows in the table. |
public Accessible getAccessibleRowDescription(int r) {
return null;
}
Returns the description of the specified row in the table. |
public int getAccessibleRowExtentAt(int r,
int c) {
return ((TableElementInfo)elementInfo).getRowExtentAt(r, c);
}
Returns the number of rows occupied by the Accessible at
a specified row and column in the table. |
public AccessibleTable getAccessibleRowHeader() {
return rowHeadersTable;
}
Returns the row headers as an AccessibleTable. |
public String getAccessibleRowHeader(int r) {
if (validateIfNecessary()) {
TableCellElementInfo cellInfo = getCell(r, 0);
if (cellInfo.isHeaderCell()) {
View v = cellInfo.getView();
if (v != null && model != null) {
try {
return model.getText(v.getStartOffset(),
v.getEndOffset() -
v.getStartOffset());
} catch (BadLocationException e) {
return null;
}
}
}
}
return null;
}
Returns the row header at a row in a table. |
public Accessible getAccessibleSummary() {
return null;
}
Returns the summary description of the table. |
public AccessibleTable getAccessibleTable() {
return this;
}
|
public int[] getSelectedAccessibleColumns() {
if (validateIfNecessary()) {
int nColumns = getAccessibleRowCount();
Vector< Integer > vec = new Vector< Integer >();
for (int i = 0; i < nColumns; i++) {
if (isAccessibleColumnSelected(i)) {
vec.addElement(Integer.valueOf(i));
}
}
int retval[] = new int[vec.size()];
for (int i = 0; i < retval.length; i++) {
retval[i] = vec.elementAt(i).intValue();
}
return retval;
}
return new int[0];
}
Returns the selected columns in a table. |
public int[] getSelectedAccessibleRows() {
if (validateIfNecessary()) {
int nRows = getAccessibleRowCount();
Vector< Integer > vec = new Vector< Integer >();
for (int i = 0; i < nRows; i++) {
if (isAccessibleRowSelected(i)) {
vec.addElement(Integer.valueOf(i));
}
}
int retval[] = new int[vec.size()];
for (int i = 0; i < retval.length; i++) {
retval[i] = vec.elementAt(i).intValue();
}
return retval;
}
return new int[0];
}
Returns the selected rows in a table. |
public boolean isAccessibleColumnSelected(int c) {
if (validateIfNecessary()) {
if (c < 0 || c >= getAccessibleColumnCount()) {
return false;
}
int nRows = getAccessibleRowCount();
TableCellElementInfo startCell = getCell(0, c);
if (startCell == null) {
return false;
}
int start = startCell.getElement().getStartOffset();
TableCellElementInfo endCell = getCell(nRows-1, c);
if (endCell == null) {
return false;
}
int end = endCell.getElement().getEndOffset();
return start >= editor.getSelectionStart() &&
end < = editor.getSelectionEnd();
}
return false;
}
Returns a boolean value indicating whether the specified column
is selected. |
public boolean isAccessibleRowSelected(int r) {
if (validateIfNecessary()) {
if (r < 0 || r >= getAccessibleRowCount()) {
return false;
}
int nColumns = getAccessibleColumnCount();
TableCellElementInfo startCell = getCell(r, 0);
if (startCell == null) {
return false;
}
int start = startCell.getElement().getStartOffset();
TableCellElementInfo endCell = getCell(r, nColumns-1);
if (endCell == null) {
return false;
}
int end = endCell.getElement().getEndOffset();
return start >= editor.getSelectionStart() &&
end < = editor.getSelectionEnd();
}
return false;
}
Returns a boolean value indicating whether the specified row
is selected. |
public boolean isAccessibleSelected(int r,
int c) {
if (validateIfNecessary()) {
if (r < 0 || r >= getAccessibleRowCount() ||
c < 0 || c >= getAccessibleColumnCount()) {
return false;
}
TableCellElementInfo cell = getCell(r, c);
if (cell != null) {
Element elem = cell.getElement();
int start = elem.getStartOffset();
int end = elem.getEndOffset();
return start >= editor.getSelectionStart() &&
end < = editor.getSelectionEnd();
}
}
return false;
}
Returns a boolean value indicating whether the accessible at
a specified row and column is selected. |
public void setAccessibleCaption(Accessible a) {
}
Sets the caption for the table. |
public void setAccessibleColumnDescription(int c,
Accessible a) {
}
Sets the description text of the specified column in the table. |
public void setAccessibleColumnHeader(AccessibleTable table) {
}
|
public void setAccessibleRowDescription(int r,
Accessible a) {
}
Sets the description text of the specified row of the table. |
public void setAccessibleRowHeader(AccessibleTable table) {
}
|
public void setAccessibleSummary(Accessible a) {
}
Sets the summary description of the table |